Skip to content

Commit

Permalink
mktime: merge another wrapv change from gnulib
Browse files Browse the repository at this point in the history
* time/mktime.c (TYPE_MAXIMUM): Rework slightly to avoid diagnostics
from some compilers.
  • Loading branch information
Paul Eggert committed May 23, 2012
1 parent 6860543 commit 72a22e5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
2012-05-23 Paul Eggert <eggert@cs.ucla.edu>

mktime: merge another wrapv change from gnulib
* time/mktime.c (TYPE_MAXIMUM): Rework slightly to avoid diagnostics
from some compilers.

mktime: remove incorrect attempt at unusual arithmetics
* time/mktime.c (TYPE_ONES_COMPLEMENT, TYPE_SIGNED_MAGNITUDE): Remove.
The code didn't really work on such machines anyway.
Expand Down
2 changes: 1 addition & 1 deletion time/mktime.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ verify (long_int_is_wide_enough, INT_MAX == INT_MAX * (long_int) 2 / 2);
#define TYPE_MAXIMUM(t) \
((t) (! TYPE_SIGNED (t) \
? (t) -1 \
: ~ (~ (t) 0 << (sizeof (t) * CHAR_BIT - 1))))
: ((((t) 1 << (sizeof (t) * CHAR_BIT - 2)) - 1) * 2 + 1)))

#ifndef TIME_T_MIN
# define TIME_T_MIN TYPE_MINIMUM (time_t)
Expand Down

0 comments on commit 72a22e5

Please sign in to comment.