diff options
-rw-r--r-- | src/emu/devfind.h | 7 | ||||
-rw-r--r-- | src/mame/machine/coco.cpp | 6 |
2 files changed, 8 insertions, 5 deletions
diff --git a/src/emu/devfind.h b/src/emu/devfind.h index c058f2690b2..7aa8bdcd5d1 100644 --- a/src/emu/devfind.h +++ b/src/emu/devfind.h @@ -116,8 +116,11 @@ public: /// \return Reference to element at specified index. T &operator[](unsigned index) { assert(index < Count); return m_array[index]; } - /// \brief Returns the count - unsigned size() const { return Count; } + /// \brief Get array size + /// + /// Returns number of objects in array (compile-time constant). + /// \return The size of the array. + constexpr unsigned size() const { return Count; } }; diff --git a/src/mame/machine/coco.cpp b/src/mame/machine/coco.cpp index b3ade3d69d0..5d2cd2e4a6d 100644 --- a/src/mame/machine/coco.cpp +++ b/src/mame/machine/coco.cpp @@ -2,7 +2,7 @@ // copyright-holders:Nathan Woods /*************************************************************************** - coco.c + coco.cpp TRS-80 Radio Shack Color Computer Family @@ -93,7 +93,7 @@ coco_state::coco_state(const machine_config &mconfig, device_type type, const ch m_vhd_1(*this, VHD1_TAG), m_beckerport(*this, DWSOCK_TAG), m_beckerportconfig(*this, BECKERPORT_TAG), - m_keyboard(*this, { "row0", "row1", "row2", "row3", "row4", "row5", "row6" }), + m_keyboard(*this, "row%u", 0), m_joystick_type_control(*this, CTRL_SEL_TAG), m_joystick_hires_control(*this, HIRES_INTF_TAG) { @@ -857,7 +857,7 @@ void coco_state::poll_keyboard(void) UINT8 pia0_pa_z = 0x7F; /* poll the keyboard, and update PA6-PA0 accordingly*/ - for (int i = 0; i < m_keyboard.size(); i++) + for (unsigned i = 0; i < m_keyboard.size(); i++) { int value = m_keyboard[i]->read(); if ((value | pia0_pb) != 0xFF) |