aboutsummaryrefslogtreecommitdiff
path: root/newlib/libc/time/gmtime_r.c
AgeCommit message (Collapse)AuthorFilesLines
2018-01-17ansification: remove _DEFUNYaakov Selkowitz1-2/+1
Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2018-01-17ansification: remove _CONSTYaakov Selkowitz1-2/+2
Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2018-01-17ansification: remove _ANDYaakov Selkowitz1-1/+1
Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2017-09-07Remove harmful casts in gmtime_r()Sebastian Huber1-2/+2
In case time_t is long, then the cast to long is a nop. In case time_t is __int_least64_t, then the cast to long may truncate the value before the division. Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2015-06-15gmtime_r: Use faster algorithm by Howard HinnantFreddie Chopin1-71/+35
* libc/time/gmtime_r.c (gmtime_r): use faster algorithm from civil_from_days() by Howard Hinnant Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2014-12-08 * libc/time/gmtime_r.c (gmtime_r): Fixed bug in calculations for datesCorinna Vinschen1-36/+71
after year 2069 or before year 1901. Ideas for solution taken from musl's __secs_to_tm()
2014-11-12 * libc/stdlib/strtod.c (sulp): Cast to int32_t to avoid overflow.Corinna Vinschen1-4/+4
* libc/time/gmtime_r.c (DAYS_PER_*_YEARS): Convert to long constants to avoid overflow.
2014-10-20 * libc/time/gmtime_r.c (gmtime_r): Remove dead code.Corinna Vinschen1-5/+0
2014-09-112014-09-11 Freddie Chopin <freddie_chopin@op.pl>Jeff Johnston1-2/+95
* libc/time/month_lengths.c: New file with __month_lengths array (previously mon_lengths array in mktm_r.c) * libc/time/tzcalc_limits.c: New file with __tzcalc_limits() from mktm_r.c * libc/time/lcltime_r.c (localtime_r): Simplify by changing call to _mktm_r() with call to gmtime_r() and code moved from _mktm_r() which was used to do time zone adjustments * libc/time/gmtime_r.c (gmtime_r): Simplify by moving all relevant code from _mktm_r(), breaking all dependencies on time zone related functions * libc/time/mktm_r.c: Delete file * libc/time/local.h: Update accordingly - remove declaration of _mktm_r(), add declaration of __month_lengths[] * libc/time/Makefile.am: Modify accordingly. * libc/time/Makefile.in: Regenerate.
2013-11-252013-11-25 Sahil Patnayakuni <sahil.patnayakuni@gmail.com>Joel Sherrill1-2/+2
* libc/include/time.h (time): Add restrict keyword. * libc/include/wchar.h (wcsftime): Add restrict keyword. * libc/time/asctime_r.c (asctime_r): Same. * libc/time/gmtime_r.c (gmtime_r): Same. * libc/time/lcltime_r.c (lcltime_r): Same. * libc/time/strftime.c (strftime): Same. * libc/time/strptime.c (strptime): Same. * libc/sys/linux/linuxthreads/timer_create.c (timer_create): Same. * libc/sys/linux/linuxthreads/timer_settime.c (timer_settime): Same.
2002-04-172002-04-17 Jeff Johnston <jjohnstn@redhat.com>Jeff Johnston1-5/+2
* libc/include/time.h (tzset, _tzset_r): Added prototypes. (strptime): Moved prototype to be within !__STRICT_ANSI__. (_tzname, _daylight, _timezone): No long __CYGWIN__ only. (tzname): Defined for all platforms. (daylight, timezone): Defined only for CYGWIN. * libc/sys/linux/machine/i386/crt0.c: Add call to tzset() after environment set up. * libc/stdlib/setenv_r.c (_setenv_r): Call tzset() if the TZ environment variable is set. * libc/time/Makefile.am: Add support for tzset.c, tzlock.c, and tzset_r.c. * libc/time/Makefile.in: Regenerated. * libc/time/gmtime.c (gmtime): Changed to call gmtime_r. * libc/time/gmtime_r.c (gmtime_r): Changed to call _mktm_r. * libc/time/lcltime_r.c (lcltime_r): Ditto. * libc/time/local.h: New local header file. * libc/time/mktime.c (mktime): Add timezone support. * libc/time/mktm_r.c: New file which is the common engine for gmtime_r and lcltime_r. This code has timezone support. * libc/time/strftime.c (strftime): Add %Z timezone support. * libc/time/tzlock.c: New file containing timezone lock stubs. * libc/time/tzset.c: New file containing tzset() routine. * libc/time/tzset_r.c: New file containing _tzset_r and internal routine for calculating timezone changes for specified year.
2000-02-17import newlib-2000-02-17 snapshotChristopher Faylor1-0/+17