diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2022-12-09 10:43:45 -0500 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2022-12-09 10:43:45 -0500 |
commit | bad5116957eea2dc360c6c233be08284bd3d5364 (patch) | |
tree | c7cf0fd40fd7e37f6e14ed4a9c883a8b129a32a3 /src/backend/utils/adt/formatting.c | |
parent | ccff2d20ed9622815df2a7deffce8a7b14830965 (diff) | |
download | postgresql-bad5116957eea2dc360c6c233be08284bd3d5364.tar.gz postgresql-bad5116957eea2dc360c6c233be08284bd3d5364.zip |
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.
Diffstat (limited to 'src/backend/utils/adt/formatting.c')
-rw-r--r-- | src/backend/utils/adt/formatting.c | 6 |
1 files changed, 3 insertions, 3 deletions
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")); |