msvcp100: Sign-compare warnings fix
Andrew Talbot
andrew.talbot at talbotville.com
Thu Mar 14 16:04:36 CDT 2013
Changelog:
Sign-compare warnings fix.
diff --git a/dlls/msvcp100/locale.c b/dlls/msvcp100/locale.c
index db6d865..d327e68 100644
--- a/dlls/msvcp100/locale.c
+++ b/dlls/msvcp100/locale.c
@@ -2398,7 +2398,7 @@ int __thiscall codecvt_char_do_length(const codecvt_char *this, const int *state
const char *from, const char *from_end, MSVCP_size_t max)
{
TRACE("(%p %p %p %p %lu)\n", this, state, from, from_end, max);
- return (from_end-from > max ? max : from_end-from);
+ return ((MSVCP_size_t)(from_end-from) > max ? (int)max : from_end-from);
}
/* ?length@?$codecvt at DDH@std@@QBEHABHPBD1I at Z */
@@ -2816,7 +2816,7 @@ int __thiscall codecvt_wchar_do_length(const codecvt_wchar *this, const int *sta
TRACE("(%p %p %p %p %ld)\n", this, state, from, from_end, max);
- while(ret<max && from!=from_end) {
+ while((MSVCP_size_t)ret<max && from!=from_end) {
switch(_Mbrtowc(NULL, from, from_end-from, &tmp_state, &this->cvt)) {
case -2:
case -1:
@@ -7287,7 +7287,7 @@ void __cdecl locale__Locimp__Locimp_Addfac(locale__Locimp *locimp, locale_facet
MSVCP_size_t new_size = id+1;
locale_facet **new_facetvec;
- if(new_size < locale_id__Id_cnt+1)
+ if(new_size < (MSVCP_size_t)(locale_id__Id_cnt+1))
new_size = locale_id__Id_cnt+1;
new_facetvec = MSVCRT_operator_new(sizeof(locale_facet*)*new_size);
diff --git a/dlls/msvcp100/misc.c b/dlls/msvcp100/misc.c
index 55a19ee..c4c58c5 100644
--- a/dlls/msvcp100/misc.c
+++ b/dlls/msvcp100/misc.c
@@ -211,7 +211,7 @@ unsigned short __cdecl wctype(const char *property)
{ "upper", _UPPER },
{ "xdigit", _HEX }
};
- int i;
+ unsigned int i;
for(i=0; i<sizeof(properties)/sizeof(properties[0]); i++)
if(!strcmp(property, properties[i].name))
More information about the wine-patches
mailing list