separate function for unsigned to string conversion

Separated unsigned integer conversion to eliminate warnings (and
slightly improve performance). Added Darwin-clang warning suppression
for unused functions/variables
This commit is contained in:
Alex
2012-11-26 19:01:44 -06:00
committed by aleks-f
parent b0ae034a94
commit dd2e677f8a
5 changed files with 166 additions and 77 deletions

View File

@@ -107,7 +107,7 @@ void NumberFormatter::appendHex(std::string& str, int value)
{
char result[NF_MAX_INT_STRING_LEN];
unsigned sz = NF_MAX_INT_STRING_LEN;
intToStr(value, 0x10, result, sz);
uIntToStr(static_cast<unsigned int>(value), 0x10, result, sz);
str.append(result, sz);
}
@@ -116,7 +116,7 @@ void NumberFormatter::appendHex(std::string& str, int value, int width)
{
char result[NF_MAX_INT_STRING_LEN];
unsigned sz = NF_MAX_INT_STRING_LEN;
intToStr(value, 0x10, result, sz, false, width, '0');
uIntToStr(static_cast<unsigned int>(value), 0x10, result, sz, false, width, '0');
str.append(result, sz);
}
@@ -125,7 +125,7 @@ void NumberFormatter::append(std::string& str, unsigned value)
{
char result[NF_MAX_INT_STRING_LEN];
unsigned sz = NF_MAX_INT_STRING_LEN;
intToStr(value, 10, result, sz);
uIntToStr(value, 10, result, sz);
str.append(result, sz);
}
@@ -134,7 +134,7 @@ void NumberFormatter::append(std::string& str, unsigned value, int width)
{
char result[NF_MAX_INT_STRING_LEN];
unsigned sz = NF_MAX_INT_STRING_LEN;
intToStr(value, 10, result, sz, false, width);
uIntToStr(value, 10, result, sz, false, width);
str.append(result, sz);
}
@@ -143,7 +143,7 @@ void NumberFormatter::append0(std::string& str, unsigned int value, int width)
{
char result[NF_MAX_INT_STRING_LEN];
unsigned sz = NF_MAX_INT_STRING_LEN;
intToStr(value, 10, result, sz, false, width, '0');
uIntToStr(value, 10, result, sz, false, width, '0');
str.append(result, sz);
}
@@ -152,7 +152,7 @@ void NumberFormatter::appendHex(std::string& str, unsigned value)
{
char result[NF_MAX_INT_STRING_LEN];
unsigned sz = NF_MAX_INT_STRING_LEN;
intToStr(value, 0x10, result, sz);
uIntToStr(value, 0x10, result, sz);
str.append(result, sz);
}
@@ -161,7 +161,7 @@ void NumberFormatter::appendHex(std::string& str, unsigned value, int width)
{
char result[NF_MAX_INT_STRING_LEN];
unsigned sz = NF_MAX_INT_STRING_LEN;
intToStr(value, 0x10, result, sz, false, width, '0');
uIntToStr(value, 0x10, result, sz, false, width, '0');
str.append(result, sz);
}
@@ -197,7 +197,7 @@ void NumberFormatter::appendHex(std::string& str, long value)
{
char result[NF_MAX_INT_STRING_LEN];
unsigned sz = NF_MAX_INT_STRING_LEN;
intToStr(value, 0x10, result, sz);
uIntToStr(static_cast<unsigned long>(value), 0x10, result, sz);
str.append(result, sz);
}
@@ -206,7 +206,7 @@ void NumberFormatter::appendHex(std::string& str, long value, int width)
{
char result[NF_MAX_INT_STRING_LEN];
unsigned sz = NF_MAX_INT_STRING_LEN;
intToStr(value, 0x10, result, sz, false, width, '0');
uIntToStr(static_cast<unsigned long>(value), 0x10, result, sz, false, width, '0');
str.append(result, sz);
}
@@ -215,7 +215,7 @@ void NumberFormatter::append(std::string& str, unsigned long value)
{
char result[NF_MAX_INT_STRING_LEN];
unsigned sz = NF_MAX_INT_STRING_LEN;
intToStr(value, 10, result, sz);
uIntToStr(value, 10, result, sz);
str.append(result, sz);
}
@@ -224,7 +224,7 @@ void NumberFormatter::append(std::string& str, unsigned long value, int width)
{
char result[NF_MAX_INT_STRING_LEN];
unsigned sz = NF_MAX_INT_STRING_LEN;
intToStr(value, 10, result, sz, false, width, '0');
uIntToStr(value, 10, result, sz, false, width, '0');
str.append(result, sz);
}
@@ -233,7 +233,7 @@ void NumberFormatter::append0(std::string& str, unsigned long value, int width)
{
char result[NF_MAX_INT_STRING_LEN];
unsigned sz = NF_MAX_INT_STRING_LEN;
intToStr(value, 10, result, sz, false, width, '0');
uIntToStr(value, 10, result, sz, false, width, '0');
str.append(result, sz);
}
@@ -242,7 +242,7 @@ void NumberFormatter::appendHex(std::string& str, unsigned long value)
{
char result[NF_MAX_INT_STRING_LEN];
unsigned sz = NF_MAX_INT_STRING_LEN;
intToStr(value, 0x10, result, sz);
uIntToStr(value, 0x10, result, sz);
str.append(result, sz);
}
@@ -251,7 +251,7 @@ void NumberFormatter::appendHex(std::string& str, unsigned long value, int width
{
char result[NF_MAX_INT_STRING_LEN];
unsigned sz = NF_MAX_INT_STRING_LEN;
intToStr(value, 0x10, result, sz, false, width, '0');
uIntToStr(value, 0x10, result, sz, false, width, '0');
str.append(result, sz);
}
@@ -290,7 +290,7 @@ void NumberFormatter::appendHex(std::string& str, Int64 value)
{
char result[NF_MAX_INT_STRING_LEN];
unsigned sz = NF_MAX_INT_STRING_LEN;
intToStr(value, 0x10, result, sz);
uIntToStr(static_cast<UInt64>(value), 0x10, result, sz);
str.append(result, sz);
}
@@ -299,7 +299,7 @@ void NumberFormatter::appendHex(std::string& str, Int64 value, int width)
{
char result[NF_MAX_INT_STRING_LEN];
unsigned sz = NF_MAX_INT_STRING_LEN;
intToStr(value, 0x10, result, sz, false, width, '0');
uIntToStr(static_cast<UInt64>(value), 0x10, result, sz, false, width, '0');
str.append(result, sz);
}
@@ -308,7 +308,7 @@ void NumberFormatter::append(std::string& str, UInt64 value)
{
char result[NF_MAX_INT_STRING_LEN];
unsigned sz = NF_MAX_INT_STRING_LEN;
intToStr(value, 10, result, sz);
uIntToStr(value, 10, result, sz);
str.append(result, sz);
}
@@ -317,7 +317,7 @@ void NumberFormatter::append(std::string& str, UInt64 value, int width)
{
char result[NF_MAX_INT_STRING_LEN];
unsigned sz = NF_MAX_INT_STRING_LEN;
intToStr(value, 10, result, sz, false, width, '0');
uIntToStr(value, 10, result, sz, false, width, '0');
str.append(result, sz);
}
@@ -326,7 +326,7 @@ void NumberFormatter::append0(std::string& str, UInt64 value, int width)
{
char result[NF_MAX_INT_STRING_LEN];
unsigned sz = NF_MAX_INT_STRING_LEN;
intToStr(value, 10, result, sz, false, width, '0');
uIntToStr(value, 10, result, sz, false, width, '0');
str.append(result, sz);
}
@@ -335,7 +335,7 @@ void NumberFormatter::appendHex(std::string& str, UInt64 value)
{
char result[NF_MAX_INT_STRING_LEN];
unsigned sz = NF_MAX_INT_STRING_LEN;
intToStr(value, 0x10, result, sz);
uIntToStr(value, 0x10, result, sz);
str.append(result, sz);
}
@@ -344,7 +344,7 @@ void NumberFormatter::appendHex(std::string& str, UInt64 value, int width)
{
char result[NF_MAX_INT_STRING_LEN];
unsigned sz = NF_MAX_INT_STRING_LEN;
intToStr(value, 0x10, result, sz, false, width, '0');
uIntToStr(value, 0x10, result, sz, false, width, '0');
str.append(result, sz);
}