1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-07 00:04:31 +03:00

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.
This commit is contained in:
dlenev@brandersnatch.localdomain
2004-05-27 17:54:40 +04:00
parent fc85c80b88
commit 03b705ff44
20 changed files with 98 additions and 111 deletions

View File

@@ -1872,7 +1872,7 @@ com_go(String *buffer,char *line __attribute__((unused)))
{
*pos++= ',';
*pos++= ' ';
pos=int2str(warnings, pos, 10);
pos=int10_to_str(warnings, pos, 10);
pos=strmov(pos, " warning");
if (warnings != 1)
*pos++= 's';
@@ -3090,21 +3090,21 @@ static void nice_time(double sec,char *buff,bool part_second)
{
tmp=(ulong) floor(sec/(3600.0*24));
sec-=3600.0*24*tmp;
buff=int2str((long) tmp,buff,10);
buff=int10_to_str((long) tmp, buff, 10);
buff=strmov(buff,tmp > 1 ? " days " : " day ");
}
if (sec >= 3600.0)
{
tmp=(ulong) floor(sec/3600.0);
sec-=3600.0*tmp;
buff=int2str((long) tmp,buff,10);
buff=int10_to_str((long) tmp, buff, 10);
buff=strmov(buff,tmp > 1 ? " hours " : " hour ");
}
if (sec >= 60.0)
{
tmp=(ulong) floor(sec/60.0);
sec-=60.0*tmp;
buff=int2str((long) tmp,buff,10);
buff=int10_to_str((long) tmp, buff, 10);
buff=strmov(buff," min ");
}
if (part_second)