This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: PATCH: Use long long in _itoa and _itowa if PREFER_LONG_LONG is defined
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Roland McGrath <roland at hack dot frob dot com>
- Cc: GNU C Library <libc-alpha at sourceware dot org>
- Date: Fri, 18 May 2012 05:45:18 -0700
- Subject: Re: PATCH: Use long long in _itoa and _itowa if PREFER_LONG_LONG is defined
- References: <20120316192214.GA322@intel.com><20120316233355.E65672C0D1@topped-with-meat.com><CAMe9rOrbtq2UNBWt7dREivmN=bzDNx4scjx0fdKnc0qd6obQoA@mail.gmail.com><20120320200635.DFAB32C0A3@topped-with-meat.com><CAMe9rOq54DEmiOaR_f2qcKzuVd=GpiTUm-OLkYT-W2v5GswYpQ@mail.gmail.com><CAMe9rOqxtURH7r39ozAiVEQS_5iexJ9kAGB8pWbMXNbdeCmFsg@mail.gmail.com><20120320224849.337952C08F@topped-with-meat.com><CAMe9rOr-ZCvFKSGpWodMti7pAGTnxg8_7Lnty=7b=O1nypkEAA@mail.gmail.com><20120320231339.99A902C097@topped-with-meat.com><CAMe9rOr7D3jyEdWswHh2Uu=SGratvnpk9vwaXqNM5=iZst1suA@mail.gmail.com><20120321185456.AD9F22C06F@topped-with-meat.com><CAMe9rOrLSxwSc5kcroqrfBqZ5=yzGxAP8Wgio4uHkgD5cx00nw@mail.gmail.com><20120321213649.B267C2C08B@topped-with-meat.com>
On Wed, Mar 21, 2012 at 2:36 PM, Roland McGrath <roland@hack.frob.com> wrote:
> Looks OK to me.
>
> Thanks,
> Roland
Apparently, this part of the patch is never checked in.
I am checking it now. Tested on Linux/x32/ia32/x86-64.
--
H.J.
---
diff --git a/stdio-common/_itoa.c b/stdio-common/_itoa.c
index 3dfff8f..12d6954 100644
--- a/stdio-common/_itoa.c
+++ b/stdio-common/_itoa.c
@@ -79,7 +79,7 @@ struct base_table_t
/* We do not compile _itoa if we always can use _itoa_word. */
-#if LLONG_MAX != LONG_MAX
+#if _ITOA_NEEDED
/* Local variables. */
const struct base_table_t _itoa_base_table[] attribute_hidden =
{
@@ -169,7 +169,7 @@ extern const char _itoa_upper_digits_internal[]
attribute_hidden;
char *
-_itoa_word (unsigned long value, char *buflim,
+_itoa_word (_ITOA_WORD_TYPE value, char *buflim,
unsigned int base, int upper_case)
{
const char *digits = (upper_case
@@ -204,7 +204,7 @@ _itoa_word (unsigned long value, char *buflim,
#undef SPECIAL
-#if LLONG_MAX != LONG_MAX
+#if _ITOA_NEEDED
char *
_itoa (value, buflim, base, upper_case)
unsigned long long int value;
@@ -470,7 +470,8 @@ _itoa (value, buflim, base, upper_case)
#endif
char *
-_fitoa_word (unsigned long value, char *buf, unsigned int base, int upper_case)
+_fitoa_word (_ITOA_WORD_TYPE value, char *buf, unsigned int base,
+ int upper_case)
{
char tmpbuf[sizeof (value) * 4]; /* Worst case length: base 2. */
char *cp = _itoa_word (value, tmpbuf + sizeof (value) * 4, base, upper_case);
@@ -479,7 +480,7 @@ _fitoa_word (unsigned long value, char *buf,
unsigned int base, int upper_case)
return buf;
}
-#if LLONG_MAX != LONG_MAX
+#if _ITOA_NEEDED
char *
_fitoa (unsigned long long value, char *buf, unsigned int base, int upper_case)
{