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:
Augustin Cavalier 2017-12-02 17:36:20 -05:00
parent 737de463dd
commit 764c402a69

View File

@ -19,11 +19,9 @@ typedef struct pattern {
inline bool
operator==(const pattern& a, const pattern& b)
{
for (int i = 0; i < 8; i++) {
if (a.data[i] != b.data[i])
return false;
}
return true;
uint64* pa = (uint64*)a.data;
uint64* pb = (uint64*)b.data;
return (*pa == *pb);
}
@ -64,16 +62,13 @@ typedef struct rgb_color {
inline bool
operator==(const rgb_color& other) const
{
return red == other.red
&& green == other.green
&& blue == other.blue
&& alpha == other.alpha;
return *(const uint32 *)this == *(const uint32 *)&other;
}
inline bool
operator!=(const rgb_color& other) const
{
return !(*this == other);
return *(const uint32 *)this != *(const uint32 *)&other;
}
inline rgb_color&