[Spice-commits] src/controller

Frediano Ziglio fziglio at kemper.freedesktop.org
Mon Jun 13 11:53:08 UTC 2016


 src/controller/test.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 9b83e9a7c80e8bfba97e260faf1a2d66ddb903d7
Author: Frediano Ziglio <fziglio at redhat.com>
Date:   Mon Jun 13 12:29:37 2016 +0100

    Remove some warnings compiling for Windows
    
    GetLastError returns a DWORD which is a "unsigned long" on Windows
    so use "%lu" formatting instead of "%u".
    
    Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
    Acked-by: Marc-André Lureau <mlureau at redhat.com>

diff --git a/src/controller/test.c b/src/controller/test.c
index 7c43f1b..783499c 100644
--- a/src/controller/test.c
+++ b/src/controller/test.c
@@ -49,7 +49,7 @@ void write_to_pipe (const void* data, size_t len)
 #ifdef WIN32
     DWORD written;
     if (!WriteFile (pipe, data, len, &written, NULL) || written != len) {
-        printf("Write to pipe failed %u\n", GetLastError());
+        printf("Write to pipe failed %lu\n", GetLastError());
     }
 #else
     if (send (sock, data, len, 0) != len) {
@@ -107,7 +107,7 @@ ssize_t read_from_pipe (void* data, size_t size)
 #ifdef WIN32
     DWORD bytes;
     if (!ReadFile (pipe, data, size, &bytes, NULL)) {
-        printf ("Read from pipe failed %u\n", GetLastError());
+        printf ("Read from pipe failed %lu\n", GetLastError());
     }
     read = bytes;
 #else
@@ -224,7 +224,7 @@ int main (int argc, char *argv[])
     printf ("Creating Spice controller connection %s\n", pipe_name);
     pipe = CreateFile (pipe_name, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL);
     if (pipe == INVALID_HANDLE_VALUE) {
-        printf ("Could not open pipe %u\n", GetLastError());
+        printf ("Could not open pipe %lu\n", GetLastError());
         return -1;
     }
 #else


More information about the Spice-commits mailing list