From 16fad42ae4beb78bb8e22340d5740543ea71b8c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Valverde?= Date: Tue, 11 Oct 2022 16:49:55 +0100 Subject: [PATCH] wslog: rename console open preference enum --- epan/prefs.c | 4 ++-- wsutil/wslog.c | 4 ++-- wsutil/wslog.h | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/epan/prefs.c b/epan/prefs.c index a2a5cdc542..743259ecdb 100644 --- a/epan/prefs.c +++ b/epan/prefs.c @@ -3043,7 +3043,7 @@ prefs_register_modules(void) prefs_register_enum_preference(gui_module, "console_open", "Open a console window", "Open a console window (Windows only)", - &ws_log_console_open, gui_console_open_type, FALSE); + (int *)&ws_log_console_open, gui_console_open_type, FALSE); prefs_register_obsolete_preference(gui_module, "scrollbar_on_right"); prefs_register_obsolete_preference(gui_module, "packet_list_sel_browse"); @@ -4376,7 +4376,7 @@ read_registry(void) ret = RegQueryValueExA(hTestKey, LOG_HKCU_CONSOLE_OPEN, NULL, NULL, (LPBYTE)&data, &data_size); if (ret == ERROR_SUCCESS) { - ws_log_console_open = (enum ws_log_console_pref)data; + ws_log_console_open = (ws_log_console_open_pref)data; ws_noisy("Got "LOG_HKCU_CONSOLE_OPEN" from Windows registry: %d", ws_log_console_open); } else if (ret != ERROR_FILE_NOT_FOUND) { diff --git a/wsutil/wslog.c b/wsutil/wslog.c index 6b6b3e950c..9f8afe0192 100644 --- a/wsutil/wslog.c +++ b/wsutil/wslog.c @@ -130,7 +130,7 @@ static enum ws_log_level fatal_log_level = LOG_LEVEL_ERROR; static bool init_complete = false; -int ws_log_console_open = LOG_CONSOLE_OPEN_NEVER; +ws_log_console_open_pref ws_log_console_open = LOG_CONSOLE_OPEN_NEVER; static void print_err(void (*vcmdarg_err)(const char *, va_list ap), @@ -808,7 +808,7 @@ static void load_registry() return; } - ws_log_console_open = (enum ws_log_console_pref)data; + ws_log_console_open = (ws_log_console_open_pref)data; } #endif diff --git a/wsutil/wslog.h b/wsutil/wslog.h index d4ff84bab4..0f23ade4c6 100644 --- a/wsutil/wslog.h +++ b/wsutil/wslog.h @@ -52,14 +52,14 @@ extern "C" { */ #define LOG_HKCU_CONSOLE_OPEN "ConsoleOpen" -enum ws_log_console_pref { +typedef enum { LOG_CONSOLE_OPEN_NEVER, LOG_CONSOLE_OPEN_AUTO, /* On demand. */ LOG_CONSOLE_OPEN_ALWAYS, /* Open during startup. */ -}; +} ws_log_console_open_pref; WSUTIL_EXPORT -int ws_log_console_open; +ws_log_console_open_pref ws_log_console_open; /** Callback for registering a log writer. */