From bad5116957eea2dc360c6c233be08284bd3d5364 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Fri, 9 Dec 2022 10:43:45 -0500 Subject: Const-ify a couple of datetime parsing subroutines. More could be done in this line, but I just grabbed some low-hanging fruit. Principal objective was to remove the need for several ugly unconstify() usages in formatting.c. --- src/backend/utils/adt/formatting.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/backend/utils/adt/formatting.c') diff --git a/src/backend/utils/adt/formatting.c b/src/backend/utils/adt/formatting.c index 26f498b5df4..311c9e748ba 100644 --- a/src/backend/utils/adt/formatting.c +++ b/src/backend/utils/adt/formatting.c @@ -4246,7 +4246,7 @@ to_timestamp(PG_FUNCTION_ARGS) /* Use the specified time zone, if any. */ if (tm.tm_zone) { - int dterr = DecodeTimezone(unconstify(char *, tm.tm_zone), &tz); + int dterr = DecodeTimezone(tm.tm_zone, &tz); if (dterr) DateTimeParseError(dterr, text_to_cstring(date_txt), "timestamptz"); @@ -4343,7 +4343,7 @@ parse_datetime(text *date_txt, text *fmt, Oid collid, bool strict, if (tm.tm_zone) { - int dterr = DecodeTimezone(unconstify(char *, tm.tm_zone), tz); + int dterr = DecodeTimezone(tm.tm_zone, tz); if (dterr) DateTimeParseError(dterr, text_to_cstring(date_txt), "timestamptz"); @@ -4429,7 +4429,7 @@ parse_datetime(text *date_txt, text *fmt, Oid collid, bool strict, if (tm.tm_zone) { - int dterr = DecodeTimezone(unconstify(char *, tm.tm_zone), tz); + int dterr = DecodeTimezone(tm.tm_zone, tz); if (dterr) RETURN_ERROR(DateTimeParseError(dterr, text_to_cstring(date_txt), "timetz")); -- cgit v1.2.3