From 442619fd3795b7acc6ba5e36b5d68144c0050850 Mon Sep 17 00:00:00 2001 From: trinitou Date: Thu, 18 Jan 2024 07:05:34 +0100 Subject: [PATCH] Rename timestamp typedef to be consistent with clap_id etc. --- ChangeLog.md | 1 + include/clap/factory/preset-discovery.h | 6 +++--- include/clap/timestamp.h | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index 8f021deb..bfdb7e6e 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -48,6 +48,7 @@ Note: we kept the last draft factory ID in order to not break plugins already us ## Refactoring * `clap_plugin_id_t` was renamed to `clap_universal_plugin_id_t` to make it clear that it can describe more than just a CLAP plugin ID. +* `clap_timestamp_t` was renamed to `clap_timestamp` to be consistent with other types, like e.g. `clap_id`. Also it was moved to a separate header as `CLAP_PRESET_DISCOVERY_FACTORY_ID` was stabilized. ## Documentation diff --git a/include/clap/factory/preset-discovery.h b/include/clap/factory/preset-discovery.h index 7eaba6e6..20899bfa 100644 --- a/include/clap/factory/preset-discovery.h +++ b/include/clap/factory/preset-discovery.h @@ -148,8 +148,8 @@ typedef struct clap_preset_discovery_metadata_receiver { // If this function is not called, then the indexer may look at the file's creation and // modification time. void(CLAP_ABI *set_timestamps)(const struct clap_preset_discovery_metadata_receiver *receiver, - clap_timestamp_t creation_time, - clap_timestamp_t modification_time); + clap_timestamp creation_time, + clap_timestamp modification_time); // Adds a feature to the preset. // @@ -202,7 +202,7 @@ typedef struct clap_preset_discovery_soundpack { const char *homepage_url; // optional, url to the pack's homepage const char *vendor; // optional, sound pack's vendor const char *image_path; // optional, an image on disk - clap_timestamp_t release_timestamp; // release date, CLAP_TIMESTAMP_UNKNOWN if unavailable + clap_timestamp release_timestamp; // release date, CLAP_TIMESTAMP_UNKNOWN if unavailable } clap_preset_discovery_soundpack_t; // Describes a preset provider diff --git a/include/clap/timestamp.h b/include/clap/timestamp.h index d06d1131..63d2caba 100644 --- a/include/clap/timestamp.h +++ b/include/clap/timestamp.h @@ -5,7 +5,7 @@ // This type defines a timestamp: the number of seconds since UNIX EPOCH. // See C's time_t time(time_t *). -typedef uint64_t clap_timestamp_t; +typedef uint64_t clap_timestamp; // Value for unknown timestamp. -static const CLAP_CONSTEXPR clap_timestamp_t CLAP_TIMESTAMP_UNKNOWN = 0; +static const CLAP_CONSTEXPR clap_timestamp CLAP_TIMESTAMP_UNKNOWN = 0;