]> sjero.net Git - wget/commitdiff
[svn] Removed the SPRINTF_WGINT macro.
authorhniksic <devnull@localhost>
Fri, 3 Feb 2006 10:31:00 +0000 (02:31 -0800)
committerhniksic <devnull@localhost>
Fri, 3 Feb 2006 10:31:00 +0000 (02:31 -0800)
src/ChangeLog
src/utils.c

index 1ed8e1910a297aacd6cb123cf4a95d425d318298..dbe41e328645ca69821f0ff7d54d2a5a06cf1979 100644 (file)
@@ -3,6 +3,7 @@
        * utils.c (number_to_string): Don't use sprintf for printing
        WGINT_MIN; simply divide n by 10 and defer printing the last
        digit.
+       (number_to_string): Removed the SPRINTF_WGINT macro.
 
 2006-02-03  Mauro Tortonesi  <mauro@ferrara.linux.it>
 
index cb433e7dce1e7e612034b26e94b5001675114a02..c523f639a0b8188933a34fe04ce1b6e0fcf31439 100644 (file)
@@ -1409,20 +1409,6 @@ numdigit (wgint number)
 #define DIGITS_18(mask) PR (mask), n %= (mask), DIGITS_17 ((mask) / 10)
 #define DIGITS_19(mask) PR (mask), n %= (mask), DIGITS_18 ((mask) / 10)
 
-/* SPRINTF_WGINT to portably support machines with strange sizes of
-   wgint.  Ideally this would just cast wgint to intmax_t and use
-   "%j", but many systems don't support it, so it's used only where
-   nothing else is known to work.  */
-#if SIZEOF_LONG >= SIZEOF_WGINT
-# define SPRINTF_WGINT(buf, n) sprintf (buf, "%ld", (long) (n))
-#elif SIZEOF_LONG_LONG >= SIZEOF_WGINT
-# define SPRINTF_WGINT(buf, n) sprintf (buf, "%lld", (long long) (n))
-#elif defined(WINDOWS)
-# define SPRINTF_WGINT(buf, n) sprintf (buf, "%I64d", (__int64) (n))
-#else
-# define SPRINTF_WGINT(buf, n) sprintf (buf, "%j", (intmax_t) (n))
-#endif
-
 /* Shorthand for casting to wgint. */
 #define W wgint
 
@@ -1454,9 +1440,9 @@ number_to_string (char *buffer, wgint number)
   int last_digit_char = 0;
 
 #if (SIZEOF_WGINT != 4) && (SIZEOF_WGINT != 8)
-  /* We are running in a very strange or misconfigured environment.
-     Let sprintf cope with it.  */
-  p += SPRINTF_WGINT (buffer, n);
+  /* We are running in a very strange environment.  Leave the correct
+     printing to sprintf.  */
+  p += sprintf (buf, "%j", (intmax_t) (n));
 #else  /* (SIZEOF_WGINT == 4) || (SIZEOF_WGINT == 8) */
 
   if (n < 0)