diff options
author | Peter Eisentraut <peter_e@gmx.net> | 2012-03-15 21:17:19 +0200 |
---|---|---|
committer | Peter Eisentraut <peter_e@gmx.net> | 2012-03-15 21:17:19 +0200 |
commit | eb990a2b9efff853d0c68a9cf902b1df23498540 (patch) | |
tree | 36ec5e50918ef06c3f0a75744191c139f411460a /src/backend/utils/adt/timestamp.c | |
parent | 531e60aec02fa14d02185e42363b2277427e2119 (diff) | |
download | postgresql-eb990a2b9efff853d0c68a9cf902b1df23498540.tar.gz postgresql-eb990a2b9efff853d0c68a9cf902b1df23498540.zip |
Add const qualifier to tzn returned by timestamp2tm()
The tzn value might come from tm->tm_zone, which libc declares as
const, so it's prudent that the upper layers know about this as well.
Diffstat (limited to 'src/backend/utils/adt/timestamp.c')
-rw-r--r-- | src/backend/utils/adt/timestamp.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/backend/utils/adt/timestamp.c b/src/backend/utils/adt/timestamp.c index b3cf1b16a5e..88ff57dd38a 100644 --- a/src/backend/utils/adt/timestamp.c +++ b/src/backend/utils/adt/timestamp.c @@ -494,7 +494,7 @@ timestamptz_out(PG_FUNCTION_ARGS) struct pg_tm tt, *tm = &tt; fsec_t fsec; - char *tzn; + const char *tzn; char buf[MAXDATELEN + 1]; if (TIMESTAMP_NOT_FINITE(dt)) @@ -1415,7 +1415,7 @@ timestamptz_to_str(TimestampTz t) struct pg_tm tt, *tm = &tt; fsec_t fsec; - char *tzn; + const char *tzn; if (TIMESTAMP_NOT_FINITE(t)) EncodeSpecialTimestamp(t, buf); @@ -1466,7 +1466,7 @@ dt2time(Timestamp jd, int *hour, int *min, int *sec, fsec_t *fsec) * timezone) will be used. */ int -timestamp2tm(Timestamp dt, int *tzp, struct pg_tm * tm, fsec_t *fsec, char **tzn, pg_tz *attimezone) +timestamp2tm(Timestamp dt, int *tzp, struct pg_tm * tm, fsec_t *fsec, const char **tzn, pg_tz *attimezone) { Timestamp date; Timestamp time; @@ -1602,7 +1602,7 @@ recalc_t: tm->tm_zone = tx->tm_zone; *tzp = -tm->tm_gmtoff; if (tzn != NULL) - *tzn = (char *) tm->tm_zone; + *tzn = tm->tm_zone; } else { |