diff options
author | dlenev@brandersnatch.localdomain <> | 2004-05-27 17:54:40 +0400 |
---|---|---|
committer | dlenev@brandersnatch.localdomain <> | 2004-05-27 17:54:40 +0400 |
commit | 03b705ff4408f011eebdadffeb249e9ef533c3ea (patch) | |
tree | 0a3ac45d591f6d81591a9b4ec19f2d45e2c29570 /strings/longlong2str.c | |
parent | fc85c80b88c0717684184f22a91f8b027a8f8559 (diff) | |
download | mariadb-git-03b705ff4408f011eebdadffeb249e9ef533c3ea.tar.gz |
Made my_snprintf() behavior snprintf() compatible when printing %x arguments (it should
produce hex digits in lower case). (fixed version)
Replaced _dig_vec array with two _dig_vec_upper/_dig_vec_lower arrays.
Added extra argument to int2str function which controls case of digits you get.
Replaced lot of invocations of int2str for decimal radix with more optimized int10_to_str()
function.
Removed unused my_itoa/my_ltoa functions.
Diffstat (limited to 'strings/longlong2str.c')
-rw-r--r-- | strings/longlong2str.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/strings/longlong2str.c b/strings/longlong2str.c index a991c57b4d9..096531095db 100644 --- a/strings/longlong2str.c +++ b/strings/longlong2str.c @@ -43,8 +43,6 @@ #if defined(HAVE_LONG_LONG) && !defined(longlong2str) && !defined(HAVE_LONGLONG2STR) -extern char NEAR _dig_vec[]; - /* This assumes that longlong multiplication is faster than longlong division. */ @@ -81,14 +79,14 @@ char *longlong2str(longlong val,char *dst,int radix) { ulonglong quo=(ulonglong) val/(uint) radix; uint rem= (uint) (val- quo* (uint) radix); - *--p = _dig_vec[rem]; + *--p = _dig_vec_upper[rem]; val= quo; } long_val= (long) val; while (long_val != 0) { long quo= long_val/radix; - *--p = _dig_vec[(uchar) (long_val - quo*radix)]; + *--p = _dig_vec_upper[(uchar) (long_val - quo*radix)]; long_val= quo; } while ((*dst++ = *p++) != 0) ; @@ -126,14 +124,14 @@ char *longlong10_to_str(longlong val,char *dst,int radix) { ulonglong quo=(ulonglong) val/(uint) 10; uint rem= (uint) (val- quo* (uint) 10); - *--p = _dig_vec[rem]; + *--p = _dig_vec_upper[rem]; val= quo; } long_val= (long) val; while (long_val != 0) { long quo= long_val/10; - *--p = _dig_vec[(uchar) (long_val - quo*10)]; + *--p = _dig_vec_upper[(uchar) (long_val - quo*10)]; long_val= quo; } while ((*dst++ = *p++) != 0) ; |