Merge pull request #2129 from shattered/_5e08182

Pick low-hanging fruit from Coverity Scan results, basket 1.
This commit is contained in:
ajrhacker 2017-03-10 21:24:59 -05:00 committed by GitHub
commit 006709e725
8 changed files with 20 additions and 18 deletions

View File

@ -1746,9 +1746,9 @@ void hdc92x4_device::seek_read_id()
}
int cont = NEXT;
bool step_enable = (current_command() & 0x04)==1;
bool wait_seek_comp = (current_command() & 0x02)==1;
bool do_verify = (current_command() & 0x01)==1;
bool step_enable = BIT(current_command(), 2);
bool wait_seek_comp = BIT(current_command(), 1);
bool do_verify = BIT(current_command(), 0);
m_logical = true;
while (cont == NEXT)

View File

@ -361,8 +361,8 @@ void roc10957_t::write_char(int data)
}
}
else
{ // Display data
data &= 0x3F;
{ // Display data. Bit 6 is a "don't care" bit except for PNT and TAIL.
data &= 0x7F;
switch ( data )
{

View File

@ -173,9 +173,7 @@ static int cbm_tap_do_work( int16_t **buffer, int length, const uint8_t *data )
int i, j = 0;
int size = 0;
int version = data[0x0c];
int system = data[0x0d];
int video_standard = data[0x0e];
int version, system, video_standard;
int tap_frequency = 0;
int byte_samples = 0;
@ -186,6 +184,14 @@ static int cbm_tap_do_work( int16_t **buffer, int length, const uint8_t *data )
in Commodore tapes. Implementation here would follow */
/* int waveamp_high, waveamp_low; */
/* is the .tap file corrupted? */
if ((data == nullptr) || (length <= CBM_HEADER_SIZE))
return -1;
version = data[0x0c];
system = data[0x0d];
video_standard = data[0x0e];
/* Log .TAP info but only once */
if (!(buffer == nullptr))
{
@ -203,10 +209,6 @@ static int cbm_tap_do_work( int16_t **buffer, int length, const uint8_t *data )
return -1;
}
/* is the .tap file corrupted? */
if ((data == nullptr) || (length <= CBM_HEADER_SIZE))
return -1;
/* read the frequency from the .tap header */
switch (system)

View File

@ -114,7 +114,7 @@ WRITE8_MEMBER(argo_state::argo_io_w)
{
uint8_t *RAM = memregion("videoram")->base();
m_scroll_ctrl = 0;
memcpy(RAM, RAM+80, 24*80);
memmove(RAM, RAM+80, 24*80);
}
break;

View File

@ -176,7 +176,7 @@ DECLARE_WRITE8_MEMBER(dma_memw_cb);
void draw_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprect);
uint32_t calc_kanji_rom_addr(uint8_t jis1,uint8_t jis2,int x,int y);
void draw_text(bitmap_rgb32 &bitmap, const rectangle &cliprect);
void tsp_sprite_enable(uint32_t spr_offset, uint8_t sw_bit);
void tsp_sprite_enable(uint32_t spr_offset, uint16_t sw_bit);
void execute_sync_cmd();
void execute_dspon_cmd();
void execute_dspdef_cmd();
@ -759,7 +759,7 @@ WRITE8_MEMBER(pc88va_state::idp_command_w)
}
}
void pc88va_state::tsp_sprite_enable(uint32_t spr_offset, uint8_t sw_bit)
void pc88va_state::tsp_sprite_enable(uint32_t spr_offset, uint16_t sw_bit)
{
address_space &space = m_maincpu->space(AS_PROGRAM);

View File

@ -795,7 +795,7 @@ READ8_MEMBER(peplus_state::peplus_input0_r)
}
if (m_bv_pulse == 1) {
return (0x70 || m_in0->read()); // Add Bill Validator Credit Pulse
return (0x70 | m_in0->read()); // Add Bill Validator Credit Pulse
} else {
return m_in0->read();
}

View File

@ -257,7 +257,7 @@ WRITE8_MEMBER( unior_state::vram_w )
WRITE8_MEMBER( unior_state::scroll_w )
{
if (data)
memcpy(m_p_vram, m_p_vram+80, 24*80);
memmove(m_p_vram, m_p_vram+80, 24*80);
}
I8275_DRAW_CHARACTER_MEMBER(unior_state::display_pixels)

View File

@ -1009,7 +1009,7 @@ void x07_state::kb_irq()
{
m_regs_r[0] = 0;
m_regs_r[1] = m_t6834_ram[0x400];
memcpy(m_t6834_ram + 0x400, m_t6834_ram + 0x401, 0xff);
memmove(m_t6834_ram + 0x400, m_t6834_ram + 0x401, 0xff);
m_kb_size--;
m_regs_r[2] |= 0x01;
m_maincpu->set_input_line(NSC800_RSTA, ASSERT_LINE);