mirror of
https://github.com/wolfpld/tracy.git
synced 2025-03-20 07:40:02 +08:00
Fix MSVC compiler warning
This commit is contained in:
parent
9d357430b6
commit
c85b027182
@ -210,19 +210,13 @@ namespace details
|
||||
}
|
||||
};
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable: 4554)
|
||||
#endif
|
||||
template<typename T>
|
||||
static inline bool circular_less_than(T a, T b)
|
||||
{
|
||||
static_assert(std::is_integral<T>::value && !std::numeric_limits<T>::is_signed, "circular_less_than is intended to be used only with unsigned integer types");
|
||||
return static_cast<T>(a - b) > (static_cast<T>(static_cast<T>(1) << static_cast<T>(sizeof(T) * CHAR_BIT - 1)));
|
||||
const T shift = static_cast<T>(sizeof(T) * CHAR_BIT - 1);
|
||||
return a - b > (static_cast<T>(1) << shift);
|
||||
}
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
|
||||
template<typename U>
|
||||
static inline char* align_for(char* ptr)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user