diff options
author | Peter Geoghegan | 2022-09-19 22:13:42 +0000 |
---|---|---|
committer | Peter Geoghegan | 2022-09-19 22:13:42 +0000 |
commit | c4f8e89fef3d4cd8b0791637667fd984d6f38fb2 (patch) | |
tree | 4f64968ab17baef3aa658c963d2a215598ee3eb1 /src/timezone/pgtz.c | |
parent | bc2187ed63c56bb9cd99f6613f3e2ba56afb22fe (diff) |
Consistently use named parameters in timezone code.
Make our copy of the IANA timezone library use named parameters in
function declarations. Also make sure that parameter names from each
function's declaration match corresponding definition parameter names.
This makes the timezone code follow Postgres coding standards. The
value of having a consistent standard everywhere seems to outweigh the
cost of keeping the function declarations in sync with future IANA
releases.
Author: Peter Geoghegan <[email protected]>
Reviewed-By: David Rowley <[email protected]>
Discussion: https://postgr.es/m/CAH2-WznJt9CMM9KJTMjJh_zbL5hD9oX44qdJ4aqZtjFi-zA3Tg@mail.gmail.com
Diffstat (limited to 'src/timezone/pgtz.c')
-rw-r--r-- | src/timezone/pgtz.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/timezone/pgtz.c b/src/timezone/pgtz.c index 72f9e3d5e6c..40096ed792e 100644 --- a/src/timezone/pgtz.c +++ b/src/timezone/pgtz.c @@ -232,7 +232,7 @@ init_timezone_hashtable(void) * default timezone setting is later overridden from postgresql.conf. */ pg_tz * -pg_tzset(const char *name) +pg_tzset(const char *tzname) { pg_tz_cache *tzp; struct state tzstate; @@ -240,7 +240,7 @@ pg_tzset(const char *name) char canonname[TZ_STRLEN_MAX + 1]; char *p; - if (strlen(name) > TZ_STRLEN_MAX) + if (strlen(tzname) > TZ_STRLEN_MAX) return NULL; /* not going to fit */ if (!timezone_cache) @@ -254,8 +254,8 @@ pg_tzset(const char *name) * a POSIX-style timezone spec.) */ p = uppername; - while (*name) - *p++ = pg_toupper((unsigned char) *name++); + while (*tzname) + *p++ = pg_toupper((unsigned char) *tzname++); *p = '\0'; tzp = (pg_tz_cache *) hash_search(timezone_cache, |