Skip to content
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

clean up bounds checking for SIDEVICE_ENUM #4101

Merged
merged 1 commit into from Aug 8, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion Source/Core/Core/BootManager.cpp
Expand Up @@ -287,7 +287,7 @@ bool BootCore(const std::string& _rFilename)
{
int source;
controls_section->Get(StringFromFormat("PadType%u", i), &source, -1);
if (source >= (int)SIDEVICE_NONE && source <= (int)SIDEVICE_WIIU_ADAPTER)
if (source >= SIDEVICE_NONE && source < SIDEVICE_COUNT)
{
SConfig::GetInstance().m_SIDevice[i] = (SIDevices)source;
config_cache.bSetPads[i] = true;
Expand Down
2 changes: 2 additions & 0 deletions Source/Core/Core/HW/SI_Device.h
Expand Up @@ -64,6 +64,8 @@ enum SIDevices : int
SIDEVICE_GC_TARUKONGA,
SIDEVICE_AM_BASEBOARD,
SIDEVICE_WIIU_ADAPTER,
// not a valid device, used for checking whether enum value is valid
SIDEVICE_COUNT,
};

class ISIDevice
Expand Down