From b35d8c991882f200cdfebf61112a18f6f2ee748a Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Tue, 17 Mar 2015 22:17:00 +0000 Subject: [PATCH] itoa: say goodbye --- Library/include/stdlib.h | 1 - Library/libs/Makefile | 4 ++-- Library/libs/Makefile.6502 | 4 ++-- Library/libs/itoa.c | 22 ---------------------- 4 files changed, 4 insertions(+), 27 deletions(-) delete mode 100644 Library/libs/itoa.c diff --git a/Library/include/stdlib.h b/Library/include/stdlib.h index 0b40a42a..afec743c 100644 --- a/Library/include/stdlib.h +++ b/Library/include/stdlib.h @@ -35,7 +35,6 @@ extern int rand __P((void)); extern void srand __P((uint seed)); extern char *__longtoa __P((unsigned long, char *, int, char, char)); -extern char *itoa __P((int value, char *strP, int radix)); extern char *ultoa __P((unsigned long value, char *strP, int radix)); extern char *ltoa __P((long value, char *strP, int radix)); diff --git a/Library/libs/Makefile b/Library/libs/Makefile index 665ccfdf..dfa8855a 100644 --- a/Library/libs/Makefile +++ b/Library/libs/Makefile @@ -26,10 +26,10 @@ SRC_C += fgetpos.c fgets.c fopen.c fprintf.c fputc.c fputs.c fread.c free.c SRC_C += fsetpos.c ftell.c fwrite.c getcwd.c SRC_C += getenv.c __getgrent.c getgrgid.c getgrnam.c getopt.c SRC_C += getpw.c __getpwent.c getpwnam.c getpwuid.c gets.c gettimeofday.c -SRC_C += gmtime.c gmtime_r.c grent.c index.c isatty.c itoa.c killpg.c +SRC_C += gmtime.c gmtime_r.c grent.c index.c isatty.c killpg.c SRC_C += libintl.c SRC_C += localtim.c localtim_r.c lseek.c lsearch.c lstat.c ltoa.c ltostr.c -SRC_C += malloc.c mkfifo.c nanosleep.c opendir.c pause.c perror.c +SRC_C += malloc.c mkfifo.c mkstemps.c nanosleep.c opendir.c pause.c perror.c SRC_C += popen.c printf.c putenv.c putgetch.c putpwent.c pwent.c qsort.c SRC_C += raise.c rand.c readdir.c readlink.c realloc.c regerror.c SRC_C += regsub.c remove.c rewind.c rindex.c setbuffer.c setenv.c setjmp.c diff --git a/Library/libs/Makefile.6502 b/Library/libs/Makefile.6502 index 34816938..6484e1a8 100644 --- a/Library/libs/Makefile.6502 +++ b/Library/libs/Makefile.6502 @@ -40,10 +40,10 @@ SRC_C += fgetpos.c fgets.c fopen.c fprintf.c fputc.c fputs.c fread.c free.c SRC_C += fsetpos.c ftell.c fwrite.c getcwd.c SRC_C += getenv.c __getgrent.c getgrgid.c getgrnam.c getopt.c SRC_C += getpw.c __getpwent.c getpwnam.c getpwuid.c gets.c gettimeofday.c -SRC_C += gmtime.c gmtime_r.c grent.c index.c isatty.c itoa.c killpg.c +SRC_C += gmtime.c gmtime_r.c grent.c index.c isatty.c killpg.c SRC_C += libintl.c SRC_C += localtim.c localtim_r.c lseek.c lsearch.c lstat.c ltoa.c ltostr.c -SRC_C += malloc.c mkfifo.c nanosleep.c opendir.c pause.c perror.c +SRC_C += malloc.c mkfifo.c mkstemps.c nanosleep.c opendir.c pause.c perror.c SRC_C += popen.c printf.c putenv.c putgetch.c putpwent.c pwent.c qsort.c SRC_C += raise.c rand.c readdir.c readlink.c realloc.c regerror.c SRC_C += regsub.c remove.c rewind.c rindex.c setbuffer.c setenv.c setjmp.c diff --git a/Library/libs/itoa.c b/Library/libs/itoa.c deleted file mode 100644 index f4aa1d98..00000000 --- a/Library/libs/itoa.c +++ /dev/null @@ -1,22 +0,0 @@ -/* itoa.c */ -#define __MAX_INT_CHARS 7 - -char *itoa(int i) -{ - static char a[__MAX_INT_CHARS]; - char *b = a + sizeof(a) - 1; - int sign = (i < 0); - - if (sign) - i = -i; - *b = 0; - do - { - *--b = '0' + (i % 10); - i /= 10; - } - while (i); - if (sign) - *--b = '-'; - return b; -} -- 2.34.1