mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-24 14:00:30 +00:00
Use time_t on ays, rem, y and yg in __offtime
This commit is contained in:
parent
96cbe7f482
commit
f196c7f7af
@ -1,3 +1,7 @@
|
||||
2012-03-16 H.J. Lu <hongjiu.lu@intel.com>
|
||||
|
||||
* time/offtime.c (__offtime): Use time_t on days, rem, y and yg.
|
||||
|
||||
2012-03-16 Joseph Myers <joseph@codesourcery.com>
|
||||
|
||||
* sysdeps/ieee754/ldbl-96/t_sincosl.c: Include generator program
|
||||
|
@ -31,7 +31,7 @@ __offtime (t, offset, tp)
|
||||
long int offset;
|
||||
struct tm *tp;
|
||||
{
|
||||
long int days, rem, y;
|
||||
time_t days, rem, y;
|
||||
const unsigned short int *ip;
|
||||
|
||||
days = *t / SECS_PER_DAY;
|
||||
@ -63,7 +63,7 @@ __offtime (t, offset, tp)
|
||||
while (days < 0 || days >= (__isleap (y) ? 366 : 365))
|
||||
{
|
||||
/* Guess a corrected year, assuming 365 days per year. */
|
||||
long int yg = y + days / 365 - (days % 365 < 0);
|
||||
time_t yg = y + days / 365 - (days % 365 < 0);
|
||||
|
||||
/* Adjust DAYS and Y to match the guessed year. */
|
||||
days -= ((yg - y) * 365
|
||||
|
Loading…
Reference in New Issue
Block a user