diff options
author | Noah Misch <noah@leadboat.com> | 2014-11-02 21:43:20 -0500 |
---|---|---|
committer | Noah Misch <noah@leadboat.com> | 2014-11-02 21:44:28 -0500 |
commit | 9decab8b7834b99ca6375fdf533ad5f22f91a204 (patch) | |
tree | d6426d06b0554af068cff6b457c15cf124b4093b | |
parent | 42a78568dc34584a1b7aad6209f6e2f1d28f0054 (diff) | |
download | postgresql-9decab8b7834b99ca6375fdf533ad5f22f91a204.tar.gz postgresql-9decab8b7834b99ca6375fdf533ad5f22f91a204.zip |
Fix win32setlocale.c const-related warnings.
Back-patch to 9.2, like commit db29620d4d16e08241f965ccd70d0f65883ff0de.
-rw-r--r-- | src/port/win32setlocale.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/port/win32setlocale.c b/src/port/win32setlocale.c index ee48e4613ad..11c02a1e039 100644 --- a/src/port/win32setlocale.c +++ b/src/port/win32setlocale.c @@ -103,8 +103,8 @@ static const struct locale_map locale_map_result[] = { #define MAX_LOCALE_NAME_LEN 100 -static char * -map_locale(struct locale_map *map, char *locale) +static const char * +map_locale(const struct locale_map *map, const char *locale) { static char aliasbuf[MAX_LOCALE_NAME_LEN]; int i; @@ -167,7 +167,7 @@ map_locale(struct locale_map *map, char *locale) char * pgwin32_setlocale(int category, const char *locale) { - char *argument; + const char *argument; char *result; if (locale == NULL) @@ -178,8 +178,12 @@ pgwin32_setlocale(int category, const char *locale) /* Call the real setlocale() function */ result = setlocale(category, argument); + /* + * setlocale() is specified to return a "char *" that the caller is + * forbidden to modify, so casting away the "const" is innocuous. + */ if (result) - result = map_locale(locale_map_result, result); + result = (char *) map_locale(locale_map_result, result); return result; } |