Death by static initialization order. Fixed declaration order at the

top of input.c.

Removed default_seq since all uses of it are covered by is_default()
and set_default().
This commit is contained in:
Aaron Giles 2011-06-20 19:58:22 +00:00
parent 0e8741767f
commit f77da42ef1
3 changed files with 5 additions and 10 deletions

View File

@ -1080,9 +1080,8 @@ void input_field_set_user_settings(const input_field_config *field, const input_
for (seqtype = 0; seqtype < ARRAY_LENGTH(settings->seq); seqtype++) for (seqtype = 0; seqtype < ARRAY_LENGTH(settings->seq); seqtype++)
{ {
const input_seq &defseq = input_type_seq(field->machine(), field->type, field->player, (input_seq_type)seqtype); const input_seq &defseq = input_type_seq(field->machine(), field->type, field->player, (input_seq_type)seqtype);
// TODO: find what the default_seq/ITEM_ID_SEQ_DEFAULT is supposed to do, besides crashing mame if (defseq == settings->seq[seqtype])
if (false && defseq == settings->seq[seqtype]) field->state->seq[seqtype].set_default();
field->state->seq[seqtype] = input_seq::default_seq;
else else
field->state->seq[seqtype] = settings->seq[seqtype]; field->state->seq[seqtype] = settings->seq[seqtype];
} }
@ -4906,8 +4905,6 @@ input_type_entry::input_type_entry(UINT32 _type, ioport_group _group, int _playe
m_next(NULL) m_next(NULL)
{ {
defseq[SEQ_TYPE_STANDARD] = seq[SEQ_TYPE_STANDARD] = standard; defseq[SEQ_TYPE_STANDARD] = seq[SEQ_TYPE_STANDARD] = standard;
defseq[SEQ_TYPE_INCREMENT] = seq[SEQ_TYPE_INCREMENT] = input_seq::empty_seq;
defseq[SEQ_TYPE_DECREMENT] = seq[SEQ_TYPE_DECREMENT] = input_seq::empty_seq;
} }
input_type_entry::input_type_entry(UINT32 _type, ioport_group _group, int _player, const char *_token, const char *_name, input_seq standard, input_seq decrement, input_seq increment) input_type_entry::input_type_entry(UINT32 _type, ioport_group _group, int _player, const char *_token, const char *_name, input_seq standard, input_seq decrement, input_seq increment)

View File

@ -59,16 +59,15 @@
// invalid memory value for axis polling // invalid memory value for axis polling
const INT32 INVALID_AXIS_VALUE = 0x7fffffff; const INT32 INVALID_AXIS_VALUE = 0x7fffffff;
// constant sequences
const input_seq input_seq::empty_seq;
const input_seq input_seq::default_seq(input_seq::default_code);
// additional expanded input codes for sequences // additional expanded input codes for sequences
const input_code input_seq::end_code(DEVICE_CLASS_INTERNAL, 0, ITEM_CLASS_INVALID, ITEM_MODIFIER_NONE, ITEM_ID_SEQ_END); const input_code input_seq::end_code(DEVICE_CLASS_INTERNAL, 0, ITEM_CLASS_INVALID, ITEM_MODIFIER_NONE, ITEM_ID_SEQ_END);
const input_code input_seq::default_code(DEVICE_CLASS_INTERNAL, 0, ITEM_CLASS_INVALID, ITEM_MODIFIER_NONE, ITEM_ID_SEQ_DEFAULT); const input_code input_seq::default_code(DEVICE_CLASS_INTERNAL, 0, ITEM_CLASS_INVALID, ITEM_MODIFIER_NONE, ITEM_ID_SEQ_DEFAULT);
const input_code input_seq::not_code(DEVICE_CLASS_INTERNAL, 0, ITEM_CLASS_INVALID, ITEM_MODIFIER_NONE, ITEM_ID_SEQ_NOT); const input_code input_seq::not_code(DEVICE_CLASS_INTERNAL, 0, ITEM_CLASS_INVALID, ITEM_MODIFIER_NONE, ITEM_ID_SEQ_NOT);
const input_code input_seq::or_code(DEVICE_CLASS_INTERNAL, 0, ITEM_CLASS_INVALID, ITEM_MODIFIER_NONE, ITEM_ID_SEQ_OR); const input_code input_seq::or_code(DEVICE_CLASS_INTERNAL, 0, ITEM_CLASS_INVALID, ITEM_MODIFIER_NONE, ITEM_ID_SEQ_OR);
// constant sequences
const input_seq input_seq::empty_seq;
//************************************************************************** //**************************************************************************

View File

@ -490,7 +490,6 @@ public:
// constant sequences // constant sequences
static const input_seq empty_seq; static const input_seq empty_seq;
static const input_seq default_seq;
private: private:
// internal state // internal state