* doublest.h (DOUBLEST_PRINT_FORMAT): Remove % from string.
authorThiago Jung Bauermann <bauerman@br.ibm.com>
Wed, 9 Jan 2008 19:27:15 +0000 (19:27 +0000)
committerThiago Jung Bauermann <bauerman@br.ibm.com>
Wed, 9 Jan 2008 19:27:15 +0000 (19:27 +0000)
(DOUBLEST_SCAN_FORMAT): Likewise.
* dfp.c (decimal_from_floating): Use DOUBLEST_PRINT_FORMAT.
* ada-lex.l (processReal): Prepend "%" to use of DOUBLEST_SCAN_FORMAT.
* c-exp.y (parse_number): Likewise.
* jv-exp.y (parse_number): Likewise.
* objc-exp.y (parse_number): Likewise.
* p-exp.y (parse_number): Likewise.

gdb/ChangeLog
gdb/ada-lex.l
gdb/c-exp.y
gdb/dfp.c
gdb/doublest.h
gdb/jv-exp.y
gdb/objc-exp.y
gdb/p-exp.y

index 8caa93a512498d95e6b282607b3b0450db131e32..efac94ec90366dd47a926081c755702b503ee546 100644 (file)
@@ -1,3 +1,14 @@
+2008-01-09  Thiago Jung Bauermann  <bauerman@br.ibm.com>
+
+       * doublest.h (DOUBLEST_PRINT_FORMAT): Remove % from string.
+       (DOUBLEST_SCAN_FORMAT): Likewise.
+       * dfp.c (decimal_from_floating): Use DOUBLEST_PRINT_FORMAT.
+       * ada-lex.l (processReal): Prepend "%" to use of DOUBLEST_SCAN_FORMAT.
+       * c-exp.y (parse_number): Likewise.
+       * jv-exp.y (parse_number): Likewise.
+       * objc-exp.y (parse_number): Likewise.
+       * p-exp.y (parse_number): Likewise.
+
 2008-01-09  Joel Brobecker  <brobecker@adacore.com>
 
        * gdbtypes.c (create_array_type): Add handling of null Ada arrays.
index 6be64ab13ca313de9726e37a61f7b8a0ab963f46..cd6de8cadcf3547afcedbf0ca79d8fdf7fc6e68f 100644 (file)
@@ -373,7 +373,7 @@ processInt (const char *base0, const char *num0, const char *exp0)
 static int
 processReal (const char *num0)
 {
-  sscanf (num0, DOUBLEST_SCAN_FORMAT, &yylval.typed_val_float.dval);
+  sscanf (num0, "%" DOUBLEST_SCAN_FORMAT, &yylval.typed_val_float.dval);
 
   yylval.typed_val_float.type = type_float ();
   if (sizeof(DOUBLEST) >= gdbarch_double_bit (current_gdbarch)
index 22bb4c63acd871544799e41e4d675cd6e4e19b7c..b5207212f7d2e2ff582632deb37568bcd5ec52d2 100644 (file)
@@ -1125,7 +1125,7 @@ parse_number (p, len, parsed_float, putithere)
          return (DECFLOAT);
        }
 
-      num = sscanf (p, DOUBLEST_SCAN_FORMAT "%s",
+      num = sscanf (p, "%" DOUBLEST_SCAN_FORMAT "%s",
                    &putithere->typed_val_float.dval, s);
       p[len] = saved_char;     /* restore the input stream */
 
index bf82114634b8d91f5f8a72fe3c6b92323a815fb5..e184ecdd346774bcd69d8a245bfb0f9264aa84d9 100644 (file)
--- a/gdb/dfp.c
+++ b/gdb/dfp.c
@@ -237,7 +237,8 @@ decimal_from_floating (struct value *from, gdb_byte *to, int len)
   char *buffer;
   int ret;
 
-  ret = asprintf (&buffer, "%.30Lg", value_as_double (from));
+  ret = asprintf (&buffer, "%.30" DOUBLEST_PRINT_FORMAT,
+                 value_as_double (from));
   if (ret < 0)
     error (_("Error in memory allocation for conversion to decimal float."));
 
index f3ab619af7db4b39783ba9a5261e992210828465..247eb5d2bceae678c848d552681f036fc238108f 100644 (file)
@@ -49,12 +49,12 @@ struct floatformat;
 #if (defined HAVE_LONG_DOUBLE && defined PRINTF_HAS_LONG_DOUBLE \
      && defined SCANF_HAS_LONG_DOUBLE)
 typedef long double DOUBLEST;
-# define DOUBLEST_PRINT_FORMAT "%Lg"
-# define DOUBLEST_SCAN_FORMAT "%Lg"
+# define DOUBLEST_PRINT_FORMAT "Lg"
+# define DOUBLEST_SCAN_FORMAT "Lg"
 #else
 typedef double DOUBLEST;
-# define DOUBLEST_PRINT_FORMAT "%g"
-# define DOUBLEST_SCAN_FORMAT "%lg"
+# define DOUBLEST_PRINT_FORMAT "g"
+# define DOUBLEST_SCAN_FORMAT "lg"
 /* If we can't scan or print long double, we don't want to use it
    anywhere.  */
 # undef HAVE_LONG_DOUBLE
index 1db33a6f0c3cfd17da2e62ee1ea94f542a0f9ef0..14a7bf852d529b37441bbad66163ba62ad102512 100644 (file)
@@ -713,7 +713,7 @@ parse_number (p, len, parsed_float, putithere)
       char saved_char = p[len];
 
       p[len] = 0;      /* null-terminate the token */
-      num = sscanf (p, DOUBLEST_SCAN_FORMAT "%c",
+      num = sscanf (p, "%" DOUBLEST_SCAN_FORMAT "%c",
                    &putithere->typed_val_float.dval, &c);
       p[len] = saved_char;     /* restore the input stream */
       if (num != 1)            /* check scanf found ONLY a float ... */
index d4214417cb87eadff2de179c88107f6c9aa025e3..a4a42d920a5bb9605fad842a8700882e636cb07b 100644 (file)
@@ -1023,7 +1023,7 @@ parse_number (p, len, parsed_float, putithere)
 
       /* It's a float since it contains a point or an exponent.  */
 
-      sscanf (p, DOUBLEST_SCAN_FORMAT "%c",
+      sscanf (p, "%" DOUBLEST_SCAN_FORMAT "%c",
              &putithere->typed_val_float.dval, &c);
 
       /* See if it has `f' or `l' suffix (float or long double).  */
index 857a69f9b39e44cf4354d7aa294c5df99aca056d..9cab7cdb064f90f11489ff413bc9c434668d217a 100644 (file)
@@ -797,7 +797,7 @@ parse_number (p, len, parsed_float, putithere)
       char saved_char = p[len];
 
       p[len] = 0;      /* null-terminate the token */
-      num = sscanf (p, DOUBLEST_SCAN_FORMAT "%c",
+      num = sscanf (p, "%" DOUBLEST_SCAN_FORMAT "%c",
                    &putithere->typed_val_float.dval, &c);
       p[len] = saved_char;     /* restore the input stream */
       if (num != 1)            /* check scanf found ONLY a float ... */
This page took 0.030401 seconds and 4 git commands to generate.