File tree Expand file tree Collapse file tree 4 files changed +6
-6
lines changed Expand file tree Collapse file tree 4 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -207,12 +207,12 @@ IsValidJsonNumber(const char *str, int len)
207
207
*/
208
208
if (* str == '-' )
209
209
{
210
- dummy_lex .input = (char * ) str + 1 ;
210
+ dummy_lex .input = unconstify (char * , str ) + 1 ;
211
211
dummy_lex .input_length = len - 1 ;
212
212
}
213
213
else
214
214
{
215
- dummy_lex .input = (char * ) str ;
215
+ dummy_lex .input = unconstify (char * , str ) ;
216
216
dummy_lex .input_length = len ;
217
217
}
218
218
Original file line number Diff line number Diff line change @@ -423,7 +423,7 @@ pg_get_keywords(PG_FUNCTION_ARGS)
423
423
HeapTuple tuple ;
424
424
425
425
/* 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 ) ;
427
427
428
428
switch (ScanKeywords [funcctx -> call_cntr ].category )
429
429
{
Original file line number Diff line number Diff line change @@ -182,7 +182,7 @@ char *
182
182
text_to_cstring (const text * t )
183
183
{
184
184
/* 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 ) );
186
186
int len = VARSIZE_ANY_EXHDR (tunpacked );
187
187
char * result ;
188
188
213
213
text_to_cstring_buffer (const text * src , char * dst , size_t dst_len )
214
214
{
215
215
/* 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 ) );
217
217
size_t src_len = VARSIZE_ANY_EXHDR (srcunpacked );
218
218
219
219
if (dst_len > 0 )
Original file line number Diff line number Diff line change @@ -183,7 +183,7 @@ pgwin32_setlocale(int category, const char *locale)
183
183
* forbidden to modify, so casting away the "const" is innocuous.
184
184
*/
185
185
if (result )
186
- result = (char * ) map_locale (locale_map_result , result );
186
+ result = unconstify (char * , map_locale (locale_map_result , result ) );
187
187
188
188
return result ;
189
189
}
You can’t perform that action at this time.
0 commit comments