diff options
author | hpa <hpa> | 2003-12-10 20:44:57 +0000 |
---|---|---|
committer | hpa <hpa> | 2003-12-10 20:44:57 +0000 |
commit | 36166b159309632a2f5485f5312952e2c97bcc63 (patch) | |
tree | ce87f82ec36999c895c7bd654909b5ef9873b05e /sample | |
parent | 614094b18a80ba39557beda64c7b732779d0b5fb (diff) | |
download | syslinux-36166b159309632a2f5485f5312952e2c97bcc63.tar.gz |
Split atou() and skip_atou() into separate modules
Diffstat (limited to 'sample')
-rw-r--r-- | sample/Makefile | 2 | ||||
-rw-r--r-- | sample/atou.c | 9 | ||||
-rw-r--r-- | sample/skipatou.c | 14 |
3 files changed, 15 insertions, 10 deletions
diff --git a/sample/Makefile b/sample/Makefile index fcb8f4c7..8964c004 100644 --- a/sample/Makefile +++ b/sample/Makefile @@ -27,7 +27,7 @@ OBJCOPY = objcopy PPMTOLSS16 = ../ppmtolss16 LIB = libcom32.a -LIBOBJS = conio.o atou.o printf.o +LIBOBJS = conio.o atou.o skipatou.o printf.o .SUFFIXES: .lss .c .o .elf .c32 diff --git a/sample/atou.c b/sample/atou.c index 0ea1bfe4..36585990 100644 --- a/sample/atou.c +++ b/sample/atou.c @@ -4,15 +4,6 @@ isdigit(int ch) return (ch >= '0') && (ch <= '9'); } -unsigned int skip_atou(const char **s) -{ - int i=0; - - while (isdigit(**s)) - i = i*10 + *((*s)++) - '0'; - return i; -} - unsigned int atou(const char *s) { unsigned int i = 0; diff --git a/sample/skipatou.c b/sample/skipatou.c new file mode 100644 index 00000000..98881539 --- /dev/null +++ b/sample/skipatou.c @@ -0,0 +1,14 @@ +static inline int +isdigit(int ch) +{ + return (ch >= '0') && (ch <= '9'); +} + +unsigned int skip_atou(const char **s) +{ + int i=0; + + while (isdigit(**s)) + i = i*10 + *((*s)++) - '0'; + return i; +} |