Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8463195

Browse files
committed
Fix win32setlocale.c const-related warnings.
Back-patch to 9.2, like commitdb29620.
1 parent9522efd commit8463195

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

‎src/port/win32setlocale.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,8 @@ static const struct locale_map locale_map_result[] = {
103103

104104
#defineMAX_LOCALE_NAME_LEN100
105105

106-
staticchar*
107-
map_locale(structlocale_map*map,char*locale)
106+
staticconstchar*
107+
map_locale(conststructlocale_map*map,constchar*locale)
108108
{
109109
staticcharaliasbuf[MAX_LOCALE_NAME_LEN];
110110
inti;
@@ -167,7 +167,7 @@ map_locale(struct locale_map *map, char *locale)
167167
char*
168168
pgwin32_setlocale(intcategory,constchar*locale)
169169
{
170-
char*argument;
170+
constchar*argument;
171171
char*result;
172172

173173
if (locale==NULL)
@@ -178,8 +178,12 @@ pgwin32_setlocale(int category, const char *locale)
178178
/* Call the real setlocale() function */
179179
result=setlocale(category,argument);
180180

181+
/*
182+
* setlocale() is specified to return a "char *" that the caller is
183+
* forbidden to modify, so casting away the "const" is innocuous.
184+
*/
181185
if (result)
182-
result=map_locale(locale_map_result,result);
186+
result=(char*)map_locale(locale_map_result,result);
183187

184188
returnresult;
185189
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp