This is the mail archive of the
glibc-cvs@sourceware.org
mailing list for the glibc project.
GNU C Library master sources branch master updated. glibc-2.25-88-g6e3b522
- From: fw at sourceware dot org
- To: glibc-cvs at sourceware dot org
- Date: 7 Mar 2017 16:46:08 -0000
- Subject: GNU C Library master sources branch master updated. glibc-2.25-88-g6e3b522
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".
The branch, master has been updated
via 6e3b52292a042ede4d053054a895167afd6edcf2 (commit)
from 8492c4dd699e2a65a5a2e8fca3e0e530326c92b9 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=6e3b52292a042ede4d053054a895167afd6edcf2
commit 6e3b52292a042ede4d053054a895167afd6edcf2
Author: Florian Weimer <fweimer@redhat.com>
Date: Tue Mar 7 10:39:00 2017 +0100
tzset: Clean up preprocessor macros min, max, sign
diff --git a/ChangeLog b/ChangeLog
index 63b9a15..9045b60 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
2017-03-07 Florian Weimer <fweimer@redhat.com>
+ * time/tzset.c (compute_offset): Open-code min macro.
+ (min, max, sign): Remove.
+
+2017-03-07 Florian Weimer <fweimer@redhat.com>
+
+2017-03-07 Florian Weimer <fweimer@redhat.com>
+
[BZ #15576]
Remove TZNAME_MAX limit from sysconf.
* include/time.h (__tzname_cur_max, __tzname_max): Remove
@@ -12,6 +19,7 @@
(tzset_internal): Remove argument.
(__tzset): Adjust call to tzset_internal.
(__tz_convert): Likewise.
+
* posix/sysconf.c (__sysconf): Return -1 for _SC_TZNAME_MAX.
* sysdeps/posix/sysconf.c (__sysconf): Likewise.
* manual/conf.texi (Sysconf Definition): Update comment.
diff --git a/time/tzset.c b/time/tzset.c
index f0e5c95..8868e9a 100644
--- a/time/tzset.c
+++ b/time/tzset.c
@@ -38,12 +38,6 @@ weak_alias (__timezone, timezone)
/* This locks all the state variables in tzfile.c and this file. */
__libc_lock_define_initialized (static, tzset_lock)
-
-#define min(a, b) ((a) < (b) ? (a) : (b))
-#define max(a, b) ((a) > (b) ? (a) : (b))
-#define sign(x) ((x) < 0 ? -1 : 1)
-
-
/* This structure contains all the information about a
timezone given in the POSIX standard TZ envariable. */
typedef struct
@@ -142,7 +136,13 @@ update_vars (void)
static unsigned int
compute_offset (unsigned int ss, unsigned int mm, unsigned int hh)
{
- return min (ss, 59) + min (mm, 59) * 60 + min (hh, 24) * 60 * 60;
+ if (ss > 59)
+ ss = 59;
+ if (mm > 59)
+ mm = 59;
+ if (hh > 24)
+ hh = 24;
+ return ss + mm * 60 + hh * 60 * 60;
}
/* Parses the time zone name at *TZP, and writes a pointer to an
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 8 ++++++++
time/tzset.c | 14 +++++++-------
2 files changed, 15 insertions(+), 7 deletions(-)
hooks/post-receive
--
GNU C Library master sources