mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-31 10:09:36 -06:00
Don't cast -1 to enum to represent a missing value.
This is undefined behavior in C++, and a clang warning suggests it is actually producing bad code as a result: ../Source/Core/VideoCommon/BPFunctions.cpp:164:45: warning: comparison of constant 4294967295 with expression of type 'PEControl::PixelFormat' is always false [-Wtautological-constant-out-of-range-compare] if (new_format == old_format || old_format == (unsigned int)-1)
This commit is contained in:
@ -779,14 +779,15 @@ union PEControl
|
||||
{
|
||||
enum PixelFormat : u32
|
||||
{
|
||||
RGB8_Z24 = 0,
|
||||
RGBA6_Z24 = 1,
|
||||
RGB565_Z16 = 2,
|
||||
Z24 = 3,
|
||||
Y8 = 4,
|
||||
U8 = 5,
|
||||
V8 = 6,
|
||||
YUV420 = 7
|
||||
RGB8_Z24 = 0,
|
||||
RGBA6_Z24 = 1,
|
||||
RGB565_Z16 = 2,
|
||||
Z24 = 3,
|
||||
Y8 = 4,
|
||||
U8 = 5,
|
||||
V8 = 6,
|
||||
YUV420 = 7,
|
||||
INVALID_FMT = 0xffffffff, // Used by Dolphin to represent a missing value.
|
||||
};
|
||||
|
||||
enum DepthFormat : u32
|
||||
|
Reference in New Issue
Block a user