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

Commit0a8590b

Browse files
committed
1 parentf2898de commit0a8590b

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
HeapTupletuple;
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(consttext*t)
183183
{
184184
/* must cast away the const, unfortunately */
185-
text*tunpacked=pg_detoast_datum_packed((structvarlena*)t);
185+
text*tunpacked=pg_detoast_datum_packed(unconstify(text*,t));
186186
intlen=VARSIZE_ANY_EXHDR(tunpacked);
187187
char*result;
188188

@@ -213,7 +213,7 @@ void
213213
text_to_cstring_buffer(consttext*src,char*dst,size_tdst_len)
214214
{
215215
/* must cast away the const, unfortunately */
216-
text*srcunpacked=pg_detoast_datum_packed((structvarlena*)src);
216+
text*srcunpacked=pg_detoast_datum_packed(unconstify(text*,src));
217217
size_tsrc_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
returnresult;
189189
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp