diff options
author | 2019-06-27 10:38:29 -0400 | |
---|---|---|
committer | 2019-06-27 10:38:29 -0400 | |
commit | f9745cdafce3120eab8c82e63499865f8a4ed18c (patch) | |
tree | 6891a9a93aa1555707f9350688103955595efb3f | |
parent | a620f24ffc3b8bb9abea7bd3b337856a1ee466cd (diff) |
devcb.h: Revert unnecessary change from ed0202220a5243537f5ba7dbc0a38e52a8390d79 (nw)
isnull() checks the list of unresolved functions along with the list of resolved ones, so resolve_safe() doesn't really need a return value as long as it is called second.
-rw-r--r-- | src/devices/video/pwm.cpp | 8 | ||||
-rw-r--r-- | src/emu/devcb.h | 16 |
2 files changed, 10 insertions, 14 deletions
diff --git a/src/devices/video/pwm.cpp b/src/devices/video/pwm.cpp index b949c83e9a4..651a992a67e 100644 --- a/src/devices/video/pwm.cpp +++ b/src/devices/video/pwm.cpp @@ -73,10 +73,10 @@ ALLOW_SAVE_TYPE(attotime); // m_acc void pwm_display_device::device_start() { // resolve handlers - bool cb1 = m_output_x_cb.resolve_safe(); - bool cb2 = m_output_a_cb.resolve_safe(); - bool cb3 = m_output_digit_cb.resolve_safe(); - m_external_output = cb1 || cb2 || cb3; + m_external_output = !m_output_x_cb.isnull() || !m_output_a_cb.isnull() || !m_output_digit_cb.isnull(); + m_output_x_cb.resolve_safe(); + m_output_a_cb.resolve_safe(); + m_output_digit_cb.resolve_safe(); if (!m_external_output) { diff --git a/src/emu/devcb.h b/src/emu/devcb.h index 1ac9cd1e37f..6b16c37b33a 100644 --- a/src/emu/devcb.h +++ b/src/emu/devcb.h @@ -899,7 +899,7 @@ public: virtual void validity_check(validity_checker &valid) const override; void resolve(); - bool resolve_safe(Result dflt); + void resolve_safe(Result dflt); Result operator()(address_space &space, offs_t offset = 0, std::make_unsigned_t<Result> mem_mask = DefaultMask); Result operator()(offs_t offset, std::make_unsigned_t<Result> mem_mask = DefaultMask); @@ -958,13 +958,11 @@ void devcb_read<Result, DefaultMask>::resolve() } template <typename Result, std::make_unsigned_t<Result> DefaultMask> -bool devcb_read<Result, DefaultMask>::resolve_safe(Result dflt) +void devcb_read<Result, DefaultMask>::resolve_safe(Result dflt) { resolve(); - bool resolved = !m_functions.empty(); - if (!resolved) + if (m_functions.empty()) m_functions.emplace_back([dflt] (address_space &space, offs_t offset, std::make_unsigned_t<Result> mem_mask) { return dflt; }); - return resolved; } template <typename Result, std::make_unsigned_t<Result> DefaultMask> @@ -2371,7 +2369,7 @@ public: virtual void validity_check(validity_checker &valid) const override; void resolve(); - bool resolve_safe(); + void resolve_safe(); void operator()(address_space &space, offs_t offset, Input data, std::make_unsigned_t<Input> mem_mask = DefaultMask); void operator()(address_space &space, Input data); @@ -2422,13 +2420,11 @@ void devcb_write<Input, DefaultMask>::resolve() } template <typename Input, std::make_unsigned_t<Input> DefaultMask> -bool devcb_write<Input, DefaultMask>::resolve_safe() +void devcb_write<Input, DefaultMask>::resolve_safe() { resolve(); - bool resolved = !m_functions.empty(); - if (!resolved) + if (m_functions.empty()) m_functions.emplace_back([] (address_space &space, offs_t offset, Input data, std::make_unsigned_t<Input> mem_mask) { }); - return resolved; } template <typename Input, std::make_unsigned_t<Input> DefaultMask> |