GraphicsDefs: Revert back to casting structs to integers to compare them.
This reverts commit d3abf525c5.
Clang's warning was a little overzealous; this is not a problem on x86.
This commit is contained in:
@@ -19,11 +19,9 @@ typedef struct pattern {
|
|||||||
inline bool
|
inline bool
|
||||||
operator==(const pattern& a, const pattern& b)
|
operator==(const pattern& a, const pattern& b)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < 8; i++) {
|
uint64* pa = (uint64*)a.data;
|
||||||
if (a.data[i] != b.data[i])
|
uint64* pb = (uint64*)b.data;
|
||||||
return false;
|
return (*pa == *pb);
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -64,16 +62,13 @@ typedef struct rgb_color {
|
|||||||
inline bool
|
inline bool
|
||||||
operator==(const rgb_color& other) const
|
operator==(const rgb_color& other) const
|
||||||
{
|
{
|
||||||
return red == other.red
|
return *(const uint32 *)this == *(const uint32 *)&other;
|
||||||
&& green == other.green
|
|
||||||
&& blue == other.blue
|
|
||||||
&& alpha == other.alpha;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool
|
inline bool
|
||||||
operator!=(const rgb_color& other) const
|
operator!=(const rgb_color& other) const
|
||||||
{
|
{
|
||||||
return !(*this == other);
|
return *(const uint32 *)this != *(const uint32 *)&other;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline rgb_color&
|
inline rgb_color&
|
||||||
|
|||||||
Reference in New Issue
Block a user