Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 0a8590b

Browse files
committed
1 parent f2898de commit 0a8590b

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

src/backend/utils/adt/json.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -207,12 +207,12 @@ IsValidJsonNumber(const char *str, int len)
207207
*/
208208
if (*str == '-')
209209
{
210-
dummy_lex.input = (char *) str + 1;
210+
dummy_lex.input = unconstify(char *, str) + 1;
211211
dummy_lex.input_length = len - 1;
212212
}
213213
else
214214
{
215-
dummy_lex.input = (char *) str;
215+
dummy_lex.input = unconstify(char *, str);
216216
dummy_lex.input_length = len;
217217
}
218218

src/backend/utils/adt/misc.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ pg_get_keywords(PG_FUNCTION_ARGS)
423423
HeapTuple tuple;
424424

425425
/* cast-away-const is ugly but alternatives aren't much better */
426-
values[0] = (char *) ScanKeywords[funcctx->call_cntr].name;
426+
values[0] = unconstify(char *, ScanKeywords[funcctx->call_cntr].name);
427427

428428
switch (ScanKeywords[funcctx->call_cntr].category)
429429
{

src/backend/utils/adt/varlena.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ char *
182182
text_to_cstring(const text *t)
183183
{
184184
/* must cast away the const, unfortunately */
185-
text *tunpacked = pg_detoast_datum_packed((struct varlena *) t);
185+
text *tunpacked = pg_detoast_datum_packed(unconstify(text *, t));
186186
int len = VARSIZE_ANY_EXHDR(tunpacked);
187187
char *result;
188188

@@ -213,7 +213,7 @@ void
213213
text_to_cstring_buffer(const text *src, char *dst, size_t dst_len)
214214
{
215215
/* must cast away the const, unfortunately */
216-
text *srcunpacked = pg_detoast_datum_packed((struct varlena *) src);
216+
text *srcunpacked = pg_detoast_datum_packed(unconstify(text *, src));
217217
size_t src_len = VARSIZE_ANY_EXHDR(srcunpacked);
218218

219219
if (dst_len > 0)

src/port/win32setlocale.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ pgwin32_setlocale(int category, const char *locale)
183183
* forbidden to modify, so casting away the "const" is innocuous.
184184
*/
185185
if (result)
186-
result = (char *) map_locale(locale_map_result, result);
186+
result = unconstify(char *, map_locale(locale_map_result, result));
187187

188188
return result;
189189
}

0 commit comments

Comments
 (0)