Re: [PATCH 04/14] Add PRIu64 format for uint64_t

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

 



> 
> From: Christophe de Dinechin <dinechin@xxxxxxxxxx>
> 
> Otherwise, clang complains:
> 
> spice-streaming-agent.cpp:414:66: warning: format specifies type 'unsigned
> long' but the argument has type 'uint64_t' (aka 'unsigned long long')
> [-Wformat]
>                     fprintf(f_log, "%lu: Frame of %zu bytes:\n", get_time(),
>                     frame.buffer_size);
>                                     ~~~                          ^~~~~~~~~~
>                                     %llu
> 1 warning generated.
> 
> Signed-off-by: Christophe de Dinechin <dinechin@xxxxxxxxxx>
> ---
>  src/spice-streaming-agent.cpp | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/src/spice-streaming-agent.cpp b/src/spice-streaming-agent.cpp
> index 760c211..5fb20d1 100644
> --- a/src/spice-streaming-agent.cpp
> +++ b/src/spice-streaming-agent.cpp
> @@ -7,6 +7,7 @@
>  #include <stdio.h>
>  #include <stdlib.h>
>  #include <stdint.h>
> +#include <inttypes.h>
>  #include <string.h>
>  #include <getopt.h>
>  #include <unistd.h>
> @@ -387,7 +388,7 @@ do_capture(const std::string &streamport, FILE *f_log)
>  
>              uint64_t time_after = get_time();
>              syslog(LOG_DEBUG,
> -                   "got a frame -- size is %zu (%lu ms) (%lu ms from last
> frame)(%lu us)\n",
> +                   "got a frame -- size is %zu (%" PRIu64 " ms) (%" PRIu64 "
> ms from last frame)(%" PRIu64 " us)\n",
>                     frame.buffer_size, (time_after - time_before)/1000,
>                     (time_after - time_last)/1000,
>                     (time_before - time_last));
> @@ -410,7 +411,7 @@ do_capture(const std::string &streamport, FILE *f_log)
>                  if (log_binary) {
>                      fwrite(frame.buffer, frame.buffer_size, 1, f_log);
>                  } else {
> -                    fprintf(f_log, "%lu: Frame of %zu bytes:\n", get_time(),
> frame.buffer_size);
> +                    fprintf(f_log, "%" PRIu64 ": Frame of %zu bytes:\n",
> get_time(), frame.buffer_size);
>                      hexdump(frame.buffer, frame.buffer_size, f_log);
>                  }
>              }

Acked-by: Frediano Ziglio <fziglio@xxxxxxxxxx>

Frediano
_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]