OSDN Git Service

Silence a warning
authorAnton Korobeynikov <asl@math.spbu.ru>
Sun, 2 Nov 2008 11:47:11 +0000 (11:47 +0000)
committerAnton Korobeynikov <asl@math.spbu.ru>
Sun, 2 Nov 2008 11:47:11 +0000 (11:47 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58563 91177308-0d34-0410-b5e6-96231b3b80d8

lib/System/Win32/Host.inc

index f105b38..7bbf2bd 100644 (file)
@@ -22,14 +22,16 @@ std::string sys::osName() {
 }
 
 std::string sys::osVersion() {
-  OSVERSIONINFO osvi = { 0 };
+  OSVERSIONINFO osvi;
+
+  memset(&osvi, 0, sizeof(osvi));
   osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
 
   if (!GetVersionEx(&osvi))
     return "";
-  
+
   char buf[64];
-  sprintf(buf, "%d.%d", osvi.dwMajorVersion, osvi.dwMinorVersion);
+  sprintf(buf, "%d.%d", (int)osvi.dwMajorVersion, (int)osvi.dwMinorVersion);
 
-  return buf;  
+  return buf;
 }