]> sourceware.org Git - newlib-cygwin.git/commitdiff
* cygcheck.cc (dump_sysinfo): Convert "if/else if" chain to a switch
authorCorinna Vinschen <corinna@vinschen.de>
Tue, 9 Oct 2012 12:47:40 +0000 (12:47 +0000)
committerCorinna Vinschen <corinna@vinschen.de>
Tue, 9 Oct 2012 12:47:40 +0000 (12:47 +0000)
statement.  Drop "not yet supported" and "Server" from Windows 2012
output string.

winsup/utils/ChangeLog
winsup/utils/cygcheck.cc

index 9abd78ffedd12b176f2b107f2150294a3e2d289a..fb650507b1ed7de0d0507749460355dd62f8e83a 100644 (file)
@@ -1,3 +1,9 @@
+2012-10-09  Corinna Vinschen  <corinna@vinschen.de>
+
+       * cygcheck.cc (dump_sysinfo): Convert "if/else if" chain to a switch
+       statement.  Drop "not yet supported" and "Server" from Windows 2012
+       output string.
+
 2012-09-02  Corinna Vinschen  <corinna@vinschen.de>
 
        * cygcheck.cc (dump_sysinfo): Drop "not yet supported" text from
index f14574f9ab3ada65358f2ef3b9ac8193e7aed37f..17c15fd38d4f35547a00ae909ee00a98205638bc 100644 (file)
@@ -1433,15 +1433,21 @@ dump_sysinfo ()
          BOOL (WINAPI *GetProductInfo) (DWORD, DWORD, DWORD, DWORD, PDWORD) =
                  (BOOL (WINAPI *)(DWORD, DWORD, DWORD, DWORD, PDWORD))
                  GetProcAddress (k32, "GetProductInfo");
-         if (osversion.dwMinorVersion == 0)
-           strcpy (osname, osversion.wProductType == VER_NT_WORKSTATION
-                           ? "Vista" : "2008");
-         else if (osversion.dwMinorVersion == 1)
-           strcpy (osname, osversion.wProductType == VER_NT_WORKSTATION
-                           ? "7" : "2008 R2");
-         else if (osversion.dwMinorVersion == 2)
-           strcpy (osname, osversion.wProductType == VER_NT_WORKSTATION
-                           ? "8" : "Server 2012 (not yet supported!)");
+         switch (osversion.dwMinorVersion)
+           {
+           case 0:
+             strcpy (osname, osversion.wProductType == VER_NT_WORKSTATION
+                             ? "Vista" : "2008");
+             break;
+           case 1:
+             strcpy (osname, osversion.wProductType == VER_NT_WORKSTATION
+                             ? "7" : "2008 R2");
+             break;
+           default:
+             strcpy (osname, osversion.wProductType == VER_NT_WORKSTATION
+                             ? "8" : "2012");
+             break;
+           }
          DWORD prod;
          if (GetProductInfo (osversion.dwMajorVersion,
                              osversion.dwMinorVersion,
This page took 0.039141 seconds and 5 git commands to generate.