mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-25 00:24:26 +00:00
Add explicit casts to silence warnings. There is no need to use snprintf here.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14013 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -28,7 +28,7 @@ static inline std::string utohexstr(uint64_t X) {
|
|||||||
if (X == 0) *--BufPtr = '0'; // Handle special case...
|
if (X == 0) *--BufPtr = '0'; // Handle special case...
|
||||||
|
|
||||||
while (X) {
|
while (X) {
|
||||||
unsigned Mod = X & 15;
|
unsigned char Mod = unsigned char(X) & 15;
|
||||||
if (Mod < 10)
|
if (Mod < 10)
|
||||||
*--BufPtr = '0' + Mod;
|
*--BufPtr = '0' + Mod;
|
||||||
else
|
else
|
||||||
@ -46,7 +46,7 @@ static inline std::string utostr(unsigned long long X, bool isNeg = false) {
|
|||||||
if (X == 0) *--BufPtr = '0'; // Handle special case...
|
if (X == 0) *--BufPtr = '0'; // Handle special case...
|
||||||
|
|
||||||
while (X) {
|
while (X) {
|
||||||
*--BufPtr = '0' + (X % 10);
|
*--BufPtr = '0' + char(X % 10);
|
||||||
X /= 10;
|
X /= 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -75,7 +75,7 @@ static inline std::string utostr(unsigned X, bool isNeg = false) {
|
|||||||
if (X == 0) *--BufPtr = '0'; // Handle special case...
|
if (X == 0) *--BufPtr = '0'; // Handle special case...
|
||||||
|
|
||||||
while (X) {
|
while (X) {
|
||||||
*--BufPtr = '0' + (X % 10);
|
*--BufPtr = '0' + char(X % 10);
|
||||||
X /= 10;
|
X /= 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -93,7 +93,7 @@ static inline std::string itostr(int X) {
|
|||||||
|
|
||||||
static inline std::string ftostr(double V) {
|
static inline std::string ftostr(double V) {
|
||||||
char Buffer[200];
|
char Buffer[200];
|
||||||
snprintf(Buffer, 200, "%20.6e", V);
|
sprintf(Buffer, "%20.6e", V);
|
||||||
return Buffer;
|
return Buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ static inline std::string utohexstr(uint64_t X) {
|
|||||||
if (X == 0) *--BufPtr = '0'; // Handle special case...
|
if (X == 0) *--BufPtr = '0'; // Handle special case...
|
||||||
|
|
||||||
while (X) {
|
while (X) {
|
||||||
unsigned Mod = X & 15;
|
unsigned char Mod = unsigned char(X) & 15;
|
||||||
if (Mod < 10)
|
if (Mod < 10)
|
||||||
*--BufPtr = '0' + Mod;
|
*--BufPtr = '0' + Mod;
|
||||||
else
|
else
|
||||||
@ -46,7 +46,7 @@ static inline std::string utostr(unsigned long long X, bool isNeg = false) {
|
|||||||
if (X == 0) *--BufPtr = '0'; // Handle special case...
|
if (X == 0) *--BufPtr = '0'; // Handle special case...
|
||||||
|
|
||||||
while (X) {
|
while (X) {
|
||||||
*--BufPtr = '0' + (X % 10);
|
*--BufPtr = '0' + char(X % 10);
|
||||||
X /= 10;
|
X /= 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -75,7 +75,7 @@ static inline std::string utostr(unsigned X, bool isNeg = false) {
|
|||||||
if (X == 0) *--BufPtr = '0'; // Handle special case...
|
if (X == 0) *--BufPtr = '0'; // Handle special case...
|
||||||
|
|
||||||
while (X) {
|
while (X) {
|
||||||
*--BufPtr = '0' + (X % 10);
|
*--BufPtr = '0' + char(X % 10);
|
||||||
X /= 10;
|
X /= 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -93,7 +93,7 @@ static inline std::string itostr(int X) {
|
|||||||
|
|
||||||
static inline std::string ftostr(double V) {
|
static inline std::string ftostr(double V) {
|
||||||
char Buffer[200];
|
char Buffer[200];
|
||||||
snprintf(Buffer, 200, "%20.6e", V);
|
sprintf(Buffer, "%20.6e", V);
|
||||||
return Buffer;
|
return Buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user