loader: deduplicate logger function declaration
authorEric Engestrom <eric.engestrom@intel.com>
Fri, 16 Nov 2018 12:26:17 +0000 (12:26 +0000)
committerEric Engestrom <eric.engestrom@intel.com>
Tue, 4 Dec 2018 16:29:32 +0000 (16:29 +0000)
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
src/loader/loader.c
src/loader/loader.h

index 05140b6d18fd7bc066bf24aa41f38d5bb7f94822..0f799c14fd8cd4b97f16a3e5baee65b8beca708d 100644 (file)
@@ -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;
 }
index 779ec44b75d4fb11724941a5ac0df33433204a4b..d063ab3f6c4c3a091b05d3dbd3e937296a0c1468 100644 (file)
@@ -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);