From 5ce403ec4c0a40025348e139a05c6bcc47382c41 Mon Sep 17 00:00:00 2001 From: Robbbert Date: Sat, 13 Feb 2021 22:15:08 +1100 Subject: [PATCH] lordgun: Coverity 315424 --- src/mame/drivers/lordgun.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/mame/drivers/lordgun.cpp b/src/mame/drivers/lordgun.cpp index 111d4cce87f..2b028fba58b 100644 --- a/src/mame/drivers/lordgun.cpp +++ b/src/mame/drivers/lordgun.cpp @@ -172,7 +172,7 @@ void lordgun_state::lordgun_eeprom_w(uint8_t data) { int i; - if (data & ~0xfd) + if (data & 2) { // popmessage("EE: %02x", data); logerror("%s: Unknown EEPROM bit written %02X\n",machine().describe_context(),data); @@ -186,7 +186,7 @@ void lordgun_state::lordgun_eeprom_w(uint8_t data) lordgun_update_gun(i); // latch the bit - m_eeprom->di_write((data & 0x40) >> 6); + m_eeprom->di_write(BIT(data, 6)); // reset line asserted: reset. m_eeprom->cs_write((data & 0x10) ? ASSERT_LINE : CLEAR_LINE ); @@ -201,7 +201,7 @@ void lordgun_state::lordgun_eeprom_w(uint8_t data) void lordgun_state::aliencha_eeprom_w(uint8_t data) { - if (~data & ~0xf8) + if (~data & 7) { // popmessage("EE: %02x", data); logerror("%s: Unknown EEPROM bit written %02X\n",machine().describe_context(),data); @@ -214,7 +214,7 @@ void lordgun_state::aliencha_eeprom_w(uint8_t data) machine().bookkeeping().coin_counter_w(1, data & 0x10); // latch the bit - m_eeprom->di_write((data & 0x80) >> 7); + m_eeprom->di_write(BIT(data, 7)); // reset line asserted: reset. m_eeprom->cs_write((data & 0x20) ? ASSERT_LINE : CLEAR_LINE );