Fix obvious bugs found by GCC 7.1 (nw)

This commit is contained in:
Miodrag Milanovic 2017-05-15 17:38:50 +02:00
parent b3e4f34645
commit 21f7c8423f
10 changed files with 10 additions and 10 deletions

View File

@ -884,7 +884,7 @@ uint8_t xt_hdc_device::data_r()
data_cnt = 0;
}
data = buffer[data_cnt++];
if(data_cnt >= ((sector_cnt[drv] * 512) ? (sector_cnt[drv] * 512) : (256 * 512)))
if(data_cnt >= ((sector_cnt[drv]!=0) ? (sector_cnt[drv] * 512) : (256 * 512)))
{
data_cnt = 0;
pc_hdc_result(1);

View File

@ -148,7 +148,7 @@ void pcu_reset(dsp56k_core* cpustate)
/* P:$cfff -> Internal P:$07ff high byte */
uint8_t mem_value_low = cpustate->program->read_byte(mem_offset); /* TODO: IS THIS READING RIGHT? */
uint8_t mem_value_high = cpustate->program->read_byte(mem_offset);
cpustate->program_ram[i] = (mem_value_high << 8) || mem_value_low;
cpustate->program_ram[i] = (mem_value_high << 8) | mem_value_low;
}
/* HACK - Set the PC to 0x0000 as per the boot ROM. */

View File

@ -1258,7 +1258,7 @@ void spc700_device::state_string_export(const device_state_entry &entry, std::st
(m_flag_b) ? 'B':'.',
(m_flag_h & HFLAG_SET) ? 'H':'.',
( m_flag_i) ? 'I':'.',
((!m_flag_z) << 1) ? 'Z':'.',
(((!m_flag_z) << 1) & 1) ? 'Z':'.',
((m_flag_c >> 8)&1) ? 'C':'.'
);
break;

View File

@ -2068,7 +2068,7 @@ void hdc92x4_device::format_track()
cont = WAIT;
break;
case TRACKDONE:
if (FORMAT_TRACK && TRACE_SUBSTATES) logerror("Track writing done\n");
if (TRACE_FORMAT && TRACE_SUBSTATES) logerror("Track writing done\n");
cont = SUCCESS;
break;
}

View File

@ -2140,7 +2140,7 @@ void saturn_state::read_new_dir(uint32_t fileno)
// makes the directory pointed to by FAD current
void saturn_state::make_dir_current(uint32_t fad)
{
int i;
uint32_t i;
uint32_t nextent, numentries;
std::vector<uint8_t> sect(MAX_DIR_SIZE);
direntryT *curentry;

View File

@ -419,7 +419,7 @@ void snes_ppu_device::device_reset()
{
elem.enable = 0;
elem.clip = 0;
memset(elem.buffer, 0, SNES_SCR_WIDTH);
memset(elem.buffer, 0, SNES_SCR_WIDTH * sizeof(uint16_t));
memset(elem.priority, 0, SNES_SCR_WIDTH);
memset(elem.layer, 0, SNES_SCR_WIDTH);
memset(elem.blend_exception, 0, SNES_SCR_WIDTH);

View File

@ -1110,7 +1110,7 @@ public:
void set_max_texture_size(int maxwidth, int maxheight);
void set_transform_container(bool transform_container) { m_transform_container = transform_container; }
void set_keepaspect(bool keepaspect) { m_keepaspect = keepaspect; }
void set_scale_mode(bool scale_mode) { m_scale_mode = scale_mode; }
void set_scale_mode(int scale_mode) { m_scale_mode = scale_mode; }
// layer config getters
bool backdrops_enabled() const { return m_layerconfig.backdrops_enabled(); }

View File

@ -2720,7 +2720,7 @@ void n64_state::n64_machine_stop()
device_image_interface *image = dynamic_cast<device_image_interface *>(periphs->m_nvram_image);
uint8_t data[0x30800];
if (m_sram != nullptr)
if (m_sram == nullptr)
{
memset(data, 0, 0x20000);
}

View File

@ -252,7 +252,7 @@ void decodmd_type1_device::device_reset()
m_rom = memregion(m_gfxtag);
memset(RAM,0,0x2000);
memset(m_pixels,0,0x200);
memset(m_pixels,0,0x200*sizeof(uint32_t));
ROM = m_rom->base();
m_rombank1->configure_entries(0, 8, &ROM[0x0000], 0x4000);

View File

@ -144,7 +144,7 @@ WRITE8_MEMBER(pc4_state::lcd_control_w)
READ8_MEMBER(pc4_state::lcd_control_r)
{
return m_busy_flag<<7 || m_ac&0x7f;
return (m_busy_flag<<7) | (m_ac & 0x7f);
}
void pc4_state::update_ac(void)