mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Rename a method from 'check' to 'checkBounds' to avoid colliding with a 'check' macro in an OS X system header. (No, really.) Noticed while tryservering patches for bug 798179, r=rage
--HG-- extra : rebase_source : 3f9323afa6e80962ede30d1b953b95f3d363ccd0
This commit is contained in:
parent
641be4a773
commit
e9da9414f3
@ -64,7 +64,7 @@ template<typename From, typename To>
|
||||
struct UnsignedUnsignedCheck<From, To, FromIsBigger>
|
||||
{
|
||||
public:
|
||||
static bool check(const From from) {
|
||||
static bool checkBounds(const From from) {
|
||||
return from <= From(To(-1));
|
||||
}
|
||||
};
|
||||
@ -73,7 +73,7 @@ template<typename From, typename To>
|
||||
struct UnsignedUnsignedCheck<From, To, FromIsNotBigger>
|
||||
{
|
||||
public:
|
||||
static bool check(const From from) {
|
||||
static bool checkBounds(const From from) {
|
||||
return true;
|
||||
}
|
||||
};
|
||||
@ -82,8 +82,8 @@ template<typename From, typename To>
|
||||
struct BoundsCheckImpl<From, To, FromIsUnsigned, ToIsUnsigned>
|
||||
{
|
||||
public:
|
||||
static bool check(const From from) {
|
||||
return UnsignedUnsignedCheck<From, To>::check(from);
|
||||
static bool checkBounds(const From from) {
|
||||
return UnsignedUnsignedCheck<From, To>::checkBounds(from);
|
||||
}
|
||||
};
|
||||
|
||||
@ -93,7 +93,7 @@ template<typename From, typename To>
|
||||
struct BoundsCheckImpl<From, To, FromIsSigned, ToIsUnsigned>
|
||||
{
|
||||
public:
|
||||
static bool check(const From from) {
|
||||
static bool checkBounds(const From from) {
|
||||
if (from < 0)
|
||||
return false;
|
||||
if (sizeof(To) >= sizeof(From))
|
||||
@ -114,7 +114,7 @@ template<typename From, typename To>
|
||||
struct UnsignedSignedCheck<From, To, FromIsSmaller>
|
||||
{
|
||||
public:
|
||||
static bool check(const From from) {
|
||||
static bool checkBounds(const From from) {
|
||||
return true;
|
||||
}
|
||||
};
|
||||
@ -123,7 +123,7 @@ template<typename From, typename To>
|
||||
struct UnsignedSignedCheck<From, To, FromIsNotSmaller>
|
||||
{
|
||||
public:
|
||||
static bool check(const From from) {
|
||||
static bool checkBounds(const From from) {
|
||||
const To MaxValue = To((1ULL << (CHAR_BIT * sizeof(To) - 1)) - 1);
|
||||
return from <= From(MaxValue);
|
||||
}
|
||||
@ -133,8 +133,8 @@ template<typename From, typename To>
|
||||
struct BoundsCheckImpl<From, To, FromIsUnsigned, ToIsSigned>
|
||||
{
|
||||
public:
|
||||
static bool check(const From from) {
|
||||
return UnsignedSignedCheck<From, To>::check(from);
|
||||
static bool checkBounds(const From from) {
|
||||
return UnsignedSignedCheck<From, To>::checkBounds(from);
|
||||
}
|
||||
};
|
||||
|
||||
@ -144,7 +144,7 @@ template<typename From, typename To>
|
||||
struct BoundsCheckImpl<From, To, FromIsSigned, ToIsSigned>
|
||||
{
|
||||
public:
|
||||
static bool check(const From from) {
|
||||
static bool checkBounds(const From from) {
|
||||
if (sizeof(From) <= sizeof(To))
|
||||
return true;
|
||||
const To MaxValue = To((1ULL << (CHAR_BIT * sizeof(To) - 1)) - 1);
|
||||
@ -162,15 +162,15 @@ template<typename From>
|
||||
class BoundsChecker<From, From, true>
|
||||
{
|
||||
public:
|
||||
static bool check(const From from) { return true; }
|
||||
static bool checkBounds(const From from) { return true; }
|
||||
};
|
||||
|
||||
template<typename From, typename To>
|
||||
class BoundsChecker<From, To, true>
|
||||
{
|
||||
public:
|
||||
static bool check(const From from) {
|
||||
return BoundsCheckImpl<From, To>::check(from);
|
||||
static bool checkBounds(const From from) {
|
||||
return BoundsCheckImpl<From, To>::checkBounds(from);
|
||||
}
|
||||
};
|
||||
|
||||
@ -178,7 +178,7 @@ template<typename From, typename To>
|
||||
inline bool
|
||||
IsInBounds(const From from)
|
||||
{
|
||||
return BoundsChecker<From, To>::check(from);
|
||||
return BoundsChecker<From, To>::checkBounds(from);
|
||||
}
|
||||
|
||||
} // namespace detail
|
||||
|
Loading…
Reference in New Issue
Block a user