diff options
author | 2016-03-03 02:48:20 +1100 | |
---|---|---|
committer | 2016-03-03 03:53:43 +1100 | |
commit | 42ea68285296b7838fe9a3ce7e5d66061c8f7e21 (patch) | |
tree | e469b8575dcda181066d6cd0f60d5ba2c8e9ae33 /src/lib/util/corestr.cpp | |
parent | d50614c8bd734b2b995c470a96336967be401206 (diff) |
core_i64_hex_format is now a static function in memory.cpp
Diffstat (limited to 'src/lib/util/corestr.cpp')
-rw-r--r-- | src/lib/util/corestr.cpp | 67 |
1 files changed, 0 insertions, 67 deletions
diff --git a/src/lib/util/corestr.cpp b/src/lib/util/corestr.cpp index 2f39bc06ad9..7daad5cc0cb 100644 --- a/src/lib/util/corestr.cpp +++ b/src/lib/util/corestr.cpp @@ -126,73 +126,6 @@ char *core_strdup(const char *str) /*------------------------------------------------- - core_i64_hex_format - i64 format printf helper --------------------------------------------------*/ - -char *core_i64_hex_format(UINT64 value, UINT8 mindigits) -{ - static char buffer[16][64]; - // TODO: this can overflow - e.g. when a lot of unmapped writes are logged - static int index; - char *bufbase = &buffer[index++ % 16][0]; - char *bufptr = bufbase; - INT8 curdigit; - - for (curdigit = 15; curdigit >= 0; curdigit--) - { - int nibble = (value >> (curdigit * 4)) & 0xf; - if (nibble != 0 || curdigit < mindigits) - { - mindigits = curdigit; - *bufptr++ = "0123456789ABCDEF"[nibble]; - } - } - if (bufptr == bufbase) - *bufptr++ = '0'; - *bufptr = 0; - - return bufbase; -} - -/*------------------------------------------------- - core_i64_oct_format - i64 format printf helper --------------------------------------------------*/ - -char *core_i64_oct_format(UINT64 value, UINT8 mindigits) -{ - static char buffer[22][64]; - // TODO: this can overflow - static int index; - char *bufbase = &buffer[index++ % 22][0]; - char *bufptr = bufbase; - INT8 curdigit; - - for (curdigit = 21; curdigit >= 0; curdigit--) - { - int octdigit = (value >> (curdigit * 3)) & 0x7; - if (octdigit != 0 || curdigit < mindigits) - { - mindigits = curdigit; - *bufptr++ = "01234567"[octdigit]; - } - } - if (bufptr == bufbase) - *bufptr++ = '0'; - *bufptr = 0; - - return bufbase; -} - -/*------------------------------------------------- - core_i64_format - i64 format printf helper --------------------------------------------------*/ - -char *core_i64_format(UINT64 value, UINT8 mindigits, bool is_octal) -{ - return is_octal ? core_i64_oct_format(value,mindigits) : core_i64_hex_format(value,mindigits); -} - -/*------------------------------------------------- std::string helpers -------------------------------------------------*/ |