about summary refs log tree commit diff
path: root/stdio-common/printf-parse.h
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1999-06-15 22:10:18 +0000
committerUlrich Drepper <drepper@redhat.com>1999-06-15 22:10:18 +0000
commitff4b126a183a0a50aaa3ac1d9a323ae9d1f07292 (patch)
treed746923d90865c4077259136305b8e5f9e4da4cf /stdio-common/printf-parse.h
parentabe71ca6476048a89780b5ad7c963ac11e89b358 (diff)
downloadglibc-ff4b126a183a0a50aaa3ac1d9a323ae9d1f07292.tar.gz
glibc-ff4b126a183a0a50aaa3ac1d9a323ae9d1f07292.tar.xz
glibc-ff4b126a183a0a50aaa3ac1d9a323ae9d1f07292.zip
Update.
1999-06-15  Ulrich Drepper  <drepper@cygnus.com>

	* stdio-common/printf-parse.h (parse_one_spec): Don't set
	is_longlong is not necessary.
Diffstat (limited to 'stdio-common/printf-parse.h')
-rw-r--r--stdio-common/printf-parse.h35
1 files changed, 22 insertions, 13 deletions
diff --git a/stdio-common/printf-parse.h b/stdio-common/printf-parse.h
index 2e6f0dcd99..a915f03f18 100644
--- a/stdio-common/printf-parse.h
+++ b/stdio-common/printf-parse.h
@@ -18,6 +18,7 @@
    Boston, MA 02111-1307, USA.  */
 
 #include <ctype.h>
+#include <limits.h>
 #include <printf.h>
 #include <stdint.h>
 #include <stddef.h>
@@ -265,7 +266,6 @@ parse_one_spec (const UCHAR_T *format, size_t posn, struct printf_spec *spec,
     }
 
   /* Check for type modifiers.  */
-#define is_longlong is_long_double
   spec->info.is_long_double = 0;
   spec->info.is_short = 0;
   spec->info.is_long = 0;
@@ -300,18 +300,24 @@ parse_one_spec (const UCHAR_T *format, size_t posn, struct printf_spec *spec,
     case L_('Z'):
       /* ints are size_ts.  */
       assert (sizeof (size_t) <= sizeof (unsigned long long int));
-      spec->info.is_longlong = sizeof (size_t) > sizeof (unsigned long int);
+#if LONG_MAX != LONG_LONG_MAX
+      spec->info.is_long_double = sizeof (size_t) > sizeof (unsigned long int);
+#endif
       spec->info.is_long = sizeof (size_t) > sizeof (unsigned int);
       break;
     case L_('t'):
       assert (sizeof (ptrdiff_t) <= sizeof (long long int));
-      spec->info.is_longlong = (sizeof (ptrdiff_t) > sizeof (long int));
+#if LONG_MAX != LONG_LONG_MAX
+      spec->info.is_long_double = (sizeof (ptrdiff_t) > sizeof (long int));
+#endif
       spec->info.is_long = sizeof (ptrdiff_t) > sizeof (int);
       break;
     case L_('j'):
       assert (sizeof (uintmax_t) <= sizeof (unsigned long long int));
-      spec->info.is_longlong = (sizeof (uintmax_t)
-				> sizeof (unsigned long int));
+#if LONG_MAX != LONG_LONG_MAX
+      spec->info.is_long_double = (sizeof (uintmax_t)
+				   > sizeof (unsigned long int));
+#endif
       spec->info.is_long = sizeof (uintmax_t) > sizeof (unsigned int);
       break;
     default:
@@ -342,16 +348,19 @@ parse_one_spec (const UCHAR_T *format, size_t posn, struct printf_spec *spec,
 	case L'o':
 	case L'X':
 	case L'x':
-	  if (spec->info.is_longlong)
+#if LONG_MAX != LONG_LONG_MAX
+	  if (spec->info.is_long_double)
 	    spec->data_arg_type = PA_INT|PA_FLAG_LONG_LONG;
-	  else if (spec->info.is_long)
-	    spec->data_arg_type = PA_INT|PA_FLAG_LONG;
-	  else if (spec->info.is_short)
-	    spec->data_arg_type = PA_INT|PA_FLAG_SHORT;
-	  else if (spec->info.is_char)
-	    spec->data_arg_type = PA_CHAR;
 	  else
-	    spec->data_arg_type = PA_INT;
+#endif
+	    if (spec->info.is_long)
+	      spec->data_arg_type = PA_INT|PA_FLAG_LONG;
+	    else if (spec->info.is_short)
+	      spec->data_arg_type = PA_INT|PA_FLAG_SHORT;
+	    else if (spec->info.is_char)
+	      spec->data_arg_type = PA_CHAR;
+	    else
+	      spec->data_arg_type = PA_INT;
 	  break;
 	case L'e':
 	case L'E':