replaced atol definition
This commit is contained in:
parent
952bd37627
commit
5ccd830347
|
@ -82,9 +82,31 @@ int regallowed=0;
|
|||
|
||||
extern char em_flag[];
|
||||
extern short em_ptyp[];
|
||||
extern long atol();
|
||||
extern double atof();
|
||||
|
||||
/* Own version of atol that continues computing on overflow.
|
||||
We don't know that about the ANSI C one.
|
||||
*/
|
||||
long atol(s)
|
||||
register char *s;
|
||||
{
|
||||
register long total = 0;
|
||||
register unsigned digit;
|
||||
int minus = 0;
|
||||
|
||||
while (*s == ' ' || *s == '\t') s++;
|
||||
if (*s == '+') s++;
|
||||
else if (*s == '-') {
|
||||
s++;
|
||||
minus = 1;
|
||||
}
|
||||
while ((digit = *s++ - '0') < 10) {
|
||||
total *= 10;
|
||||
total += digit;
|
||||
}
|
||||
return(minus ? -total : total);
|
||||
}
|
||||
|
||||
#define sp_cstx sp_cst2
|
||||
|
||||
string tostring();
|
||||
|
|
|
@ -80,9 +80,32 @@ int regallowed=0;
|
|||
|
||||
extern char em_flag[];
|
||||
extern short em_ptyp[];
|
||||
extern long atol();
|
||||
extern double atof();
|
||||
|
||||
/* Own version of atol that continues computing on overflow.
|
||||
We don't know that about the ANSI C one.
|
||||
*/
|
||||
long atol(s)
|
||||
register char *s;
|
||||
{
|
||||
register long total = 0;
|
||||
register unsigned digit;
|
||||
int minus = 0;
|
||||
|
||||
while (*s == ' ' || *s == '\t') s++;
|
||||
if (*s == '+') s++;
|
||||
else if (*s == '-') {
|
||||
s++;
|
||||
minus = 1;
|
||||
}
|
||||
while ((digit = *s++ - '0') < 10) {
|
||||
total *= 10;
|
||||
total += digit;
|
||||
}
|
||||
return(minus ? -total : total);
|
||||
}
|
||||
|
||||
|
||||
#define sp_cstx sp_cst2
|
||||
|
||||
string tostring();
|
||||
|
|
Loading…
Reference in a new issue