Use C++ style casts instead of C-style casts to shut up compiler warnings

when compiling with -pedantic. Passes regression tests on Linux.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28904 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Reid Spencer 2006-06-21 21:54:54 +00:00
parent 8eb12def01
commit 54cb98578a

View File

@ -34,12 +34,24 @@ inline unsigned Lo_32(uint64_t Value) {
}
// is?Type - these functions produce optimal testing for integer data types.
inline bool isInt8 (int Value) { return ( signed char )Value == Value; }
inline bool isUInt8 (int Value) { return (unsigned char )Value == Value; }
inline bool isInt16 (int Value) { return ( signed short)Value == Value; }
inline bool isUInt16(int Value) { return (unsigned short)Value == Value; }
inline bool isInt32 (int64_t Value) { return ( signed int )Value == Value; }
inline bool isUInt32(int64_t Value) { return (unsigned int )Value == Value; }
inline bool isInt8 (int Value) {
return static_cast<signed char>(Value) == Value;
}
inline bool isUInt8 (int Value) {
return static_cast<unsigned char>(Value) == Value;
}
inline bool isInt16 (int Value) {
return static_cast<signed short>(Value) == Value;
}
inline bool isUInt16(int Value) {
return static_cast<unsigned short>(Value) == Value;
}
inline bool isInt32 (int64_t Value) {
return static_cast<signed int>(Value) == Value;
}
inline bool isUInt32(int64_t Value) {
return static_cast<unsigned int>(Value) == Value;
}
// isMask_32 - This function returns true if the argument is a sequence of ones
// starting at the least significant bit with the remainder zero (32 bit version.)