diff options
author | Chris Lattner <sabre@nondot.org> | 2004-06-04 19:10:30 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2004-06-04 19:10:30 +0000 |
commit | b80110f66728407f8eaae3d81650ebfc583b80fb (patch) | |
tree | 51fba0c614619e10bf4da3fe7731dfe8c6aac1fa /llvm/include/Support/StringExtras.h | |
parent | 5034a983ff7a455ff3030b6030c5bd8e409a4266 (diff) | |
download | bcm5719-llvm-b80110f66728407f8eaae3d81650ebfc583b80fb.tar.gz bcm5719-llvm-b80110f66728407f8eaae3d81650ebfc583b80fb.zip |
Add explicit casts to silence warnings. There is no need to use snprintf here.
llvm-svn: 14013
Diffstat (limited to 'llvm/include/Support/StringExtras.h')
-rw-r--r-- | llvm/include/Support/StringExtras.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/include/Support/StringExtras.h b/llvm/include/Support/StringExtras.h index f491e93b840..5cbf9b3e338 100644 --- a/llvm/include/Support/StringExtras.h +++ b/llvm/include/Support/StringExtras.h @@ -28,7 +28,7 @@ static inline std::string utohexstr(uint64_t X) { if (X == 0) *--BufPtr = '0'; // Handle special case... while (X) { - unsigned Mod = X & 15; + unsigned char Mod = unsigned char(X) & 15; if (Mod < 10) *--BufPtr = '0' + Mod; 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... while (X) { - *--BufPtr = '0' + (X % 10); + *--BufPtr = '0' + char(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... while (X) { - *--BufPtr = '0' + (X % 10); + *--BufPtr = '0' + char(X % 10); X /= 10; } @@ -93,7 +93,7 @@ static inline std::string itostr(int X) { static inline std::string ftostr(double V) { char Buffer[200]; - snprintf(Buffer, 200, "%20.6e", V); + sprintf(Buffer, "%20.6e", V); return Buffer; } |