quirks: explicitly cast the log priority
authorPeter Hutterer <peter.hutterer@who-t.net>
Mon, 18 Jun 2018 03:27:57 +0000 (13:27 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Mon, 18 Jun 2018 03:29:23 +0000 (13:29 +1000)
The values are the same and this is ABI so they will never change. Make the
cast explicit for coverity's benefit.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
src/quirks.c
tools/libinput-list-quirks.c

index ad2e2debcc77231e39d957d2a88f2a232f26cc77..b688d35f44779dcd6f12c4aa99878aa906ce8f50 100644 (file)
@@ -185,8 +185,6 @@ quirk_log_msg_va(struct quirks_context *ctx,
                 const char *format,
                 va_list args)
 {
-       enum libinput_log_priority p = priority;
-
        switch (priority) {
        /* We don't use this if we're logging through libinput */
        default:
@@ -201,7 +199,10 @@ quirk_log_msg_va(struct quirks_context *ctx,
                break;
        }
 
-       ctx->log_handler(ctx->libinput, p, format, args);
+       ctx->log_handler(ctx->libinput,
+                        (enum libinput_log_priority)priority,
+                        format,
+                        args);
 }
 
 LIBINPUT_ATTRIBUTE_PRINTF(3, 4)
index 009f7d6459707bc16653414718707df0c2c520e8..a46b2b96952b515cb89258855876d9433b6e20a8 100644 (file)
@@ -41,7 +41,7 @@ log_handler(struct libinput *this_is_null,
            va_list args)
 {
        FILE *out = stdout;
-       enum quirks_log_priorities p = priority;
+       enum quirks_log_priorities p = (enum quirks_log_priorities)priority;
        char buf[256] = {0};
        const char *prefix = "";