forked from dolphin-emu/dolphin
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:
@@ -64,7 +64,7 @@ int Renderer::s_LastEFBScale;
|
||||
bool Renderer::s_skipSwap;
|
||||
bool Renderer::XFBWrited;
|
||||
|
||||
PEControl::PixelFormat Renderer::prev_efb_format = (PEControl::PixelFormat)-1;
|
||||
PEControl::PixelFormat Renderer::prev_efb_format = PEControl::INVALID_FMT;
|
||||
unsigned int Renderer::efb_scale_numeratorX = 1;
|
||||
unsigned int Renderer::efb_scale_numeratorY = 1;
|
||||
unsigned int Renderer::efb_scale_denominatorX = 1;
|
||||
@@ -89,7 +89,7 @@ Renderer::Renderer()
|
||||
Renderer::~Renderer()
|
||||
{
|
||||
// invalidate previous efb format
|
||||
prev_efb_format = (PEControl::PixelFormat)-1;
|
||||
prev_efb_format = PEControl::INVALID_FMT;
|
||||
|
||||
efb_scale_numeratorX = efb_scale_numeratorY = efb_scale_denominatorX = efb_scale_denominatorY = 1;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user