]> Savannah Git Hosting - gnulib.git/commitdiff
mktime: simplify DEBUG_MKTIME
authorPaul Eggert <eggert@cs.ucla.edu>
Sun, 1 May 2016 19:10:37 +0000 (12:10 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 2 May 2016 00:27:03 +0000 (17:27 -0700)
* lib/mktime.c (DEBUG_MKTIME): Define to 0 if not defined.
Simplify later usage accordingly.

ChangeLog
lib/mktime.c

index 4b406cc283ed6624c9233f6c4980299d1aa6c2ac..5b0dc9322b2de7881d93337a59c9b4f29bfbd0eb 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,11 +1,16 @@
 2016-05-01  Paul Eggert  <eggert@cs.ucla.edu>
 
+       mktime: simplify DEBUG_MKTIME
+       * lib/mktime.c (DEBUG_MKTIME): Define to 0 if not defined.
+       Simplify later usage accordingly.
+
        Port mktime_internal offset to unsigned time_t
        This avoids some assumptions about wraparound arithmetic on
        signed integer overflow.
        * lib/mktime-internal.h (mktime_offset_t): New type.
        (mktime_internal): Use it in decl.
        * lib/mktime.c, lib/timegm.c (mktime_offset_t) [_LIBC]: New type.
+
        * lib/mktime.c (__mktime_internal, localtime_offset):
        * lib/timegm.c (timegm): Use it.
        * m4/mktime.m4 (gl_TIME_T_IS_SIGNED): New macro.
index 4f4f0bf34c98085593c1a7f7bf3c434af7b23370..ccc6c5149f6ea812dfdc022d9299e780d12e7cd8 100644 (file)
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-/* Define this to have a standalone program to test this implementation of
+/* Define this to 1 to have a standalone program to test this implementation of
    mktime.  */
-/* #define DEBUG_MKTIME 1 */
+#ifndef DEBUG_MKTIME
+# define DEBUG_MKTIME 0
+#endif
 
 #ifndef _LIBC
 # include <config.h>
 #include <intprops.h>
 #include <verify.h>
 
-#if defined DEBUG_MKTIME && DEBUG_MKTIME
+#if DEBUG_MKTIME
 # include <stdio.h>
 # include <stdlib.h>
 /* Make it work even if the system's libc has its own mktime routine.  */
 # undef mktime
 # define mktime my_mktime
-#endif /* DEBUG_MKTIME */
+#endif
 
 /* Some of the code in this file assumes that signed integer overflow
    silently wraps around.  This assumption can't easily be programmed
@@ -545,7 +547,7 @@ libc_hidden_def (mktime)
 libc_hidden_weak (timelocal)
 #endif
 \f
-#if defined DEBUG_MKTIME && DEBUG_MKTIME
+#if DEBUG_MKTIME
 
 static int
 not_equal_tm (const struct tm *a, const struct tm *b)