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

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