summaryrefslogtreecommitdiff
path: root/ext/date/lib/timelib.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/date/lib/timelib.c')
-rw-r--r--ext/date/lib/timelib.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/ext/date/lib/timelib.c b/ext/date/lib/timelib.c
index bf7c55a735..4fe327ed59 100644
--- a/ext/date/lib/timelib.c
+++ b/ext/date/lib/timelib.c
@@ -71,10 +71,11 @@ timelib_rel_time* timelib_rel_time_clone(timelib_rel_time *rel)
void timelib_time_tz_abbr_update(timelib_time* tm, char* tz_abbr)
{
unsigned int i;
+ size_t tz_abbr_len = strlen(tz_abbr);
TIMELIB_TIME_FREE(tm->tz_abbr);
tm->tz_abbr = strdup(tz_abbr);
- for (i = 0; i < strlen(tz_abbr); i++) {
+ for (i = 0; i < tz_abbr_len; i++) {
tm->tz_abbr[i] = toupper(tz_abbr[i]);
}
}
@@ -176,13 +177,13 @@ void timelib_error_container_dtor(timelib_error_container *errors)
free(errors);
}
-signed long timelib_date_to_int(timelib_time *d, int *error)
+timelib_long timelib_date_to_int(timelib_time *d, int *error)
{
timelib_sll ts;
ts = d->sse;
- if (ts < LONG_MIN || ts > LONG_MAX) {
+ if (ts < TIMELIB_LONG_MIN || ts > TIMELIB_LONG_MAX) {
if (error) {
*error = 1;
}
@@ -191,7 +192,7 @@ signed long timelib_date_to_int(timelib_time *d, int *error)
if (error) {
*error = 0;
}
- return (signed long) d->sse;
+ return (timelib_long) d->sse;
}
void timelib_decimal_hour_to_hms(double h, int *hour, int *min, int *sec)
@@ -286,10 +287,10 @@ void timelib_dump_rel_time(timelib_rel_time *d)
printf("\n");
}
-long timelib_parse_tz_cor(char **ptr)
+timelib_long timelib_parse_tz_cor(char **ptr)
{
char *begin = *ptr, *end;
- long tmp;
+ timelib_long tmp;
while (isdigit(**ptr) || **ptr == ':') {
++*ptr;