diff options
author | Alexandre Oliva <aoliva@redhat.com> | 2006-02-14 18:45:14 +0000 |
---|---|---|
committer | Alexandre Oliva <aoliva@redhat.com> | 2006-02-14 18:45:14 +0000 |
commit | a37c9caee8309853750295de513544d8298ccbc3 (patch) | |
tree | 174e0505fa3193f6f1d7c0dcb27cf325701c417d /gdb/jv-exp.y | |
parent | f420e9d42b00cb209e6ca3e9f4b13379451490a3 (diff) | |
download | gdb-a37c9caee8309853750295de513544d8298ccbc3.tar.gz |
* doublest.h (DOUBLEST): Use long double only if we can scan
it in. Undefine HAVE_LONG_DOUBLE otherwise.
(DOUBLEST_FORMAT): New.
* c-exp.y (parse_number): Use it.
* jv-exp.y (parse_number): Likewise.
* objc-exp.y (parse_number): Likewise.
* p-exp.y (parse_number): Likewise.
* varobj.c (free_variable): Silence type-punning warnings.
* tui/tui-data.h (struct tui_list): Change type of list member.
* tui/tui-data.c: Remove no-longer-needed type casts.
(source_windows): Silence type-punning warnings.
* tui/tui-stack.c, tui/tui-win.c, tui/tui-winsource.c: Likewise.
Diffstat (limited to 'gdb/jv-exp.y')
-rw-r--r-- | gdb/jv-exp.y | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/gdb/jv-exp.y b/gdb/jv-exp.y index 4f9e77f205b..1ed027c059f 100644 --- a/gdb/jv-exp.y +++ b/gdb/jv-exp.y @@ -713,23 +713,8 @@ parse_number (p, len, parsed_float, putithere) char saved_char = p[len]; p[len] = 0; /* null-terminate the token */ - if (sizeof (putithere->typed_val_float.dval) <= sizeof (float)) - num = sscanf (p, "%g%c", (float *) &putithere->typed_val_float.dval, &c); - else if (sizeof (putithere->typed_val_float.dval) <= sizeof (double)) - num = sscanf (p, "%lg%c", (double *) &putithere->typed_val_float.dval, &c); - else - { -#ifdef SCANF_HAS_LONG_DOUBLE - num = sscanf (p, "%Lg%c", &putithere->typed_val_float.dval, &c); -#else - /* Scan it into a double, then assign it to the long double. - This at least wins with values representable in the range - of doubles. */ - double temp; - num = sscanf (p, "%lg%c", &temp, &c); - putithere->typed_val_float.dval = temp; -#endif - } + num = sscanf (p, DOUBLEST_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 ... */ return ERROR; |