Make uc_log_init argument const

This commit is contained in:
Nils O. Selåsdal
2014-12-02 23:38:24 +01:00
parent dd925b3654
commit ab70a2c5be
2 changed files with 6 additions and 3 deletions
+5 -2
View File
@@ -100,9 +100,12 @@ struct UCLogModule {
int id; int id;
/** A short name for the module. /** A short name for the module.
* (must point to static storage)
* This will appear in log messages */ * This will appear in log messages */
const char *short_name; 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; const char *long_name;
/** The log level of this module. Only /** The log level of this module. Only
* log statements with a level >= the log_level * 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. * @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, void uc_logf(enum UC_LOG_LEVEL log_level, int module, int raw,
const char *location, const char *fmt, ...) const char *location, const char *fmt, ...)
+1 -1
View File
@@ -459,7 +459,7 @@ int uc_log_reopen_files(void)
return rc; return rc;
} }
void uc_log_init(struct UCLogModules *user_modules) void uc_log_init(const struct UCLogModules *user_modules)
{ {
g_modules = *user_modules; g_modules = *user_modules;
} }