aboutsummaryrefslogtreecommitdiff
path: root/stdio-common/vfprintf.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1999-05-25 18:37:11 +0000
committerUlrich Drepper <drepper@redhat.com>1999-05-25 18:37:11 +0000
commit859a09cff1dc7d626a13e242d035107e7b6d13f8 (patch)
tree47d1409798eeadbd5a9a215ee851254fcfcc9ab3 /stdio-common/vfprintf.c
parent40cbb1a73b1010ac37710742e42d14fd6108dc07 (diff)
downloadglibc-859a09cff1dc7d626a13e242d035107e7b6d13f8.tar
glibc-859a09cff1dc7d626a13e242d035107e7b6d13f8.tar.gz
glibc-859a09cff1dc7d626a13e242d035107e7b6d13f8.tar.bz2
glibc-859a09cff1dc7d626a13e242d035107e7b6d13f8.zip
Update.
1999-05-26 Jakub Jelinek <jj@ultra.linux.cz> * stdlib/longlong.h (add_ssaaaa, sub_ddmmss, umul_ppmm): Optimized sparc64 routines. * stdio-common/vfprintf.c (vfprintf): Don't handle long numbers if they are the same as ints. * stdio-common/vfscanf.c (_IO_vfscanf): Likewise.
Diffstat (limited to 'stdio-common/vfprintf.c')
-rw-r--r--stdio-common/vfprintf.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/stdio-common/vfprintf.c b/stdio-common/vfprintf.c
index dfaf4191c7..e544c6518c 100644
--- a/stdio-common/vfprintf.c
+++ b/stdio-common/vfprintf.c
@@ -189,6 +189,14 @@ extern void __funlockfile (FILE *);
# define is_longlong is_long_double
#endif
+/* If `long' and `int' is effectively the same type we don't have to
+ handle `long separately. */
+#if INT_MAX == LONG_MAX
+# define is_long_num 0
+#else
+# define is_long_num is_long
+#endif
+
/* Global variables. */
static const char null[] = "(null)";
@@ -524,13 +532,13 @@ vfprintf (FILE *s, const CHAR_T *format, va_list ap)
\
if (fspec == NULL) \
{ \
- if (is_long) \
+ if (is_long_num) \
signed_number = va_arg (ap, long int); \
else /* `char' and `short int' will be promoted to `int'. */ \
signed_number = va_arg (ap, int); \
} \
else \
- if (is_long) \
+ if (is_long_num) \
signed_number = args_value[fspec->data_arg].pa_long_int; \
else \
signed_number = args_value[fspec->data_arg].pa_int; \
@@ -608,7 +616,7 @@ vfprintf (FILE *s, const CHAR_T *format, va_list ap)
{ \
if (fspec == NULL) \
{ \
- if (is_long) \
+ if (is_long_num) \
number.word = va_arg (ap, unsigned long int); \
else if (!is_short) \
number.word = va_arg (ap, unsigned int); \
@@ -616,7 +624,7 @@ vfprintf (FILE *s, const CHAR_T *format, va_list ap)
number.word = (unsigned short int) va_arg (ap, unsigned int); \
} \
else \
- if (is_long) \
+ if (is_long_num) \
number.word = args_value[fspec->data_arg].pa_u_long_int; \
else if (is_char) \
number.word = (unsigned char) \
@@ -987,7 +995,7 @@ vfprintf (FILE *s, const CHAR_T *format, va_list ap)
{ \
if (is_longlong) \
*(long long int *) va_arg (ap, void *) = done; \
- else if (is_long) \
+ else if (is_long_num) \
*(long int *) va_arg (ap, void *) = done; \
else if (!is_short) \
*(int *) va_arg (ap, void *) = done; \
@@ -997,7 +1005,7 @@ vfprintf (FILE *s, const CHAR_T *format, va_list ap)
else \
if (is_longlong) \
*(long long int *) args_value[fspec->data_arg].pa_pointer = done; \
- else if (is_long) \
+ else if (is_long_num) \
*(long int *) args_value[fspec->data_arg].pa_pointer = done; \
else if (!is_short) \
*(int *) args_value[fspec->data_arg].pa_pointer = done; \