This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch, master, updated. glibc-2.15-463-g8e95c99


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  8e95c99a7a0b0ca8cf9bfbeddf1e43fb3efc1bee (commit)
      from  6f4db457f8300d9d58fe5f931cdf9f54c0fde2a2 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=8e95c99a7a0b0ca8cf9bfbeddf1e43fb3efc1bee

commit 8e95c99a7a0b0ca8cf9bfbeddf1e43fb3efc1bee
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Wed Mar 21 14:38:47 2012 -0700

    Add _ITOA_NEEDED and _ITOA_WORD_TYPE
    
    Add _ITOA_NEEDED and _ITOA_WORD_TYPE to override _itoa and _itowa.

diff --git a/ChangeLog b/ChangeLog
index 5b3567a..67e4ecc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,20 @@
+2012-03-21  H.J. Lu  <hongjiu.lu@intel.com>
+
+	* stdio-common/_itoa.c: Check _ITOA_NEEDED instead of
+	LLONG_MAX != LONG_MAX.
+	(_itoa_word): Use _ITOA_WORD_TYPE on value.
+	(_fitoa_word): Likewise.
+	* stdio-common/_itowa.c: Check _ITOA_NEEDED instead of
+	LLONG_MAX != LONG_MAX.
+	* stdio-common/_itowa.h: Include <_itoa.h>.
+	(_itowa_word): Use _ITOA_WORD_TYPE on value.
+	(_itowa): New macro.  Defined only if _ITOA_NEEDED is false.
+	* sysdeps/generic/_itoa.h (_ITOA_NEEDED): New macro.  Defined
+	only if not defined.
+	(_ITOA_WORD_TYPE): Likewise.
+	(_itoa_word): Use _ITOA_WORD_TYPE on value.
+	Check !_ITOA_NEEDED instead of LONG_MAX == LLONG_MAX.
+
 2012-03-21  David S. Miller  <davem@davemloft.net>
 
 	* sysdeps/sparc/fpu/libm-test-ulps: Update.
diff --git a/stdio-common/_itowa.c b/stdio-common/_itowa.c
index 1ebc712..9381d33 100644
--- a/stdio-common/_itowa.c
+++ b/stdio-common/_itowa.c
@@ -85,7 +85,7 @@ extern const wchar_t _itowa_lower_digits[] attribute_hidden;
 extern const wchar_t _itowa_upper_digits[] attribute_hidden;
 
 
-#if LLONG_MAX != LONG_MAX
+#if _ITOA_NEEDED
 wchar_t *
 _itowa (value, buflim, base, upper_case)
      unsigned long long int value;
diff --git a/stdio-common/_itowa.h b/stdio-common/_itowa.h
index 0f33311..aa34957 100644
--- a/stdio-common/_itowa.h
+++ b/stdio-common/_itowa.h
@@ -20,6 +20,7 @@
 #define _ITOWA_H	1
 #include <features.h>
 #include <wchar.h>
+#include <_itoa.h>
 
 /* Convert VALUE into ASCII in base BASE (2..36).
    Write backwards starting the character just before BUFLIM.
@@ -31,7 +32,7 @@ extern wchar_t *_itowa (unsigned long long int value, wchar_t *buflim,
 
 static inline wchar_t *
 __attribute__ ((unused, always_inline))
-_itowa_word (unsigned long value, wchar_t *buflim,
+_itowa_word (_ITOA_WORD_TYPE value, wchar_t *buflim,
 	     unsigned int base, int upper_case)
 {
   extern const wchar_t _itowa_upper_digits[] attribute_hidden;
@@ -61,4 +62,10 @@ _itowa_word (unsigned long value, wchar_t *buflim,
 }
 #undef SPECIAL
 
+#if !_ITOA_NEEDED
+/* No need for special long long versions.  */
+# define _itowa(value, buf, base, upper_case) \
+  _itowa_word (value, buf, base, upper_case)
+#endif
+
 #endif	/* itowa.h */
diff --git a/sysdeps/generic/_itoa.h b/sysdeps/generic/_itoa.h
index 8870ee0..0a67043 100644
--- a/sysdeps/generic/_itoa.h
+++ b/sysdeps/generic/_itoa.h
@@ -21,6 +21,21 @@
 
 #include <limits.h>
 
+/* When long long is different from long, by default, _itoa_word is
+   provided to convert long to ASCII and _itoa is provided to convert
+   long long.  A sysdeps _itoa.h can define _ITOA_NEEDED to 0 and define
+   _ITOA_WORD_TYPE to unsigned long long int to override it so that
+   _itoa_word is changed to convert long long to ASCII and _itoa is
+   mapped to _itoa_word.  */
+
+#ifndef _ITOA_NEEDED
+# define _ITOA_NEEDED		(LONG_MAX != LLONG_MAX)
+#endif
+#ifndef _ITOA_WORD_TYPE
+# define _ITOA_WORD_TYPE	unsigned long int
+#endif
+
+
 /* Convert VALUE into ASCII in base BASE (2..36).
    Write backwards starting the character just before BUFLIM.
    Return the address of the first (left-to-right) character in the number.
@@ -35,11 +50,11 @@ extern const char _itoa_lower_digits[];
 extern const char _itoa_lower_digits_internal[] attribute_hidden;
 
 #ifndef NOT_IN_libc
-extern char *_itoa_word (unsigned long value, char *buflim,
+extern char *_itoa_word (_ITOA_WORD_TYPE value, char *buflim,
 			 unsigned int base, int upper_case);
 #else
 static inline char * __attribute__ ((unused, always_inline))
-_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
@@ -76,12 +91,13 @@ _itoa_word (unsigned long value, char *buflim,
 
 /* Similar to the _itoa functions, but output starts at buf and pointer
    after the last written character is returned.  */
-extern char *_fitoa_word (unsigned long value, char *buf, unsigned int base,
+extern char *_fitoa_word (_ITOA_WORD_TYPE value, char *buf,
+			  unsigned int base,
 			  int upper_case) attribute_hidden;
 extern char *_fitoa (unsigned long long value, char *buf, unsigned int base,
 		     int upper_case) attribute_hidden;
 
-#if LONG_MAX == LLONG_MAX
+#if !_ITOA_NEEDED
 /* No need for special long long versions.  */
 # define _itoa(value, buf, base, upper_case) \
   _itoa_word (value, buf, base, upper_case)

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog               |   17 +++++++++++++++++
 stdio-common/_itowa.c   |    2 +-
 stdio-common/_itowa.h   |    9 ++++++++-
 sysdeps/generic/_itoa.h |   24 ++++++++++++++++++++----
 4 files changed, 46 insertions(+), 6 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]