|
|
1.1 ! root 1: atoi(p) ! 2: register char *p; ! 3: { ! 4: register int n; ! 5: register int f; ! 6: ! 7: n = 0; ! 8: f = 0; ! 9: for(;;p++) { ! 10: switch(*p) { ! 11: case ' ': ! 12: case '\t': ! 13: continue; ! 14: case '-': ! 15: f++; ! 16: case '+': ! 17: p++; ! 18: } ! 19: break; ! 20: } ! 21: while(*p >= '0' && *p <= '9') ! 22: n = n*10 + *p++ - '0'; ! 23: return(f? -n: n); ! 24: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.