From ae76f8f58d076f4159ae7bd748a1665e3659f34e Mon Sep 17 00:00:00 2001 From: Martin Lund Date: Sat, 20 Apr 2024 15:02:43 +0200 Subject: [PATCH] Clean up timestamp enum definition --- src/options.h | 2 +- src/timestamp.c | 6 +++--- src/timestamp.h | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/options.h b/src/options.h index 6f872a5..699c875 100644 --- a/src/options.h +++ b/src/options.h @@ -67,7 +67,7 @@ struct option_t bool log_append; bool log_strip; bool local_echo; - enum timestamp_t timestamp; + timestamp_t timestamp; const char *log_filename; const char *log_directory; const char *map; diff --git a/src/timestamp.c b/src/timestamp.c index aae80c3..19ea70e 100644 --- a/src/timestamp.c +++ b/src/timestamp.c @@ -94,7 +94,7 @@ char *timestamp_current_time(void) return (len < TIME_STRING_SIZE_MAX) ? time_string : NULL; } -const char* timestamp_state_to_string(enum timestamp_t timestamp) +const char* timestamp_state_to_string(timestamp_t timestamp) { switch (timestamp) { @@ -124,9 +124,9 @@ const char* timestamp_state_to_string(enum timestamp_t timestamp) } } -enum timestamp_t timestamp_option_parse(const char *arg) +timestamp_t timestamp_option_parse(const char *arg) { - enum timestamp_t timestamp = TIMESTAMP_24HOUR; // Default + timestamp_t timestamp = TIMESTAMP_24HOUR; // Default if (arg != NULL) { diff --git a/src/timestamp.h b/src/timestamp.h index 572be3c..e36660a 100644 --- a/src/timestamp.h +++ b/src/timestamp.h @@ -21,7 +21,7 @@ #pragma once -enum timestamp_t +typedef enum { TIMESTAMP_NONE, TIMESTAMP_24HOUR, @@ -29,8 +29,8 @@ enum timestamp_t TIMESTAMP_24HOUR_DELTA, TIMESTAMP_ISO8601, TIMESTAMP_END, -}; +} timestamp_t; char *timestamp_current_time(void); -const char* timestamp_state_to_string(enum timestamp_t timestamp); -enum timestamp_t timestamp_option_parse(const char *arg); +const char* timestamp_state_to_string(timestamp_t timestamp); +timestamp_t timestamp_option_parse(const char *arg);