clean up bounds checking for SIDEVICE_ENUM
This commit is contained in:
parent
1ab99ee22c
commit
ba45a5999f
|
@ -287,7 +287,7 @@ bool BootCore(const std::string& _rFilename)
|
||||||
{
|
{
|
||||||
int source;
|
int source;
|
||||||
controls_section->Get(StringFromFormat("PadType%u", i), &source, -1);
|
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;
|
SConfig::GetInstance().m_SIDevice[i] = (SIDevices)source;
|
||||||
config_cache.bSetPads[i] = true;
|
config_cache.bSetPads[i] = true;
|
||||||
|
|
|
@ -64,6 +64,8 @@ enum SIDevices : int
|
||||||
SIDEVICE_GC_TARUKONGA,
|
SIDEVICE_GC_TARUKONGA,
|
||||||
SIDEVICE_AM_BASEBOARD,
|
SIDEVICE_AM_BASEBOARD,
|
||||||
SIDEVICE_WIIU_ADAPTER,
|
SIDEVICE_WIIU_ADAPTER,
|
||||||
|
// not a valid device, used for checking whether enum value is valid
|
||||||
|
SIDEVICE_COUNT,
|
||||||
};
|
};
|
||||||
|
|
||||||
class ISIDevice
|
class ISIDevice
|
||||||
|
|
Loading…
Reference in New Issue