diff --git a/include/Support/StringExtras.h b/include/Support/StringExtras.h index 5cbf9b3e338..6b6472954ee 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 char Mod = unsigned char(X) & 15; + unsigned char Mod = (unsigned char)X & 15; if (Mod < 10) *--BufPtr = '0' + Mod; else diff --git a/include/llvm/ADT/StringExtras.h b/include/llvm/ADT/StringExtras.h index 5cbf9b3e338..6b6472954ee 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 char Mod = unsigned char(X) & 15; + unsigned char Mod = (unsigned char)X & 15; if (Mod < 10) *--BufPtr = '0' + Mod; else