Piotr Caban : msvcrt: Mark __lc_time_data strings const.

Alexandre Julliard julliard at winehq.org
Wed Dec 4 16:13:05 CST 2019


Module: wine
Branch: master
Commit: c4b41fd4f191f7db0ec1865fec73c6a2839b83e0
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=c4b41fd4f191f7db0ec1865fec73c6a2839b83e0

Author: Piotr Caban <piotr at codeweavers.com>
Date:   Wed Dec  4 15:30:45 2019 +0100

msvcrt: Mark __lc_time_data strings const.

Signed-off-by: Piotr Caban <piotr at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/msvcrt/locale.c |  2 +-
 dlls/msvcrt/msvcrt.h | 42 +++++++++++++++++++++---------------------
 2 files changed, 22 insertions(+), 22 deletions(-)

diff --git a/dlls/msvcrt/locale.c b/dlls/msvcrt/locale.c
index fdb4436a3d..3a789c7229 100644
--- a/dlls/msvcrt/locale.c
+++ b/dlls/msvcrt/locale.c
@@ -1016,7 +1016,7 @@ static MSVCRT___lc_time_data* create_time_data(LCID lcid)
     }
 #if _MSVCR_VER >= 110
     cur->locname = (MSVCRT_wchar_t*)&cur->data[ret];
-    LCIDToLocaleName(lcid, cur->locname, (size-ret)/sizeof(MSVCRT_wchar_t), 0);
+    LCIDToLocaleName(lcid, (MSVCRT_wchar_t*)&cur->data[ret], (size-ret)/sizeof(MSVCRT_wchar_t), 0);
 #else
     cur->lcid = lcid;
 #endif
diff --git a/dlls/msvcrt/msvcrt.h b/dlls/msvcrt/msvcrt.h
index 4a7e6f4219..15d3ef69ef 100644
--- a/dlls/msvcrt/msvcrt.h
+++ b/dlls/msvcrt/msvcrt.h
@@ -125,17 +125,17 @@ typedef struct MSVCRT_tagLC_ID {
 
 typedef struct {
     union {
-        char *str[43];
+        const char *str[43];
         struct {
-            char *short_wday[7];
-            char *wday[7];
-            char *short_mon[12];
-            char *mon[12];
-            char *am;
-            char *pm;
-            char *short_date;
-            char *date;
-            char *time;
+            const char *short_wday[7];
+            const char *wday[7];
+            const char *short_mon[12];
+            const char *mon[12];
+            const char *am;
+            const char *pm;
+            const char *short_date;
+            const char *date;
+            const char *time;
         } names;
     } str;
 #if _MSVCR_VER < 110
@@ -143,21 +143,21 @@ typedef struct {
 #endif
     int  unk[2];
     union {
-        MSVCRT_wchar_t *wstr[43];
+        const MSVCRT_wchar_t *wstr[43];
         struct {
-            MSVCRT_wchar_t *short_wday[7];
-            MSVCRT_wchar_t *wday[7];
-            MSVCRT_wchar_t *short_mon[12];
-            MSVCRT_wchar_t *mon[12];
-            MSVCRT_wchar_t *am;
-            MSVCRT_wchar_t *pm;
-            MSVCRT_wchar_t *short_date;
-            MSVCRT_wchar_t *date;
-            MSVCRT_wchar_t *time;
+            const MSVCRT_wchar_t *short_wday[7];
+            const MSVCRT_wchar_t *wday[7];
+            const MSVCRT_wchar_t *short_mon[12];
+            const MSVCRT_wchar_t *mon[12];
+            const MSVCRT_wchar_t *am;
+            const MSVCRT_wchar_t *pm;
+            const MSVCRT_wchar_t *short_date;
+            const MSVCRT_wchar_t *date;
+            const MSVCRT_wchar_t *time;
         } names;
     } wstr;
 #if _MSVCR_VER >= 110
-    MSVCRT_wchar_t *locname;
+    const MSVCRT_wchar_t *locname;
 #endif
     char data[1];
 } MSVCRT___lc_time_data;




More information about the wine-cvs mailing list