diff options
| author | Scott Mansell <phiren@gmail.com> | 2016-08-09 06:09:52 +1200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-08-09 06:09:52 +1200 |
| commit | d56ae505ddfaf104c7b9c402eecf2308e2d968ce (patch) | |
| tree | b1cbcfd91cc222168c88f0ad4e0f0f37041ce919 /Source | |
| parent | 1ab99ee22c1b6ae1b6d71aef717f277f39045067 (diff) | |
| parent | ba45a5999fe3fe6b5bc83f325d9dacd7daacd649 (diff) | |
Merge pull request #4101 from meffij/SIDevicesEnumFix
clean up bounds checking for SIDEVICE_ENUM
Diffstat (limited to 'Source')
| -rw-r--r-- | Source/Core/Core/BootManager.cpp | 2 | ||||
| -rw-r--r-- | Source/Core/Core/HW/SI_Device.h | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/Source/Core/Core/BootManager.cpp b/Source/Core/Core/BootManager.cpp index f443491dfc..dae95c785a 100644 --- a/Source/Core/Core/BootManager.cpp +++ b/Source/Core/Core/BootManager.cpp @@ -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; diff --git a/Source/Core/Core/HW/SI_Device.h b/Source/Core/Core/HW/SI_Device.h index d2fadc6ac4..fe3953494c 100644 --- a/Source/Core/Core/HW/SI_Device.h +++ b/Source/Core/Core/HW/SI_Device.h @@ -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 |
