mirror of
https://github.com/moparisthebest/wget
synced 2024-07-03 16:38:41 -04:00
[svn] Removed the SPRINTF_WGINT macro.
This commit is contained in:
parent
b6fa9ce7be
commit
85146a6ebd
@ -3,6 +3,7 @@
|
|||||||
* utils.c (number_to_string): Don't use sprintf for printing
|
* utils.c (number_to_string): Don't use sprintf for printing
|
||||||
WGINT_MIN; simply divide n by 10 and defer printing the last
|
WGINT_MIN; simply divide n by 10 and defer printing the last
|
||||||
digit.
|
digit.
|
||||||
|
(number_to_string): Removed the SPRINTF_WGINT macro.
|
||||||
|
|
||||||
2006-02-03 Mauro Tortonesi <mauro@ferrara.linux.it>
|
2006-02-03 Mauro Tortonesi <mauro@ferrara.linux.it>
|
||||||
|
|
||||||
|
20
src/utils.c
20
src/utils.c
@ -1409,20 +1409,6 @@ numdigit (wgint number)
|
|||||||
#define DIGITS_18(mask) PR (mask), n %= (mask), DIGITS_17 ((mask) / 10)
|
#define DIGITS_18(mask) PR (mask), n %= (mask), DIGITS_17 ((mask) / 10)
|
||||||
#define DIGITS_19(mask) PR (mask), n %= (mask), DIGITS_18 ((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. */
|
/* Shorthand for casting to wgint. */
|
||||||
#define W wgint
|
#define W wgint
|
||||||
|
|
||||||
@ -1454,9 +1440,9 @@ number_to_string (char *buffer, wgint number)
|
|||||||
int last_digit_char = 0;
|
int last_digit_char = 0;
|
||||||
|
|
||||||
#if (SIZEOF_WGINT != 4) && (SIZEOF_WGINT != 8)
|
#if (SIZEOF_WGINT != 4) && (SIZEOF_WGINT != 8)
|
||||||
/* We are running in a very strange or misconfigured environment.
|
/* We are running in a very strange environment. Leave the correct
|
||||||
Let sprintf cope with it. */
|
printing to sprintf. */
|
||||||
p += SPRINTF_WGINT (buffer, n);
|
p += sprintf (buf, "%j", (intmax_t) (n));
|
||||||
#else /* (SIZEOF_WGINT == 4) || (SIZEOF_WGINT == 8) */
|
#else /* (SIZEOF_WGINT == 4) || (SIZEOF_WGINT == 8) */
|
||||||
|
|
||||||
if (n < 0)
|
if (n < 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user