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 | 96c1eda247c7846f4bbd32d65db6819baefad08b (patch) | |
tree | 9bc74063c6c31a5947f17bf6da9c2b5c54d76434 /gdb/objc-exp.y | |
parent | 92dd43fa3bc92e0a97408eaa406143c41460581c (diff) | |
download | binutils-96c1eda247c7846f4bbd32d65db6819baefad08b.zip binutils-96c1eda247c7846f4bbd32d65db6819baefad08b.tar.gz binutils-96c1eda247c7846f4bbd32d65db6819baefad08b.tar.bz2 |
* 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/objc-exp.y')
-rw-r--r-- | gdb/objc-exp.y | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/gdb/objc-exp.y b/gdb/objc-exp.y index 93ccea3..f150313 100644 --- a/gdb/objc-exp.y +++ b/gdb/objc-exp.y @@ -1025,23 +1025,8 @@ parse_number (p, len, parsed_float, putithere) /* It's a float since it contains a point or an exponent. */ - if (sizeof (putithere->typed_val_float.dval) <= sizeof (float)) - sscanf (p, "%g", (float *)&putithere->typed_val_float.dval); - else if (sizeof (putithere->typed_val_float.dval) <= sizeof (double)) - sscanf (p, "%lg", (double *)&putithere->typed_val_float.dval); - else - { -#ifdef PRINTF_HAS_LONG_DOUBLE - sscanf (p, "%Lg", &putithere->typed_val_float.dval); -#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; - sscanf (p, "%lg", &temp); - putithere->typed_val_float.dval = temp; -#endif - } + sscanf (p, DOUBLEST_FORMAT "%c", + &putithere->typed_val_float.dval, &c); /* See if it has `f' or `l' suffix (float or long double). */ |