Francois Gouget : wininet: Avoid a conflict with the sun macro when compiling on Solaris.

Alexandre Julliard julliard at winehq.org
Mon Mar 14 14:29:32 CDT 2011


Module: wine
Branch: master
Commit: 4bacb3f24e3919d93330e82e25a1ba88a2aabd59
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=4bacb3f24e3919d93330e82e25a1ba88a2aabd59

Author: Francois Gouget <fgouget at codeweavers.com>
Date:   Fri Mar 11 18:22:23 2011 +0100

wininet: Avoid a conflict with the sun macro when compiling on Solaris.

---

 dlls/wininet/http.c |   27 ++++++++++++---------------
 1 files changed, 12 insertions(+), 15 deletions(-)

diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c
index a0574bf..5ae3e4d 100644
--- a/dlls/wininet/http.c
+++ b/dlls/wininet/http.c
@@ -3582,21 +3582,18 @@ static void HTTP_InsertCookies(http_request_t *request)
 
 static WORD HTTP_ParseDay(LPCWSTR day)
 {
-    static const WCHAR sun[] = { 's','u','n',0 };
-    static const WCHAR mon[] = { 'm','o','n',0 };
-    static const WCHAR tue[] = { 't','u','e',0 };
-    static const WCHAR wed[] = { 'w','e','d',0 };
-    static const WCHAR thu[] = { 't','h','u',0 };
-    static const WCHAR fri[] = { 'f','r','i',0 };
-    static const WCHAR sat[] = { 's','a','t',0 };
-
-    if (!strcmpiW(day, sun)) return 0;
-    if (!strcmpiW(day, mon)) return 1;
-    if (!strcmpiW(day, tue)) return 2;
-    if (!strcmpiW(day, wed)) return 3;
-    if (!strcmpiW(day, thu)) return 4;
-    if (!strcmpiW(day, fri)) return 5;
-    if (!strcmpiW(day, sat)) return 6;
+    static const WCHAR days[7][4] = {{ 's','u','n',0 },
+                                     { 'm','o','n',0 },
+                                     { 't','u','e',0 },
+                                     { 'w','e','d',0 },
+                                     { 't','h','u',0 },
+                                     { 'f','r','i',0 },
+                                     { 's','a','t',0 }};
+    int i;
+    for (i = 0; i < sizeof(days)/sizeof(*days); i++)
+        if (!strcmpiW(day, days[i]))
+            return i;
+
     /* Invalid */
     return 7;
 }




More information about the wine-cvs mailing list