Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 2827 → Rev 3065

/programs/develop/libraries/newlib/stdlib/atol.c
0,0 → 1,21
/*
* Andy Wilson, 2-Oct-89.
*/
 
#include <stdlib.h>
#include <_ansi.h>
 
#ifndef _REENT_ONLY
long
_DEFUN (atol, (s), _CONST char *s)
{
return strtol (s, NULL, 10);
}
#endif /* !_REENT_ONLY */
 
long
_DEFUN (_atol_r, (ptr, s), struct _reent *ptr _AND _CONST char *s)
{
return _strtol_r (ptr, s, NULL, 10);
}
 
/programs/develop/libraries/newlib/stdlib/strtod.c
299,15 → 299,17
}
s0 = s;
y = z = 0;
for(nd = nf = 0; (c = *s) >= '0' && c <= '9'; nd++, s++)
for(nd = nf = 0; (c = *s) >= '0' && c <= '9'; nd++, s++) {
if (nd < DBL_DIG + 1) {
if (nd < 9)
y = 10*y + c - '0';
else if (nd < 16)
else
z = 10*z + c - '0';
}
}
nd0 = nd;
if (strncmp (s, _localeconv_r (ptr)->decimal_point,
strlen (_localeconv_r (ptr)->decimal_point)) == 0)
{
strlen (_localeconv_r (ptr)->decimal_point)) == 0) {
decpt = 1;
c = *(s += strlen (_localeconv_r (ptr)->decimal_point));
if (!nd) {
325,16 → 327,24
have_dig:
nz++;
if (c -= '0') {
nf += nz;
for(i = 1; i < nz; i++)
if (nd++ < 9)
for(i = 1; i < nz; i++) {
if (nd <= DBL_DIG + 1) {
if (nd + i < 10)
y *= 10;
else if (nd <= DBL_DIG + 1)
else
z *= 10;
if (nd++ < 9)
}
}
if (nd <= DBL_DIG + 1) {
if (nd + i < 10)
y = 10*y + c;
else if (nd <= DBL_DIG + 1)
else
z = 10*z + c;
}
if (nd <= DBL_DIG + 1) {
nf += nz;
nd += nz;
}
nz = 0;
}
}