[PATCH 5/8] misc: Fix format specifiers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



to print a pa_usec_t, the format specifier to use is "%" PRIu64

modules/module-combine-sink.c: In function 'update_latency_range':
modules/module-combine-sink.c:750:5: warning: format '%lu' expects argument of type 'long unsigned int', but argument 6 has type 'pa_usec_t' [-Wformat]
modules/module-combine-sink.c:750:5: warning: format '%lu' expects argument of type 'long unsigned int', but argument 7 has type 'pa_usec_t' [-Wformat]

to print a size_t, use %zu

Signed-off-by: Peter Meerwald <pmeerw at pmeerw.net>
---
 src/modules/module-combine-sink.c | 2 +-
 src/tests/mcalign-test.c          | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/modules/module-combine-sink.c b/src/modules/module-combine-sink.c
index 48f5621..9040314 100644
--- a/src/modules/module-combine-sink.c
+++ b/src/modules/module-combine-sink.c
@@ -747,7 +747,7 @@ static void update_latency_range(struct userdata *u) {
     if (max_latency < min_latency)
         max_latency = min_latency;
 
-    pa_log_debug("Sink update latency range %lu %lu", min_latency, max_latency);
+    pa_log_debug("Sink update latency range %" PRIu64 " %" PRIu64, min_latency, max_latency);
     pa_sink_set_latency_range_within_thread(u->sink, min_latency, max_latency);
 }
 
diff --git a/src/tests/mcalign-test.c b/src/tests/mcalign-test.c
index bd192b5..443b4a7 100644
--- a/src/tests/mcalign-test.c
+++ b/src/tests/mcalign-test.c
@@ -74,7 +74,7 @@ int main(int argc, char *argv[]) {
 
         c.length = (size_t) r;
         pa_mcalign_push(a, &c);
-        fprintf(stderr, "Read %ld bytes\n", (long)r);
+        fprintf(stderr, "Read %zd bytes\n", r);
 
         c.index += (size_t) r;
 
-- 
1.9.1



[Index of Archives]     [Linux Audio Users]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux