[Spice-devel] [PATCH] build: require c99 and fix uint64_t format warning on 32bits
Hans de Goede
hdegoede at redhat.com
Fri Nov 12 11:14:27 PST 2010
Hi,
Patch looks good (although I don't understand why you put the 2 of them in 1 patch).
Do you already have a freedesktop.org account so that you can push git changes
yourself? If not please request one, following this procedure:
http://www.freedesktop.org/wiki/AccountRequests
Regards,
Hans
On 11/12/2010 01:37 PM, Marc-André Lureau wrote:
> ---
> configure.ac | 5 +++++
> server/reds.c | 6 ++++--
> 2 files changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/configure.ac b/configure.ac
> index 0ab6dd8..ec0f5f1 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -18,6 +18,11 @@ SPICE_COMMON_SRCDIR='$(top_srcdir)'/common
>
> AS_IF([test "$CFLAGS" = ""], [], [_cflags_is_set=yes])
> AC_PROG_CC
> +AC_PROG_CC_C99
> +if test x"$ac_cv_prog_cc_c99" = xno; then
> + AC_MSG_ERROR([C99 compiler is required.])
> +fi
> +
> AS_IF([test "$CXXFLAGS" = ""], [], [_cxxflags_is_set=yes])
> AC_PROG_CXX
> AC_PROG_INSTALL
> diff --git a/server/reds.c b/server/reds.c
> index 7ab4925..6a14388 100644
> --- a/server/reds.c
> +++ b/server/reds.c
> @@ -18,6 +18,7 @@
>
> #include<stdint.h>
> #include<stdio.h>
> +#include<inttypes.h>
> #include<unistd.h>
> #include<sys/socket.h>
> #include<netinet/in.h>
> @@ -1766,12 +1767,13 @@ static void reds_main_handle_message(void *opaque, size_t size, uint32_t type, v
> if (roundtrip<= latency) {
> // probably high load on client or server result with incorrect values
> latency = 0;
> - red_printf("net test: invalid values, latency %lu roundtrip %lu. assuming high"
> + red_printf("net test: invalid values, latency %" PRIu64
> + " roundtrip %" PRIu64 ". assuming high"
> "bandwidth", latency, roundtrip);
> break;
> }
> bitrate_per_sec = (uint64_t)(NET_TEST_BYTES * 8) * 1000000 / (roundtrip - latency);
> - red_printf("net test: latency %f ms, bitrate %lu bps (%f Mbps)%s",
> + red_printf("net test: latency %f ms, bitrate %" PRIu64 " bps (%f Mbps)%s",
> (double)latency / 1000,
> bitrate_per_sec,
> (double)bitrate_per_sec / 1024 / 1024,
More information about the Spice-devel
mailing list