Piotr Caban : msvcrt: Remove MSVCRT_lconv type.

Alexandre Julliard julliard at winehq.org
Thu Nov 26 16:31:01 CST 2020


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

Author: Piotr Caban <piotr at codeweavers.com>
Date:   Thu Nov 26 19:19:05 2020 +0100

msvcrt: Remove MSVCRT_lconv type.

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

---

 dlls/msvcrt/locale.c    |  8 ++++----
 dlls/msvcrt/math.c      |  1 +
 dlls/msvcrt/msvcrt.h    | 33 +--------------------------------
 dlls/msvcrt/string.c    |  1 +
 dlls/msvcrt/wcs.c       |  1 +
 include/msvcrt/locale.h | 10 ++++++++++
 6 files changed, 18 insertions(+), 36 deletions(-)

diff --git a/dlls/msvcrt/locale.c b/dlls/msvcrt/locale.c
index 52fbd9cf9c7..cca1cb9391b 100644
--- a/dlls/msvcrt/locale.c
+++ b/dlls/msvcrt/locale.c
@@ -199,7 +199,7 @@ static char cloc_dec_point[] = ".";
 static MSVCRT_wchar_t emptyW[] = {0};
 static MSVCRT_wchar_t cloc_dec_pointW[] = {'.', 0};
 #endif
-static struct MSVCRT_lconv cloc_lconv =
+static struct lconv cloc_lconv =
 {
     cloc_dec_point, empty, empty, empty, empty, empty, empty, empty, empty, empty,
     CHAR_MAX, CHAR_MAX, CHAR_MAX, CHAR_MAX, CHAR_MAX, CHAR_MAX, CHAR_MAX, CHAR_MAX,
@@ -1006,7 +1006,7 @@ BOOL CDECL __crtGetStringTypeW(DWORD unk, DWORD type,
 /*********************************************************************
  *		localeconv (MSVCRT.@)
  */
-struct MSVCRT_lconv * CDECL MSVCRT_localeconv(void)
+struct lconv* CDECL MSVCRT_localeconv(void)
 {
     return get_locinfo()->lconv;
 }
@@ -1511,7 +1511,7 @@ static MSVCRT_pthreadlocinfo create_locinfo(int category,
         if(locinfo->lconv_intl_refcount)
             InterlockedIncrement(locinfo->lconv_intl_refcount);
     } else if(lcid[MSVCRT_LC_MONETARY] || lcid[MSVCRT_LC_NUMERIC]) {
-        locinfo->lconv = MSVCRT_malloc(sizeof(struct MSVCRT_lconv));
+        locinfo->lconv = MSVCRT_malloc(sizeof(struct lconv));
         locinfo->lconv_intl_refcount = MSVCRT_malloc(sizeof(int));
         if(!locinfo->lconv || !locinfo->lconv_intl_refcount) {
             MSVCRT_free(locinfo->lconv);
@@ -1521,7 +1521,7 @@ static MSVCRT_pthreadlocinfo create_locinfo(int category,
             free_locinfo(locinfo);
             return NULL;
         }
-        memset(locinfo->lconv, 0, sizeof(struct MSVCRT_lconv));
+        memset(locinfo->lconv, 0, sizeof(struct lconv));
         *locinfo->lconv_intl_refcount = 1;
     } else {
         locinfo->lconv = &cloc_lconv;
diff --git a/dlls/msvcrt/math.c b/dlls/msvcrt/math.c
index dd00cc212c6..ff5654495fc 100644
--- a/dlls/msvcrt/math.c
+++ b/dlls/msvcrt/math.c
@@ -39,6 +39,7 @@
 #include <stdio.h>
 #include <fenv.h>
 #include <fpieee.h>
+#include <locale.h>
 #include <math.h>
 
 #include "msvcrt.h"
diff --git a/dlls/msvcrt/msvcrt.h b/dlls/msvcrt/msvcrt.h
index 52aafcff869..f19c37ee2eb 100644
--- a/dlls/msvcrt/msvcrt.h
+++ b/dlls/msvcrt/msvcrt.h
@@ -148,7 +148,7 @@ typedef struct MSVCRT_threadlocaleinfostruct {
     int *lconv_intl_refcount;
     int *lconv_num_refcount;
     int *lconv_mon_refcount;
-    struct MSVCRT_lconv *lconv;
+    struct lconv *lconv;
     int *ctype1_refcount;
     unsigned short *ctype1;
 #if _MSVCR_VER < 140
@@ -382,37 +382,6 @@ typedef struct _iobuf MSVCRT_FILE;
 
 extern MSVCRT_FILE MSVCRT__iob[];
 
-struct MSVCRT_lconv {
-    char* decimal_point;
-    char* thousands_sep;
-    char* grouping;
-    char* int_curr_symbol;
-    char* currency_symbol;
-    char* mon_decimal_point;
-    char* mon_thousands_sep;
-    char* mon_grouping;
-    char* positive_sign;
-    char* negative_sign;
-    char int_frac_digits;
-    char frac_digits;
-    char p_cs_precedes;
-    char p_sep_by_space;
-    char n_cs_precedes;
-    char n_sep_by_space;
-    char p_sign_posn;
-    char n_sign_posn;
-#if _MSVCR_VER >= 100
-    MSVCRT_wchar_t* _W_decimal_point;
-    MSVCRT_wchar_t* _W_thousands_sep;
-    MSVCRT_wchar_t* _W_int_curr_symbol;
-    MSVCRT_wchar_t* _W_currency_symbol;
-    MSVCRT_wchar_t* _W_mon_decimal_point;
-    MSVCRT_wchar_t* _W_mon_thousands_sep;
-    MSVCRT_wchar_t* _W_positive_sign;
-    MSVCRT_wchar_t* _W_negative_sign;
-#endif
-};
-
 struct MSVCRT__exception {
   int     type;
   char*   name;
diff --git a/dlls/msvcrt/string.c b/dlls/msvcrt/string.c
index a2e45089d8a..3c394f0a3ca 100644
--- a/dlls/msvcrt/string.c
+++ b/dlls/msvcrt/string.c
@@ -26,6 +26,7 @@
 #include <stdio.h>
 #include <math.h>
 #include <limits.h>
+#include <locale.h>
 #include <errno.h>
 #include "msvcrt.h"
 #include "bnum.h"
diff --git a/dlls/msvcrt/wcs.c b/dlls/msvcrt/wcs.c
index c46c09bedfa..0f4e72ac0f5 100644
--- a/dlls/msvcrt/wcs.c
+++ b/dlls/msvcrt/wcs.c
@@ -20,6 +20,7 @@
  */
 
 #include <limits.h>
+#include <locale.h>
 #include <stdio.h>
 #include <math.h>
 #include <assert.h>
diff --git a/include/msvcrt/locale.h b/include/msvcrt/locale.h
index a5af1720b97..ee0d99b8e7e 100644
--- a/include/msvcrt/locale.h
+++ b/include/msvcrt/locale.h
@@ -53,6 +53,16 @@ struct lconv
     char n_sep_by_space;
     char p_sign_posn;
     char n_sign_posn;
+#if _MSVCR_VER >= 100
+    wchar_t* _W_decimal_point;
+    wchar_t* _W_thousands_sep;
+    wchar_t* _W_int_curr_symbol;
+    wchar_t* _W_currency_symbol;
+    wchar_t* _W_mon_decimal_point;
+    wchar_t* _W_mon_thousands_sep;
+    wchar_t* _W_positive_sign;
+    wchar_t* _W_negative_sign;
+#endif
 };
 #endif /* _LCONV_DEFINED */
 




More information about the wine-cvs mailing list