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 | 2908ca78b0ec8f38cde679a7af12068a32fd84d1 (patch) | |
tree | 8c0d79fbeb47c50d102e3d066170cedfe5e63af2 | |
parent | 6549b82535c14912d1fcb3e4dee0d8b03d61fcfd (diff) | |
download | external_llvm-2908ca78b0ec8f38cde679a7af12068a32fd84d1.zip external_llvm-2908ca78b0ec8f38cde679a7af12068a32fd84d1.tar.gz external_llvm-2908ca78b0ec8f38cde679a7af12068a32fd84d1.tar.bz2 |
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
-rw-r--r-- | include/Support/StringExtras.h | 8 | ||||
-rw-r--r-- | include/llvm/ADT/StringExtras.h | 8 |
2 files changed, 8 insertions, 8 deletions
diff --git a/include/Support/StringExtras.h b/include/Support/StringExtras.h index f491e93..5cbf9b3 100644 --- a/include/Support/StringExtras.h +++ b/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; } diff --git a/include/llvm/ADT/StringExtras.h b/include/llvm/ADT/StringExtras.h index f491e93..5cbf9b3 100644 --- a/include/llvm/ADT/StringExtras.h +++ b/include/llvm/ADT/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; } |