From 15bef00d65f3c640a607f7520b9a93fed3c523af Mon Sep 17 00:00:00 2001 From: Piotr Caban Date: Fri, 16 Nov 2012 10:54:27 +0100 Subject: [PATCH] msvcp: Sync implementations. --- dlls/msvcp100/locale.c | 22 ++++++++++++++++++++++ dlls/msvcp100/msvcp100.spec | 4 ++-- dlls/msvcp60/locale.c | 22 ++++++++++++++++++++++ dlls/msvcp60/msvcp60.spec | 4 ++-- dlls/msvcp70/msvcp70.spec | 4 ++-- dlls/msvcp71/locale.c | 22 ++++++++++++++++++++++ dlls/msvcp71/msvcp71.spec | 4 ++-- dlls/msvcp71/string.c | 4 ++-- dlls/msvcp80/msvcp80.spec | 4 ++-- dlls/msvcp90/string.c | 4 ++-- 10 files changed, 80 insertions(+), 14 deletions(-) diff --git a/dlls/msvcp100/locale.c b/dlls/msvcp100/locale.c index 65749d16eb0..198cc337c90 100644 --- a/dlls/msvcp100/locale.c +++ b/dlls/msvcp100/locale.c @@ -26,6 +26,7 @@ #include "limits.h" #include "math.h" #include "stdio.h" +#include "wctype.h" #include "wine/list.h" @@ -7778,6 +7779,27 @@ locale* __cdecl locale_global(locale *ret, const locale *loc) return ret; } +/* wctrans */ +wctrans_t __cdecl wctrans(const char *property) +{ + static const char str_tolower[] = "tolower"; + static const char str_toupper[] = "toupper"; + + if(!strcmp(property, str_tolower)) + return 2; + if(!strcmp(property, str_toupper)) + return 1; + return 0; +} + +/* towctrans */ +wint_t __cdecl towctrans(wint_t c, wctrans_t category) +{ + if(category == 1) + return towupper(c); + return towlower(c); +} + DEFINE_RTTI_DATA0(locale_facet, 0, ".?AVfacet@locale@std@@"); DEFINE_RTTI_DATA1(collate_char, 0, &locale_facet_rtti_base_descriptor, ".?AV?$collate@D@std@@"); DEFINE_RTTI_DATA1(collate_wchar, 0, &locale_facet_rtti_base_descriptor, ".?AV?$collate@_W@std@@"); diff --git a/dlls/msvcp100/msvcp100.spec b/dlls/msvcp100/msvcp100.spec index d6cb46cf939..85e6107e3d1 100644 --- a/dlls/msvcp100/msvcp100.spec +++ b/dlls/msvcp100/msvcp100.spec @@ -2865,6 +2865,6 @@ @ stub _Wcsxfrm # extern _Xbig @ stub __Wcrtomb_lk -@ stub towctrans -@ stub wctrans +@ cdecl towctrans(long long) +@ cdecl wctrans(str) @ cdecl wctype(str) diff --git a/dlls/msvcp60/locale.c b/dlls/msvcp60/locale.c index a2a50df162b..1ad21ae9269 100644 --- a/dlls/msvcp60/locale.c +++ b/dlls/msvcp60/locale.c @@ -26,6 +26,7 @@ #include "limits.h" #include "math.h" #include "stdio.h" +#include "wctype.h" #include "wine/list.h" @@ -7652,6 +7653,27 @@ locale* __cdecl locale_global(locale *ret, const locale *loc) return ret; } +/* wctrans */ +wctrans_t __cdecl wctrans(const char *property) +{ + static const char str_tolower[] = "tolower"; + static const char str_toupper[] = "toupper"; + + if(!strcmp(property, str_tolower)) + return 2; + if(!strcmp(property, str_toupper)) + return 1; + return 0; +} + +/* towctrans */ +wint_t __cdecl towctrans(wint_t c, wctrans_t category) +{ + if(category == 1) + return towupper(c); + return towlower(c); +} + DEFINE_RTTI_DATA0(locale_facet, 0, ".?AVfacet@locale@std@@"); DEFINE_RTTI_DATA1(collate_char, 0, &locale_facet_rtti_base_descriptor, ".?AV?$collate@D@std@@"); DEFINE_RTTI_DATA1(collate_wchar, 0, &locale_facet_rtti_base_descriptor, ".?AV?$collate@_W@std@@"); diff --git a/dlls/msvcp60/msvcp60.spec b/dlls/msvcp60/msvcp60.spec index 9a6401318fd..8dcf3742138 100644 --- a/dlls/msvcp60/msvcp60.spec +++ b/dlls/msvcp60/msvcp60.spec @@ -4312,9 +4312,9 @@ @ stub mbrlen # msvcrt.mbrlen @ stub mbrtowc # msvcrt.mbrtowc @ stub mbsrtowcs # msvcrt.mbsrtowcs -@ stub towctrans +@ cdecl towctrans(long long) @ stub wcrtomb # msvcrt.wcrtomb @ cdecl wcsrtombs(ptr ptr long ptr) msvcrt.wcsrtombs @ cdecl wctob(long) msvcrt.wctob -@ stub wctrans +@ cdecl wctrans(str) @ cdecl wctype(str) diff --git a/dlls/msvcp70/msvcp70.spec b/dlls/msvcp70/msvcp70.spec index 3d836b248a8..aa6aa17b5a3 100644 --- a/dlls/msvcp70/msvcp70.spec +++ b/dlls/msvcp70/msvcp70.spec @@ -5101,9 +5101,9 @@ @ stub mbrlen @ stub mbrtowc @ stub mbsrtowcs -@ stub towctrans +@ cdecl towctrans(long long) msvcp90.towctrans @ stub wcrtomb @ cdecl wcsrtombs(ptr ptr long ptr) msvcrt.wcsrtombs @ cdecl wctob(long) msvcrt.wctob -@ stub wctrans +@ cdecl wctrans(str) msvcp90.wctrans @ cdecl wctype(str) msvcp90.wctype diff --git a/dlls/msvcp71/locale.c b/dlls/msvcp71/locale.c index de5f7faa222..381c21ed2b3 100644 --- a/dlls/msvcp71/locale.c +++ b/dlls/msvcp71/locale.c @@ -26,6 +26,7 @@ #include "limits.h" #include "math.h" #include "stdio.h" +#include "wctype.h" #include "wine/list.h" @@ -8275,6 +8276,27 @@ locale* __cdecl locale_global(locale *ret, const locale *loc) return ret; } +/* wctrans */ +wctrans_t __cdecl wctrans(const char *property) +{ + static const char str_tolower[] = "tolower"; + static const char str_toupper[] = "toupper"; + + if(!strcmp(property, str_tolower)) + return 2; + if(!strcmp(property, str_toupper)) + return 1; + return 0; +} + +/* towctrans */ +wint_t __cdecl towctrans(wint_t c, wctrans_t category) +{ + if(category == 1) + return towupper(c); + return towlower(c); +} + DEFINE_RTTI_DATA0(locale_facet, 0, ".?AVfacet@locale@std@@"); DEFINE_RTTI_DATA1(collate_char, 0, &locale_facet_rtti_base_descriptor, ".?AV?$collate@D@std@@"); DEFINE_RTTI_DATA1(collate_wchar, 0, &locale_facet_rtti_base_descriptor, ".?AV?$collate@_W@std@@"); diff --git a/dlls/msvcp71/msvcp71.spec b/dlls/msvcp71/msvcp71.spec index c351c441643..7ac0eb3c96d 100644 --- a/dlls/msvcp71/msvcp71.spec +++ b/dlls/msvcp71/msvcp71.spec @@ -5161,9 +5161,9 @@ @ stub mbrlen @ stub mbrtowc @ stub mbsrtowcs -@ stub towctrans +@ cdecl towctrans(long long) @ stub wcrtomb @ cdecl wcsrtombs(ptr ptr long ptr) msvcrt.wcsrtombs @ cdecl wctob(long) msvcrt.wctob -@ stub wctrans +@ cdecl wctrans(str) @ cdecl wctype(str) diff --git a/dlls/msvcp71/string.c b/dlls/msvcp71/string.c index fd3bffa7c72..415e514d28c 100644 --- a/dlls/msvcp71/string.c +++ b/dlls/msvcp71/string.c @@ -565,7 +565,7 @@ MSVCP_bool __thiscall basic_string_char_inside( { char *cstr = basic_string_char_ptr(this); - return (ptr=cstr+this->size) ? FALSE : TRUE; + return ptr>=cstr && ptrsize; } /* ?_Tidy@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@IAEX_NI@Z */ @@ -2256,7 +2256,7 @@ MSVCP_bool __thiscall basic_string_wchar_inside( { wchar_t *cstr = basic_string_wchar_ptr(this); - return (ptr=cstr+this->size) ? FALSE : TRUE; + return ptr>=cstr && ptrsize; } /* ?_Tidy@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@IAEX_NI@Z */ diff --git a/dlls/msvcp80/msvcp80.spec b/dlls/msvcp80/msvcp80.spec index 7946f0c2f68..902b636b798 100644 --- a/dlls/msvcp80/msvcp80.spec +++ b/dlls/msvcp80/msvcp80.spec @@ -5785,6 +5785,6 @@ @ stub __Stofx @ stub __Stoldx @ stub __Wcrtomb_lk -@ stub towctrans -@ stub wctrans +@ cdecl towctrans(long long) msvcp90.towctrans +@ cdecl wctrans(str) msvcp90.wctrans @ cdecl wctype(str) msvcp90.wctype diff --git a/dlls/msvcp90/string.c b/dlls/msvcp90/string.c index 838d1b01f93..a0359a18fc8 100644 --- a/dlls/msvcp90/string.c +++ b/dlls/msvcp90/string.c @@ -563,7 +563,7 @@ MSVCP_bool __thiscall basic_string_char_inside( { char *cstr = basic_string_char_ptr(this); - return (ptr=cstr+this->size) ? FALSE : TRUE; + return ptr>=cstr && ptrsize; } /* ?_Tidy@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@IAEX_NI@Z */ @@ -2377,7 +2377,7 @@ MSVCP_bool __thiscall basic_string_wchar_inside( { wchar_t *cstr = basic_string_wchar_ptr(this); - return (ptr=cstr+this->size) ? FALSE : TRUE; + return ptr>=cstr && ptrsize; } /* ?_Tidy@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@IAEX_NI@Z */