2003-11-21 Jeff Johnston <jjohnstn@redhat.com>
* libc/stdio/vfscanf.c (__svfscanf_r)[!_NO_LONGDBL]: Don't use _strtold routine for processing floats and doubles since it is not as fast as _strtod_r.
This commit is contained in:
parent
4bd6628553
commit
4f6149d6f0
|
@ -1,3 +1,9 @@
|
||||||
|
2003-11-21 Jeff Johnston <jjohnstn@redhat.com>
|
||||||
|
|
||||||
|
* libc/stdio/vfscanf.c (__svfscanf_r)[!_NO_LONGDBL]: Don't use
|
||||||
|
_strtold routine for processing floats and doubles since it
|
||||||
|
is not as fast as _strtod_r.
|
||||||
|
|
||||||
2003-11-20 Dhananjay Deshpande <dhananjayd@kpitcummins.com>
|
2003-11-20 Dhananjay Deshpande <dhananjayd@kpitcummins.com>
|
||||||
|
|
||||||
* libc/machine/h8300/defines.h : Correct pointer register defines
|
* libc/machine/h8300/defines.h : Correct pointer register defines
|
||||||
|
|
|
@ -998,10 +998,12 @@ __svfscanf_r (rptr, fp, fmt0, ap)
|
||||||
}
|
}
|
||||||
if ((flags & SUPPRESS) == 0)
|
if ((flags & SUPPRESS) == 0)
|
||||||
{
|
{
|
||||||
#ifdef _NO_LONGDBL
|
|
||||||
double res;
|
double res;
|
||||||
|
#ifdef _NO_LONGDBL
|
||||||
|
#define QUAD_RES res;
|
||||||
#else /* !_NO_LONG_DBL */
|
#else /* !_NO_LONG_DBL */
|
||||||
long double res;
|
long double qres;
|
||||||
|
#define QUAD_RES qres;
|
||||||
#endif /* !_NO_LONG_DBL */
|
#endif /* !_NO_LONG_DBL */
|
||||||
long new_exp = 0;
|
long new_exp = 0;
|
||||||
|
|
||||||
|
@ -1023,11 +1025,17 @@ __svfscanf_r (rptr, fp, fmt0, ap)
|
||||||
exp_start = buf + sizeof (buf) - MAX_LONG_LEN - 1;
|
exp_start = buf + sizeof (buf) - MAX_LONG_LEN - 1;
|
||||||
sprintf (exp_start, "e%ld", new_exp);
|
sprintf (exp_start, "e%ld", new_exp);
|
||||||
}
|
}
|
||||||
#ifdef _NO_LONGDBL
|
|
||||||
res = _strtod_r (rptr, buf, NULL);
|
/* Current _strtold routine is markedly slower than
|
||||||
#else /* !_NO_LONGDBL */
|
_strtod_r. Only use it if we have a long double
|
||||||
res = _strtold (buf, NULL);
|
result. */
|
||||||
#endif /* !_NO_LONGDBL */
|
#ifndef _NO_LONGDBL /* !_NO_LONGDBL */
|
||||||
|
if (flags & LONGDBL)
|
||||||
|
qres = _strtold (buf, NULL);
|
||||||
|
else
|
||||||
|
#endif
|
||||||
|
res = _strtod_r (rptr, buf, NULL);
|
||||||
|
|
||||||
if (flags & LONG)
|
if (flags & LONG)
|
||||||
{
|
{
|
||||||
dp = va_arg (ap, double *);
|
dp = va_arg (ap, double *);
|
||||||
|
@ -1036,7 +1044,7 @@ __svfscanf_r (rptr, fp, fmt0, ap)
|
||||||
else if (flags & LONGDBL)
|
else if (flags & LONGDBL)
|
||||||
{
|
{
|
||||||
ldp = va_arg (ap, _LONG_DOUBLE *);
|
ldp = va_arg (ap, _LONG_DOUBLE *);
|
||||||
*ldp = res;
|
*ldp = QUAD_RES;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue