From 601034c8d71b64262b257e47797f3a315ed16fcb Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Wed, 5 Feb 2020 12:41:58 +1100 Subject: devcb.cpp: syntactic sugar for constructing/resolving arrays of callbacks (nw) Saves a lot of typing { *this }, { *this }... Could be applied in more places, I just did a few devices to demonstrate it. --- src/devices/machine/phi.cpp | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'src/devices/machine/phi.cpp') diff --git a/src/devices/machine/phi.cpp b/src/devices/machine/phi.cpp index 65610b06faa..4e1e4ea8c6b 100644 --- a/src/devices/machine/phi.cpp +++ b/src/devices/machine/phi.cpp @@ -191,15 +191,7 @@ phi_device::phi_device(const machine_config &mconfig, device_type type, const ch : device_t(mconfig, type, tag, owner, clock), m_dio_read_func(*this), m_dio_write_func(*this), - m_signal_wr_fns{ - devcb_write_line(*this), - devcb_write_line(*this), - devcb_write_line(*this), - devcb_write_line(*this), - devcb_write_line(*this), - devcb_write_line(*this), - devcb_write_line(*this), - devcb_write_line(*this) }, + m_signal_wr_fns(*this), m_int_write_func(*this), m_dmarq_write_func(*this), m_sys_cntrl_read_func(*this) @@ -384,9 +376,7 @@ void phi_device::device_start() m_dio_read_func.resolve_safe(0xff); m_dio_write_func.resolve_safe(); - for (auto& f : m_signal_wr_fns) { - f.resolve_safe(); - } + m_signal_wr_fns.resolve_all_safe(); m_int_write_func.resolve_safe(); m_dmarq_write_func.resolve_safe(); m_sys_cntrl_read_func.resolve_safe(0); -- cgit v1.2.3