2019-02-03 Florian Weimer <fweimer@redhat.com>
+ * include/time.h (__tzfile_default): Use int, not long int, for
+ the GMT offsets.
+ * time/tzfile.c (struct ttinfo): Change type of the offset member
+ to int.
+ (__tzfile_read): Remove useless cast.
+ (__tzfile_default): Adjust prototype.
+ * time/tzset.c (tz_rule): Change type of the offset member to int.
+ (parse_offset): Change the type of the sign variable to int.
+
+2019-02-03 Florian Weimer <fweimer@redhat.com>
+
[BZ #24153]
* debug/gets_chk.c (__gets_chk): Use stdin instead of _IO_stdin.
* libio/getchar.c (getchar): Likewise.
long int *leap_correct, int *leap_hit,
struct tm *tp) attribute_hidden;
extern void __tzfile_default (const char *std, const char *dst,
- long int stdoff, long int dstoff)
+ int stdoff, int dstoff)
attribute_hidden;
extern void __tzset_parse_tz (const char *tz) attribute_hidden;
extern void __tz_compute (__time64_t timer, struct tm *tm, int use_localtime)
struct ttinfo
{
- long int offset; /* Seconds east of GMT. */
+ int offset; /* Seconds east of GMT. */
unsigned char isdst; /* Used to set tm_isdst. */
unsigned char idx; /* Index into `zone_names'. */
unsigned char isstd; /* Transition times are in standard time. */
/* Bogus index in data file. */
goto lose;
types[i].idx = c;
- types[i].offset = (long int) decode (x);
+ types[i].offset = decode (x);
}
if (__glibc_unlikely (__fread_unlocked (zone_names, 1, chars, f) != chars))
void
__tzfile_default (const char *std, const char *dst,
- long int stdoff, long int dstoff)
+ int stdoff, int dstoff)
{
size_t stdlen = strlen (std) + 1;
size_t dstlen = strlen (dst) + 1;
unsigned short int m, n, d; /* Month, week, day. */
int secs; /* Time of day. */
- long int offset; /* Seconds east of GMT (west if < 0). */
+ int offset; /* Seconds east of GMT (west if < 0). */
/* We cache the computed time of change for a
given year so we don't have to recompute it. */
&& (*tz == '\0' || (*tz != '+' && *tz != '-' && !isdigit (*tz))))
return false;
- long sign;
+ int sign;
if (*tz == '-' || *tz == '+')
- sign = *tz++ == '-' ? 1L : -1L;
+ sign = *tz++ == '-' ? 1 : -1;
else
- sign = -1L;
+ sign = -1;
*tzp = tz;
unsigned short int hh;