diff options
author | Adam Borowski <kilobyte@angband.pl> | 2011-05-01 19:16:02 +0200 |
---|---|---|
committer | Adam Borowski <kilobyte@angband.pl> | 2011-05-01 20:15:13 +0200 |
commit | f5be6fcaf885a59092cff4828fe8fe8f661fed28 (patch) | |
tree | 23b514e65faac089e0a013d1ed822676d4a62230 /crawl-ref/source/libunix.cc | |
parent | b413922f74dbf2f5dbaae38f8c6f184529c008eb (diff) | |
download | crawl-ref-f5be6fcaf885a59092cff4828fe8fe8f661fed28.tar.gz crawl-ref-f5be6fcaf885a59092cff4828fe8fe8f661fed28.zip |
Get rid of itoa().
Even worse, it had two redundant implementations.
Diffstat (limited to 'crawl-ref/source/libunix.cc')
-rw-r--r-- | crawl-ref/source/libunix.cc | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/crawl-ref/source/libunix.cc b/crawl-ref/source/libunix.cc index 90a172ffe3..2e440d3dd5 100644 --- a/crawl-ref/source/libunix.cc +++ b/crawl-ref/source/libunix.cc @@ -441,46 +441,6 @@ void unixcurses_shutdown() #endif } - -/* Convert value to string */ -extern "C" char *itoa(int value, char *strptr, int radix) -{ - unsigned int bitmask = 32768; - int ctr = 0; - int startflag = 0; - - if (radix == 10) - { - sprintf(strptr, "%i", value); - } - if (radix == 2) /* int to "binary string" */ - { - while (bitmask) - { - if (value & bitmask) - { - startflag = 1; - sprintf(strptr + ctr, "1"); - } - else - { - if (startflag) - sprintf(strptr + ctr, "0"); - } - - bitmask = bitmask >> 1; - if (startflag) - ctr++; - } - - if (!startflag) /* Special case if value == 0 */ - sprintf((strptr + ctr++), "0"); - - strptr[ctr] = (char) NULL; - } - return strptr; -} - void cprintf(const char *format, ...) { char buffer[2048]; // One full screen if no control seq... |