From ab70a2c5beb3d45f01dd71c44ded5213fda68818 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nils=20O=2E=20Sel=C3=A5sdal?= Date: Tue, 2 Dec 2014 23:38:24 +0100 Subject: [PATCH] Make uc_log_init argument const --- include/ucore/logging.h | 7 +++++-- src/logging.c | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/include/ucore/logging.h b/include/ucore/logging.h index c63ebef..b7800ed 100644 --- a/include/ucore/logging.h +++ b/include/ucore/logging.h @@ -100,9 +100,12 @@ struct UCLogModule { int id; /** A short name for the module. + * (must point to static storage) * This will appear in log messages */ const char *short_name; - /** A longer description for the log module*/ + /** A longer description for the log module + * (must point to static storage) + */ const char *long_name; /** The log level of this module. Only * log statements with a level >= the log_level @@ -295,7 +298,7 @@ int uc_log_reopen_files(void); * * @param user_struct containing an array of all the modules defined by the application. */ -void uc_log_init(struct UCLogModules *user_modules); +void uc_log_init(const struct UCLogModules *user_modules); void uc_logf(enum UC_LOG_LEVEL log_level, int module, int raw, const char *location, const char *fmt, ...) diff --git a/src/logging.c b/src/logging.c index d85206f..c235546 100644 --- a/src/logging.c +++ b/src/logging.c @@ -459,7 +459,7 @@ int uc_log_reopen_files(void) return rc; } -void uc_log_init(struct UCLogModules *user_modules) +void uc_log_init(const struct UCLogModules *user_modules) { g_modules = *user_modules; }