(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 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.
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)
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 */
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."));
#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
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 ... */
/* 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). */
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 ... */