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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 1 addition & 1 deletion
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy