[Spice-devel] [PATCH spice 3/4] mingw: DWORD is unsigned long

Marc-André Lureau marcandre.lureau at gmail.com
Fri Jun 29 18:02:20 PDT 2012


---
 client/red_client.cpp              |    2 +-
 client/windows/event_sources_p.cpp |    6 +++---
 client/windows/named_pipe.cpp      |    4 ++--
 client/windows/platform.cpp        |    2 +-
 client/windows/platform_utils.cpp  |    4 ++--
 5 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/client/red_client.cpp b/client/red_client.cpp
index 8f86d3e..2a88a36 100644
--- a/client/red_client.cpp
+++ b/client/red_client.cpp
@@ -886,7 +886,7 @@ void RedClient::calc_pixmap_cach_and_glz_window_size(uint32_t display_channels_h
     mem_status.dwLength = sizeof(mem_status);
 
     if (!GlobalMemoryStatusEx(&mem_status)) {
-        THROW("get mem status failed %u", GetLastError());
+        THROW("get mem status failed %lu", GetLastError());
     }
 
     //ullTotalPageFile is physical memory plus the size of the page file, minus a small overhead
diff --git a/client/windows/event_sources_p.cpp b/client/windows/event_sources_p.cpp
index bbf48d9..55a95cf 100644
--- a/client/windows/event_sources_p.cpp
+++ b/client/windows/event_sources_p.cpp
@@ -77,7 +77,7 @@ bool EventSources::wait_events(int timeout_ms)
         if (WaitMessage()) {
             return process_system_events();
         } else {
-            THROW("wait failed %d", GetLastError());
+            THROW("wait failed %lu", GetLastError());
         }
     }
 
@@ -88,13 +88,13 @@ bool EventSources::wait_events(int timeout_ms)
     }
 
     if (wait_res == WAIT_FAILED) {
-        THROW("wait failed %d", GetLastError());
+        THROW("wait failed %lu", GetLastError());
     }
 
     size_t event_index = wait_res - WAIT_OBJECT_0;
     if (event_index == _handles.size()) {
         return process_system_events();
-    } else if ((event_index >= 0) && (event_index < _handles.size())) {
+    } else if (event_index < _handles.size()) {
         _events[event_index]->action();
         return false;
     } else {
diff --git a/client/windows/named_pipe.cpp b/client/windows/named_pipe.cpp
index c813112..58cad34 100644
--- a/client/windows/named_pipe.cpp
+++ b/client/windows/named_pipe.cpp
@@ -208,7 +208,7 @@ void WinListener::create_pipe()
                             PIPE_UNLIMITED_INSTANCES, PIPE_BUF_SIZE, PIPE_BUF_SIZE,
                             PIPE_TIMEOUT, NULL);
     if (_pipe == INVALID_HANDLE_VALUE) {
-        THROW("CreateNamedPipe() failed %u", GetLastError());
+        THROW("CreateNamedPipe() failed %lu", GetLastError());
     }
     if (ConnectNamedPipe(_pipe, &_overlap)) {
         THROW("ConnectNamedPipe() is not pending");
@@ -227,6 +227,6 @@ void WinListener::create_pipe()
         break;
     }
     default:
-        THROW("ConnectNamedPipe() failed %u", GetLastError());
+        THROW("ConnectNamedPipe() failed %lu", GetLastError());
     }
 }
diff --git a/client/windows/platform.cpp b/client/windows/platform.cpp
index d3417e3..1129193 100644
--- a/client/windows/platform.cpp
+++ b/client/windows/platform.cpp
@@ -275,7 +275,7 @@ static void create_message_wind()
     }
     SetLastError(0);
     if (!(next_clipboard_viewer_win = SetClipboardViewer(platform_win)) && (err = GetLastError())) {
-        THROW("set clipboard viewer failed %u", err);
+        THROW("set clipboard viewer failed %lu", err);
     }
     if (!(clipboard_event = CreateEvent(NULL, FALSE, FALSE, NULL))) {
         THROW("create clipboard event failed");
diff --git a/client/windows/platform_utils.cpp b/client/windows/platform_utils.cpp
index a4c9c41..054c51c 100644
--- a/client/windows/platform_utils.cpp
+++ b/client/windows/platform_utils.cpp
@@ -74,7 +74,7 @@ HBITMAP get_alpha_bitmap_res(int id)
     AutoArray<uint8_t> src_pixels(new uint8_t[src_size]);
     LONG ncopy = GetBitmapBits((HBITMAP)bitmap.get(), src_size, src_pixels.get());
     if (ncopy != src_size) {
-        THROW("get vitmap bits failed, %u", GetLastError());
+        THROW("get vitmap bits failed, %lu", GetLastError());
     }
 
     AutoDC auto_dc(create_compatible_dc());
@@ -93,7 +93,7 @@ HBITMAP get_alpha_bitmap_res(int id)
 
     HBITMAP ret = CreateDIBSection(auto_dc.get(), &dest_info, 0, (VOID**)&dest, NULL, 0);
     if (!ret) {
-        THROW("create bitmap failed, %u", GetLastError());
+        THROW("create bitmap failed, %lu", GetLastError());
     }
 
     uint8_t* src_line = src_pixels.get();
-- 
1.7.10.2



More information about the Spice-devel mailing list