New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Core: Explicitly declare enum values in switch statements #1996
Conversation
dfde5b4
to
98ec2ca
Compare
@@ -296,7 +298,10 @@ u8* GetPointer(const u32 address) | |||
return m_pEXRAM + (address & EXRAM_MASK); | |||
} | |||
else | |||
{ |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
Gets rid of a swath of warnings when compiling with -Weverything.
@@ -124,11 +120,6 @@ float Interpreter::Helper_Dequantize(const u32 _Addr, const EQuantizeType _quant | |||
case QUANTIZE_S16: | |||
fResult = static_cast<float>((s16)Memory::Read_U16(_Addr)) * m_dequantizeTable[_uScale]; | |||
break; | |||
|
|||
default: |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
Regarding those enums, they've been around forever. Maybe @hrydgard used them on purpose instead of a define/const back then, for whatever reason? |
@@ -37,6 +37,7 @@ void LoadCodes(const IniFile& globalIni, const IniFile& localIni, std::vector<Ge | |||
// enabled or disabled code | |||
case '+' : | |||
ss.seekg(1); | |||
// Fallthrough |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
The use of enums was probably just to get sensible names to show up when debugging, as sonicadvance1 has already pointed out they don't cover all the usable values and assuming they do is a Bad Idea(tm). Good job fixing the out-of-range-MEM2-access-hitting-the-locked-cache bug though, since it was ignored when I pointed it out 6 months ago... |
Will sort this out when I have time/feel like doing it again. |
Gets rid of a swath of warnings when compiling with -Weverything.