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)
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
Original file line number Diff line number Diff 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 {
Original file line number Diff line number Diff line change @@ -182,7 +182,7 @@ char *
182182text_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
213213text_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 )
Original file line number Diff line number Diff 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}
You can’t perform that action at this time.
0 commit comments