Blame SOURCES/0001-usbredirhost-Fix-Wformat-warning.patch

30f4da
From 086ececd5f7f6bd8668f11d8811bf8badb9d8c5d Mon Sep 17 00:00:00 2001
30f4da
From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= <fidencio@redhat.com>
30f4da
Date: Tue, 3 Nov 2015 10:35:22 +0100
30f4da
Subject: [PATCH] usbredirhost: Fix -Wformat warning
30f4da
MIME-Version: 1.0
30f4da
Content-Type: text/plain; charset=UTF-8
30f4da
Content-Transfer-Encoding: 8bit
30f4da
30f4da
Use "PRIu64" macro for printf-ing uint64_t variables, avoiding warnings
30f4da
like:
30f4da
usbredirhost.c: In function 'usbredirhost_can_write_iso_package':
30f4da
usbredirhost.c:1023:19: warning: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'uint64_t {aka long long unsigned int}' [-Wformat=]
30f4da
             DEBUG("START dropping isoc packets %lu buffer > %lu hi threshold",
30f4da
                   ^
30f4da
usbredirhost.c:181:57: note: in definition of macro 'DEBUG'
30f4da
 #define DEBUG(...)   va_log(host, usbredirparser_debug, __VA_ARGS__)
30f4da
                                                         ^
30f4da
usbredirhost.c:1023:19: warning: format '%lu' expects argument of type 'long unsigned int', but argument 5 has type 'uint64_t {aka long long unsigned int}' [-Wformat=]
30f4da
             DEBUG("START dropping isoc packets %lu buffer > %lu hi threshold",
30f4da
                   ^
30f4da
usbredirhost.c:181:57: note: in definition of macro 'DEBUG'
30f4da
 #define DEBUG(...)   va_log(host, usbredirparser_debug, __VA_ARGS__)
30f4da
                                                         ^
30f4da
usbredirhost.c:1028:19: warning: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'uint64_t {aka long long unsigned int}' [-Wformat=]
30f4da
             DEBUG("STOP dropping isoc packets %lu buffer < %lu low threshold",
30f4da
                   ^
30f4da
usbredirhost.c:181:57: note: in definition of macro 'DEBUG'
30f4da
 #define DEBUG(...)   va_log(host, usbredirparser_debug, __VA_ARGS__)
30f4da
                                                         ^
30f4da
usbredirhost.c:1028:19: warning: format '%lu' expects argument of type 'long unsigned int', but argument 5 has type 'uint64_t {aka long long unsigned int}' [-Wformat=]
30f4da
             DEBUG("STOP dropping isoc packets %lu buffer < %lu low threshold",
30f4da
                   ^
30f4da
usbredirhost.c:181:57: note: in definition of macro 'DEBUG'
30f4da
 #define DEBUG(...)   va_log(host, usbredirparser_debug, __VA_ARGS__)
30f4da
                                                         ^
30f4da
usbredirhost.c: In function 'usbredirhost_set_iso_threshold':
30f4da
usbredirhost.c:1162:11: warning: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'uint64_t {aka long long unsigned int}' [-Wformat=]
30f4da
     DEBUG("higher threshold is %lu bytes | lower threshold is %lu bytes",
30f4da
           ^
30f4da
usbredirhost.c:181:57: note: in definition of macro 'DEBUG'
30f4da
 #define DEBUG(...)   va_log(host, usbredirparser_debug, __VA_ARGS__)
30f4da
                                                         ^
30f4da
usbredirhost.c:1162:11: warning: format '%lu' expects argument of type 'long unsigned int', but argument 5 has type 'uint64_t {aka long long unsigned int}' [-Wformat=]
30f4da
     DEBUG("higher threshold is %lu bytes | lower threshold is %lu bytes",
30f4da
           ^
30f4da
usbredirhost.c:181:57: note: in definition of macro 'DEBUG'
30f4da
 #define DEBUG(...)   va_log(host, usbredirparser_debug, __VA_ARGS__)
30f4da
30f4da
Signed-off-by: Fabiano FidĂȘncio <fidencio@redhat.com>
30f4da
---
30f4da
 usbredirhost/usbredirhost.c | 6 +++---
30f4da
 1 file changed, 3 insertions(+), 3 deletions(-)
30f4da
30f4da
diff --git a/usbredirhost/usbredirhost.c b/usbredirhost/usbredirhost.c
30f4da
index adf9c5f..83baa3b 100644
30f4da
--- a/usbredirhost/usbredirhost.c
30f4da
+++ b/usbredirhost/usbredirhost.c
30f4da
@@ -1020,12 +1020,12 @@ static int usbredirhost_can_write_iso_package(struct usbredirhost *host)
30f4da
     size = host->buffered_output_size_func(host->func_priv);
30f4da
     if (size >= host->iso_threshold.higher) {
30f4da
         if (!host->iso_threshold.dropping)
30f4da
-            DEBUG("START dropping isoc packets %lu buffer > %lu hi threshold",
30f4da
+            DEBUG("START dropping isoc packets %" PRIu64 " buffer > %" PRIu64 " hi threshold",
30f4da
                   size, host->iso_threshold.higher);
30f4da
         host->iso_threshold.dropping = true;
30f4da
     } else if (size < host->iso_threshold.lower) {
30f4da
         if (host->iso_threshold.dropping)
30f4da
-            DEBUG("STOP dropping isoc packets %lu buffer < %lu low threshold",
30f4da
+            DEBUG("STOP dropping isoc packets %" PRIu64 " buffer < %" PRIu64 " low threshold",
30f4da
                   size, host->iso_threshold.lower);
30f4da
 
30f4da
         host->iso_threshold.dropping = false;
30f4da
@@ -1159,7 +1159,7 @@ static void usbredirhost_set_iso_threshold(struct usbredirhost *host,
30f4da
     uint64_t reference = pkts_per_transfer * transfer_count * max_packetsize;
30f4da
     host->iso_threshold.lower = reference / 2;
30f4da
     host->iso_threshold.higher = reference * 3;
30f4da
-    DEBUG("higher threshold is %lu bytes | lower threshold is %lu bytes",
30f4da
+    DEBUG("higher threshold is %" PRIu64 " bytes | lower threshold is %" PRIu64 " bytes",
30f4da
            host->iso_threshold.higher, host->iso_threshold.lower);
30f4da
 }
30f4da
 
30f4da
-- 
30f4da
2.5.5
30f4da