Commit 29541ada authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

msvcrt: Add casts to avoid 'long' types warning in locale functions.

parent 800971f9
......@@ -429,13 +429,13 @@ static void copy_threadlocinfo_category(pthreadlocinfo locinfo,
if(!locinfo->lc_category[category].locale) {
locinfo->lc_category[category].locale = old_locinfo->lc_category[category].locale;
locinfo->lc_category[category].refcount = old_locinfo->lc_category[category].refcount;
InterlockedIncrement(locinfo->lc_category[category].refcount);
InterlockedIncrement((LONG *)locinfo->lc_category[category].refcount);
}
#if _MSVCR_VER >= 110
locinfo->lc_name[category] = old_locinfo->lc_name[category];
locinfo->lc_category[category].wrefcount = old_locinfo->lc_category[category].wrefcount;
if(locinfo->lc_category[category].wrefcount)
InterlockedIncrement(locinfo->lc_category[category].wrefcount);
InterlockedIncrement((LONG *)locinfo->lc_category[category].wrefcount);
#endif
}
......@@ -560,21 +560,21 @@ static void grab_locinfo(pthreadlocinfo locinfo)
{
int i;
InterlockedIncrement(&locinfo->refcount);
InterlockedIncrement((LONG *)&locinfo->refcount);
for(i=LC_MIN+1; i<=LC_MAX; i++)
{
InterlockedIncrement(locinfo->lc_category[i].refcount);
InterlockedIncrement((LONG *)locinfo->lc_category[i].refcount);
if(locinfo->lc_category[i].wrefcount)
InterlockedIncrement(locinfo->lc_category[i].wrefcount);
InterlockedIncrement((LONG *)locinfo->lc_category[i].wrefcount);
}
if(locinfo->lconv_intl_refcount)
InterlockedIncrement(locinfo->lconv_intl_refcount);
InterlockedIncrement((LONG *)locinfo->lconv_intl_refcount);
if(locinfo->lconv_num_refcount)
InterlockedIncrement(locinfo->lconv_num_refcount);
InterlockedIncrement((LONG *)locinfo->lconv_num_refcount);
if(locinfo->lconv_mon_refcount)
InterlockedIncrement(locinfo->lconv_mon_refcount);
InterlockedIncrement((LONG *)locinfo->lconv_mon_refcount);
if(locinfo->ctype1_refcount)
InterlockedIncrement(locinfo->ctype1_refcount);
InterlockedIncrement((LONG *)locinfo->ctype1_refcount);
InterlockedIncrement(&locinfo->lc_time_curr->refcount);
}
......@@ -1039,12 +1039,12 @@ void free_locinfo(pthreadlocinfo locinfo)
for(i=LC_MIN+1; i<=LC_MAX; i++) {
if(!locinfo->lc_category[i].refcount
|| !InterlockedDecrement(locinfo->lc_category[i].refcount)) {
|| !InterlockedDecrement((LONG *)locinfo->lc_category[i].refcount)) {
free(locinfo->lc_category[i].locale);
free(locinfo->lc_category[i].refcount);
}
if(!locinfo->lc_category[i].wrefcount
|| !InterlockedDecrement(locinfo->lc_category[i].wrefcount)) {
|| !InterlockedDecrement((LONG *)locinfo->lc_category[i].wrefcount)) {
#if _MSVCR_VER >= 110
free(locinfo->lc_name[i]);
#endif
......@@ -1053,7 +1053,7 @@ void free_locinfo(pthreadlocinfo locinfo)
}
if(locinfo->lconv_num_refcount
&& !InterlockedDecrement(locinfo->lconv_num_refcount)) {
&& !InterlockedDecrement((LONG *)locinfo->lconv_num_refcount)) {
free(locinfo->lconv->decimal_point);
free(locinfo->lconv->thousands_sep);
free(locinfo->lconv->grouping);
......@@ -1064,7 +1064,7 @@ void free_locinfo(pthreadlocinfo locinfo)
free(locinfo->lconv_num_refcount);
}
if(locinfo->lconv_mon_refcount
&& !InterlockedDecrement(locinfo->lconv_mon_refcount)) {
&& !InterlockedDecrement((LONG *)locinfo->lconv_mon_refcount)) {
free(locinfo->lconv->int_curr_symbol);
free(locinfo->lconv->currency_symbol);
free(locinfo->lconv->mon_decimal_point);
......@@ -1083,13 +1083,13 @@ void free_locinfo(pthreadlocinfo locinfo)
free(locinfo->lconv_mon_refcount);
}
if(locinfo->lconv_intl_refcount
&& !InterlockedDecrement(locinfo->lconv_intl_refcount)) {
&& !InterlockedDecrement((LONG *)locinfo->lconv_intl_refcount)) {
free(locinfo->lconv_intl_refcount);
free(locinfo->lconv);
}
if(locinfo->ctype1_refcount
&& !InterlockedDecrement(locinfo->ctype1_refcount)) {
&& !InterlockedDecrement((LONG *)locinfo->ctype1_refcount)) {
free(locinfo->ctype1_refcount);
free(locinfo->ctype1);
free((void*)locinfo->pclmap);
......@@ -1100,7 +1100,7 @@ void free_locinfo(pthreadlocinfo locinfo)
&& locinfo->lc_time_curr != &cloc_time_data)
free(locinfo->lc_time_curr);
if(InterlockedDecrement(&locinfo->refcount))
if(InterlockedDecrement((LONG *)&locinfo->refcount))
return;
free(locinfo);
......@@ -1398,7 +1398,7 @@ static pthreadlocinfo create_locinfo(int category,
locinfo->pclmap = old_locinfo->pclmap;
locinfo->pcumap = old_locinfo->pcumap;
if(locinfo->ctype1_refcount)
InterlockedIncrement(locinfo->ctype1_refcount);
InterlockedIncrement((LONG *)locinfo->ctype1_refcount);
} else if(lcid[LC_CTYPE]) {
CPINFO cp_info;
int j;
......@@ -1480,7 +1480,7 @@ static pthreadlocinfo create_locinfo(int category,
locinfo->lconv = old_locinfo->lconv;
locinfo->lconv_intl_refcount = old_locinfo->lconv_intl_refcount;
if(locinfo->lconv_intl_refcount)
InterlockedIncrement(locinfo->lconv_intl_refcount);
InterlockedIncrement((LONG *)locinfo->lconv_intl_refcount);
} else if(lcid[LC_MONETARY] || lcid[LC_NUMERIC]) {
locinfo->lconv = malloc(sizeof(struct lconv));
locinfo->lconv_intl_refcount = malloc(sizeof(int));
......@@ -1510,7 +1510,7 @@ static pthreadlocinfo create_locinfo(int category,
copy_threadlocinfo_category(locinfo, old_locinfo, LC_MONETARY);
locinfo->lconv_mon_refcount = old_locinfo->lconv_mon_refcount;
if(locinfo->lconv_mon_refcount)
InterlockedIncrement(locinfo->lconv_mon_refcount);
InterlockedIncrement((LONG *)locinfo->lconv_mon_refcount);
if(locinfo->lconv != &cloc_lconv && locinfo->lconv != old_locinfo->lconv) {
locinfo->lconv->int_curr_symbol = old_locinfo->lconv->int_curr_symbol;
locinfo->lconv->currency_symbol = old_locinfo->lconv->currency_symbol;
......@@ -1785,7 +1785,7 @@ static pthreadlocinfo create_locinfo(int category,
copy_threadlocinfo_category(locinfo, old_locinfo, LC_NUMERIC);
locinfo->lconv_num_refcount = old_locinfo->lconv_num_refcount;
if(locinfo->lconv_num_refcount)
InterlockedIncrement(locinfo->lconv_num_refcount);
InterlockedIncrement((LONG *)locinfo->lconv_num_refcount);
if(locinfo->lconv != &cloc_lconv && locinfo->lconv != old_locinfo->lconv) {
locinfo->lconv->decimal_point = old_locinfo->lconv->decimal_point;
locinfo->lconv->thousands_sep = old_locinfo->lconv->thousands_sep;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment