diff options
author | Eric Engestrom <[email protected]> | 2018-11-16 12:26:17 +0000 |
---|---|---|
committer | Eric Engestrom <[email protected]> | 2018-12-04 16:29:32 +0000 |
commit | 95d62baac5daf39fc76bdffa600ffa2d5e36b25f (patch) | |
tree | 68a12f62b1a38d8c651d1287d15dffe278fda374 | |
parent | eade6ffeee253a4b7a0ddb0d5942845334827369 (diff) |
loader: deduplicate logger function declaration
Signed-off-by: Eric Engestrom <[email protected]>
Reviewed-by: Emil Velikov <[email protected]>
-rw-r--r-- | src/loader/loader.c | 4 | ||||
-rw-r--r-- | src/loader/loader.h | 3 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/loader/loader.c b/src/loader/loader.c index 05140b6d18f..0f799c14fd8 100644 --- a/src/loader/loader.c +++ b/src/loader/loader.c @@ -68,7 +68,7 @@ static void default_logger(int level, const char *fmt, ...) } } -static void (*log_)(int level, const char *fmt, ...) = default_logger; +static loader_logger *log_ = default_logger; int loader_open_device(const char *device_name) @@ -491,7 +491,7 @@ out: } void -loader_set_logger(void (*logger)(int level, const char *fmt, ...)) +loader_set_logger(loader_logger *logger) { log_ = logger; } diff --git a/src/loader/loader.h b/src/loader/loader.h index 779ec44b75d..d063ab3f6c4 100644 --- a/src/loader/loader.h +++ b/src/loader/loader.h @@ -74,8 +74,9 @@ loader_get_user_preferred_fd(int default_fd, bool *different_device); #define _LOADER_INFO 2 /* just useful info */ #define _LOADER_DEBUG 3 /* useful info for debugging */ +typedef void loader_logger(int level, const char *fmt, ...); void -loader_set_logger(void (*logger)(int level, const char *fmt, ...)); +loader_set_logger(loader_logger *logger); char * loader_get_extensions_name(const char *driver_name); |