mirror of
https://github.com/holub/mame
synced 2025-07-01 16:19:38 +03:00
Let's be more strict (nw)
This commit is contained in:
parent
c714096e28
commit
a5a301d1fe
@ -1581,7 +1581,7 @@ input_code input_manager::code_from_token(const char *_token)
|
|||||||
// first token should be the devclass
|
// first token should be the devclass
|
||||||
int curtok = 0;
|
int curtok = 0;
|
||||||
input_device_class devclass = input_device_class((*devclass_token_table)[token[curtok++].c_str()]);
|
input_device_class devclass = input_device_class((*devclass_token_table)[token[curtok++].c_str()]);
|
||||||
if (devclass == ~0)
|
if (devclass == ~input_device_class(0))
|
||||||
return INPUT_CODE_INVALID;
|
return INPUT_CODE_INVALID;
|
||||||
|
|
||||||
// second token might be index; look for number
|
// second token might be index; look for number
|
||||||
@ -1596,7 +1596,7 @@ input_code input_manager::code_from_token(const char *_token)
|
|||||||
|
|
||||||
// next token is the item ID
|
// next token is the item ID
|
||||||
input_item_id itemid = input_item_id((*itemid_token_table)[token[curtok].c_str()]);
|
input_item_id itemid = input_item_id((*itemid_token_table)[token[curtok].c_str()]);
|
||||||
bool standard = (itemid != ~0);
|
bool standard = (itemid != ~input_item_id(0));
|
||||||
|
|
||||||
// if we're a standard code, default the itemclass based on it
|
// if we're a standard code, default the itemclass based on it
|
||||||
input_item_class itemclass = ITEM_CLASS_INVALID;
|
input_item_class itemclass = ITEM_CLASS_INVALID;
|
||||||
@ -1634,7 +1634,7 @@ input_code input_manager::code_from_token(const char *_token)
|
|||||||
if (curtok < numtokens)
|
if (curtok < numtokens)
|
||||||
{
|
{
|
||||||
modifier = input_item_modifier((*modifier_token_table)[token[curtok].c_str()]);
|
modifier = input_item_modifier((*modifier_token_table)[token[curtok].c_str()]);
|
||||||
if (modifier != ~0)
|
if (modifier != ~input_item_modifier(0))
|
||||||
curtok++;
|
curtok++;
|
||||||
else
|
else
|
||||||
modifier = ITEM_MODIFIER_NONE;
|
modifier = ITEM_MODIFIER_NONE;
|
||||||
|
Loading…
Reference in New Issue
Block a user