[Spice-devel] [PATCH 10/24] mingw32 build: fix various warnings

Alon Levy alevy at redhat.com
Tue Dec 7 13:28:09 PST 2010


---
 client/windows/event_sources_p.cpp |    2 +-
 client/windows/main.cpp            |   10 +++++-----
 client/windows/red_window_p.h      |    2 +-
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/client/windows/event_sources_p.cpp b/client/windows/event_sources_p.cpp
index 393ea76..c357857 100644
--- a/client/windows/event_sources_p.cpp
+++ b/client/windows/event_sources_p.cpp
@@ -88,7 +88,7 @@ bool EventSources::wait_events(int timeout_ms)
         THROW("wait failed %d", GetLastError());
     }
 
-    int event_index = wait_res - WAIT_OBJECT_0;
+    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 < (int)_handles.size())) {
diff --git a/client/windows/main.cpp b/client/windows/main.cpp
index a85acec..9c40102 100644
--- a/client/windows/main.cpp
+++ b/client/windows/main.cpp
@@ -38,7 +38,7 @@ static void init_winsock()
     }
 }
 
-char* version_string = "???";
+const char* version_string = "???";
 static char _version_string[40];
 
 static void init_version_string()
@@ -59,10 +59,10 @@ static void init_version_string()
         return;
     }
     sprintf(_version_string, "%d.%d.%d.%d",
-        file_info->dwFileVersionMS >> 16,
-        file_info->dwFileVersionMS & 0x0ffff,
-        file_info->dwFileVersionLS >> 16,
-        file_info->dwFileVersionLS & 0x0ffff);
+        (int)(file_info->dwFileVersionMS >> 16),
+        (int)(file_info->dwFileVersionMS & 0x0ffff),
+        (int)(file_info->dwFileVersionLS >> 16),
+        (int)(file_info->dwFileVersionLS & 0x0ffff));
     version_string = _version_string;
 }
 
diff --git a/client/windows/red_window_p.h b/client/windows/red_window_p.h
index 38426c7..351d9b9 100644
--- a/client/windows/red_window_p.h
+++ b/client/windows/red_window_p.h
@@ -29,7 +29,7 @@ typedef HWND Window;
 
 class CommandInfo {
 public:
-    CommandInfo() : menu (0), command (NULL) {}
+    CommandInfo() : menu (0), command (0) {}
     CommandInfo(Menu* in_menu, int in_command) : menu (in_menu), command (in_command) {}
 
     Menu* menu;
-- 
1.7.3.2



More information about the Spice-devel mailing list