*/
if (*str == '-')
{
- dummy_lex.input = (char *) str + 1;
+ dummy_lex.input = unconstify(char *, str) + 1;
dummy_lex.input_length = len - 1;
}
else
{
- dummy_lex.input = (char *) str;
+ dummy_lex.input = unconstify(char *, str);
dummy_lex.input_length = len;
}
HeapTuple tuple;
/* cast-away-const is ugly but alternatives aren't much better */
- values[0] = (char *) ScanKeywords[funcctx->call_cntr].name;
+ values[0] = unconstify(char *, ScanKeywords[funcctx->call_cntr].name);
switch (ScanKeywords[funcctx->call_cntr].category)
{
text_to_cstring(const text *t)
{
/* must cast away the const, unfortunately */
- text *tunpacked = pg_detoast_datum_packed((struct varlena *) t);
+ text *tunpacked = pg_detoast_datum_packed(unconstify(text *, t));
int len = VARSIZE_ANY_EXHDR(tunpacked);
char *result;
text_to_cstring_buffer(const text *src, char *dst, size_t dst_len)
{
/* must cast away the const, unfortunately */
- text *srcunpacked = pg_detoast_datum_packed((struct varlena *) src);
+ text *srcunpacked = pg_detoast_datum_packed(unconstify(text *, src));
size_t src_len = VARSIZE_ANY_EXHDR(srcunpacked);
if (dst_len > 0)
* forbidden to modify, so casting away the "const" is innocuous.
*/
if (result)
- result = (char *) map_locale(locale_map_result, result);
+ result = unconstify(char *, map_locale(locale_map_result, result));
return result;
}