<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/gnulib.git/lib/mktime.c, branch python</title>
<subtitle>git.savannah.gnu.org: git/gnulib.git
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gnulib.git/'/>
<entry>
<title>tzset: Expand comment about TZ problem on native Windows.</title>
<updated>2017-05-09T19:28:00+00:00</updated>
<author>
<name>Bruno Haible</name>
<email>bruno@clisp.org</email>
</author>
<published>2017-05-09T19:27:27+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gnulib.git/commit/?id=aca75e962fd394c5c19dd9a9544b19a233edde30'/>
<id>aca75e962fd394c5c19dd9a9544b19a233edde30</id>
<content type='text'>
* lib/tzset.c (tzset): Elaborate comment, based on explanations by
Paul Eggert.
* lib/ctime.c (rpl_ctime): Likewise.
* lib/localtime.c (rpl_localtime): Likewise.
* lib/mktime.c (mktime): Likewise.
* lib/strftime-fixes.c (rpl_strftime): Likewise.
* lib/wcsftime.c (rpl_wcsftime): Likewise.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* lib/tzset.c (tzset): Elaborate comment, based on explanations by
Paul Eggert.
* lib/ctime.c (rpl_ctime): Likewise.
* lib/localtime.c (rpl_localtime): Likewise.
* lib/mktime.c (mktime): Likewise.
* lib/strftime-fixes.c (rpl_strftime): Likewise.
* lib/wcsftime.c (rpl_wcsftime): Likewise.
</pre>
</div>
</content>
</entry>
<entry>
<title>mktime: Work around TZ problem on native Windows.</title>
<updated>2017-04-30T17:26:38+00:00</updated>
<author>
<name>Bruno Haible</name>
<email>bruno@clisp.org</email>
</author>
<published>2017-04-30T14:34:54+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gnulib.git/commit/?id=db1ee11e2168af7137db53289a92e306d2277b0b'/>
<id>db1ee11e2168af7137db53289a92e306d2277b0b</id>
<content type='text'>
* lib/mktime.c: Add #ifs to make the algorithmic workaround independent
from the native Windows workaround.
* m4/mktime.m4 (gl_FUNC_MKTIME_WORKS): New macro, extracted from
gl_FUNC_MKTIME. If guessing, set gl_cv_func_working_mktime to
'guessing no'.
(gl_FUNC_MKTIME): Require it. Require AC_CANONICAL_HOST.
Set REPLACE_MKTIME to 1 on native Windows. Define NEED_MKTIME_WORKING,
NEED_MKTIME_WINDOWS.
(gl_FUNC_MKTIME_INTERNAL): Require gl_FUNC_MKTIME_WORKS, not
gl_FUNC_MKTIME. Set WANT_MKTIME_INTERNAL, not REPLACE_MKTIME. Define
NEED_MKTIME_INTERNAL.
* m4/timegm.m4 (gl_FUNC_TIMEGM): Require gl_FUNC_MKTIME_WORKS, not
gl_FUNC_MKTIME. Cope with 'guessing yes' value.
* modules/mktime-internal (configure.ac): Test WANT_MKTIME_INTERNAL,
not REPLACE_MKTIME.
* doc/posix-functions/mktime.texi: Mention the native Windows
workaround.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* lib/mktime.c: Add #ifs to make the algorithmic workaround independent
from the native Windows workaround.
* m4/mktime.m4 (gl_FUNC_MKTIME_WORKS): New macro, extracted from
gl_FUNC_MKTIME. If guessing, set gl_cv_func_working_mktime to
'guessing no'.
(gl_FUNC_MKTIME): Require it. Require AC_CANONICAL_HOST.
Set REPLACE_MKTIME to 1 on native Windows. Define NEED_MKTIME_WORKING,
NEED_MKTIME_WINDOWS.
(gl_FUNC_MKTIME_INTERNAL): Require gl_FUNC_MKTIME_WORKS, not
gl_FUNC_MKTIME. Set WANT_MKTIME_INTERNAL, not REPLACE_MKTIME. Define
NEED_MKTIME_INTERNAL.
* m4/timegm.m4 (gl_FUNC_TIMEGM): Require gl_FUNC_MKTIME_WORKS, not
gl_FUNC_MKTIME. Cope with 'guessing yes' value.
* modules/mktime-internal (configure.ac): Test WANT_MKTIME_INTERNAL,
not REPLACE_MKTIME.
* doc/posix-functions/mktime.texi: Mention the native Windows
workaround.
</pre>
</div>
</content>
</entry>
<entry>
<title>maint: time stamp -&gt; timestamp</title>
<updated>2017-01-09T19:58:08+00:00</updated>
<author>
<name>Paul Eggert</name>
<email>eggert@cs.ucla.edu</email>
</author>
<published>2017-01-09T19:55:22+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gnulib.git/commit/?id=e89646ad6f767a475ac83b31ffc00ba17372964c'/>
<id>e89646ad6f767a475ac83b31ffc00ba17372964c</id>
<content type='text'>
Use the spelling "timestamp", as that is what POSIX uses.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Use the spelling "timestamp", as that is what POSIX uses.
</pre>
</div>
</content>
</entry>
<entry>
<title>version-etc: new year</title>
<updated>2017-01-01T02:59:23+00:00</updated>
<author>
<name>Paul Eggert</name>
<email>eggert@cs.ucla.edu</email>
</author>
<published>2017-01-01T02:59:23+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gnulib.git/commit/?id=a3fd683de3decbb58ab5fb5d32ad2e62f74fbf12'/>
<id>a3fd683de3decbb58ab5fb5d32ad2e62f74fbf12</id>
<content type='text'>
* build-aux/gendocs.sh (version):
* doc/gendocs_template:
* doc/gendocs_template_min:
* doc/gnulib.texi:
* lib/version-etc.c (COPYRIGHT_YEAR):
Update copyright dates by hand in templates and the like.
* all files: Run 'make update-copyright'.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* build-aux/gendocs.sh (version):
* doc/gendocs_template:
* doc/gendocs_template_min:
* doc/gnulib.texi:
* lib/version-etc.c (COPYRIGHT_YEAR):
Update copyright dates by hand in templates and the like.
* all files: Run 'make update-copyright'.
</pre>
</div>
</content>
</entry>
<entry>
<title>mktime: call tzset as per POSIX</title>
<updated>2016-07-03T11:00:42+00:00</updated>
<author>
<name>Paul Eggert</name>
<email>eggert@cs.ucla.edu</email>
</author>
<published>2016-07-03T10:59:54+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gnulib.git/commit/?id=97173b26d27d9f31de1789e994dfe014e3a40162'/>
<id>97173b26d27d9f31de1789e994dfe014e3a40162</id>
<content type='text'>
Problem reported by Ludovic Courtès in:
http://lists.gnu.org/archive/html/bug-gnulib/2016-06/msg00068.html
* lib/mktime.c (mktime) [!_LIBC &amp;&amp; HAVE_TZSET]: Call tzset.
* m4/mktime.m4 (gl_FUNC_MKTIME): Check for tzset.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Problem reported by Ludovic Courtès in:
http://lists.gnu.org/archive/html/bug-gnulib/2016-06/msg00068.html
* lib/mktime.c (mktime) [!_LIBC &amp;&amp; HAVE_TZSET]: Call tzset.
* m4/mktime.m4 (gl_FUNC_MKTIME): Check for tzset.
</pre>
</div>
</content>
</entry>
<entry>
<title>mktime: spelling fix in comment</title>
<updated>2016-05-02T01:50:10+00:00</updated>
<author>
<name>Paul Eggert</name>
<email>eggert@cs.ucla.edu</email>
</author>
<published>2016-05-02T01:49:47+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gnulib.git/commit/?id=c382e8d72a5e1b36a51d751b1aa6e6b0201d6189'/>
<id>c382e8d72a5e1b36a51d751b1aa6e6b0201d6189</id>
<content type='text'>
* lib/mktime.c: Fix spelling.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* lib/mktime.c: Fix spelling.
</pre>
</div>
</content>
</entry>
<entry>
<title>mktime: port to stricter signed overflow checking</title>
<updated>2016-05-02T00:27:05+00:00</updated>
<author>
<name>Paul Eggert</name>
<email>eggert@cs.ucla.edu</email>
</author>
<published>2016-05-02T00:25:16+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gnulib.git/commit/?id=e6a38a908492a8cb0b8371e9cdb360ad61673a61'/>
<id>e6a38a908492a8cb0b8371e9cdb360ad61673a61</id>
<content type='text'>
* lib/mktime.c: Omit 'pragma GCC optimize ("wrapv")'.
(long_int): Require width for INT_MAX * 3 * (seconds per year),
instead of merely for INT_MAX * 2.  In practice platforms that
do the latter also do the former.
(TIME_T_MIN, TIME_T_MAX, TIME_T_MIDPOINT, SHR): Remove.
(shr): New static function, replacing SHR.  All uses changed.
(mktime_min, mktime_max): New constants, replacing TIME_T_MIN
and TIME_T_MAX.  All uses changed.
(ydhms_diff, guess_time_tm, ranged_convert, __mktime_internal):
Use long_int, not time_t.
(long_int_avg): New static function, replacing time_t_avg.
All uses changed.  Round toward positive infinity, as that
generates slightly better code.
(time_t_add_ok, time_t_int_add_ok): Remove.  All uses replaced
by INT_ADD_WRAPV.
(guess_time_tm): Accept time, not a pointer to it.  All uses changed.
(convert_time): New static function.
(ranged_convert): Use it
(ranged_convert): Check for *T out of [mktime_min, mktime_max] range.
Use simpler test for loop exit.
(__mktime_internal): Store negative of guessed offset, to simplify
overflow checking.  Remove no-longer-needed test for small time_t
overflows.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* lib/mktime.c: Omit 'pragma GCC optimize ("wrapv")'.
(long_int): Require width for INT_MAX * 3 * (seconds per year),
instead of merely for INT_MAX * 2.  In practice platforms that
do the latter also do the former.
(TIME_T_MIN, TIME_T_MAX, TIME_T_MIDPOINT, SHR): Remove.
(shr): New static function, replacing SHR.  All uses changed.
(mktime_min, mktime_max): New constants, replacing TIME_T_MIN
and TIME_T_MAX.  All uses changed.
(ydhms_diff, guess_time_tm, ranged_convert, __mktime_internal):
Use long_int, not time_t.
(long_int_avg): New static function, replacing time_t_avg.
All uses changed.  Round toward positive infinity, as that
generates slightly better code.
(time_t_add_ok, time_t_int_add_ok): Remove.  All uses replaced
by INT_ADD_WRAPV.
(guess_time_tm): Accept time, not a pointer to it.  All uses changed.
(convert_time): New static function.
(ranged_convert): Use it
(ranged_convert): Check for *T out of [mktime_min, mktime_max] range.
Use simpler test for loop exit.
(__mktime_internal): Store negative of guessed offset, to simplify
overflow checking.  Remove no-longer-needed test for small time_t
overflows.
</pre>
</div>
</content>
</entry>
<entry>
<title>mktime: speed up DEBUG_MKTIME benchmarks</title>
<updated>2016-05-02T00:27:04+00:00</updated>
<author>
<name>Paul Eggert</name>
<email>eggert@cs.ucla.edu</email>
</author>
<published>2016-05-01T19:49:21+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gnulib.git/commit/?id=e8cf92310a7f6323bc43c0143bfc3da66ef4a1c2'/>
<id>e8cf92310a7f6323bc43c0143bfc3da66ef4a1c2</id>
<content type='text'>
Call tzset just once, at the start, rather than for every test
case.  This lets us measure the CPU cost of mktime as opposed to
that of tzset.  This is relevant when TZ is not set and glibc is
being used.  This speeds up tests by a factor of 40 on my Fedora
23 x86-64 platform.
* lib/mktime.c (main) [DEBUG_MKTIME]: Call localtime at the start,
to call tzset and as a sanity check.  Later on, use localtime_r
instead of localtime.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Call tzset just once, at the start, rather than for every test
case.  This lets us measure the CPU cost of mktime as opposed to
that of tzset.  This is relevant when TZ is not set and glibc is
being used.  This speeds up tests by a factor of 40 on my Fedora
23 x86-64 platform.
* lib/mktime.c (main) [DEBUG_MKTIME]: Call localtime at the start,
to call tzset and as a sanity check.  Later on, use localtime_r
instead of localtime.
</pre>
</div>
</content>
</entry>
<entry>
<title>mktime: resurrect DEBUG_MKTIME testing</title>
<updated>2016-05-02T00:27:04+00:00</updated>
<author>
<name>Paul Eggert</name>
<email>eggert@cs.ucla.edu</email>
</author>
<published>2016-05-01T19:15:52+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gnulib.git/commit/?id=b4a3de1dee4dde76e010a34c25aeb9c160d564d7'/>
<id>b4a3de1dee4dde76e010a34c25aeb9c160d564d7</id>
<content type='text'>
* lib/mktime.c [DEBUG_MKTIME]: Do not include &lt;config.h&gt;.
Include &lt;string.h&gt;, for strcmp.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* lib/mktime.c [DEBUG_MKTIME]: Do not include &lt;config.h&gt;.
Include &lt;string.h&gt;, for strcmp.
</pre>
</div>
</content>
</entry>
<entry>
<title>mktime: simplify DEBUG_MKTIME</title>
<updated>2016-05-02T00:27:03+00:00</updated>
<author>
<name>Paul Eggert</name>
<email>eggert@cs.ucla.edu</email>
</author>
<published>2016-05-01T19:10:37+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gnulib.git/commit/?id=549de1eb50f949634bd45341a56a5f9a56f96a76'/>
<id>549de1eb50f949634bd45341a56a5f9a56f96a76</id>
<content type='text'>
* lib/mktime.c (DEBUG_MKTIME): Define to 0 if not defined.
Simplify later usage accordingly.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* lib/mktime.c (DEBUG_MKTIME): Define to 0 if not defined.
Simplify later usage accordingly.
</pre>
</div>
</content>
</entry>
</feed>
