From cb675ad06252e16b752529fff29d19a1100eda9f Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Wed, 9 Mar 2005 19:23:59 +0000 Subject: [PATCH] (TYPE_SIGNED): Remove. (INT_STRLEN_BOUND): Switch to same implementation as intprops.h. --- lib/strftime.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/lib/strftime.c b/lib/strftime.c index 6d742f2655..8085a59925 100644 --- a/lib/strftime.c +++ b/lib/strftime.c @@ -120,15 +120,12 @@ extern char *tzname[]; ? (a) >> (b) \ : (a) / (1 << (b)) - ((a) % (1 << (b)) < 0)) -#define TYPE_SIGNED(t) ((t) -1 < 0) - -/* Bound on length of the string representing an integer value of type t. - Subtract one for the sign bit if t is signed; - 302 / 1000 is log10 (2) rounded up; - add one for integer division truncation; - add one more for a minus sign if t is signed. */ +/* Bound on length of the string representing an integer value or type T. + Subtract 1 for the sign bit if t is signed; log10 (2.0) < 146/485; + add 1 for integer division truncation; add 1 more for a minus sign + if needed. */ #define INT_STRLEN_BOUND(t) \ - ((sizeof (t) * CHAR_BIT - TYPE_SIGNED (t)) * 302 / 1000 + 1 + TYPE_SIGNED (t)) + ((sizeof (t) * CHAR_BIT - 1) * 146 / 485 + 2) #define TM_YEAR_BASE 1900 -- 2.47.3