X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=gdb%2Fjv-exp.y;h=1ed027c059f1d8fbe1b57c3f621e593e8852e8bf;hb=96c1eda247c7846f4bbd32d65db6819baefad08b;hp=4f9e77f205b5b1ba45bf619864413e8c60db9c8e;hpb=92dd43fa3bc92e0a97408eaa406143c41460581c;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/jv-exp.y b/gdb/jv-exp.y index 4f9e77f205..1ed027c059 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;