From 2c2b8dccc837faa3b37b0cdcfb1e428e073c6c64 Mon Sep 17 00:00:00 2001 From: Robbbert Date: Fri, 25 Mar 2022 23:38:20 +1100 Subject: init vars for coverity (drivers/i) --- src/mame/drivers/i7000.cpp | 4 ++-- src/mame/drivers/ibm6580.cpp | 22 +++++++++++----------- src/mame/drivers/ibmpcjr.cpp | 38 +++++++++++++++++++------------------- src/mame/drivers/icecold.cpp | 18 +++++++++--------- src/mame/drivers/igs009.cpp | 14 +++++++------- src/mame/drivers/igs017.cpp | 2 +- src/mame/drivers/igspoker.cpp | 14 +++++++------- src/mame/drivers/indigo.cpp | 2 +- src/mame/drivers/indy_indigo2.cpp | 4 ++-- src/mame/drivers/instantm.cpp | 4 ++-- src/mame/drivers/interpro.cpp | 20 ++++++++++---------- src/mame/drivers/invqix.cpp | 2 +- src/mame/drivers/iphone2g.cpp | 38 +++++++++++++++++++------------------- src/mame/drivers/irisha.cpp | 12 ++++++------ src/mame/drivers/istrebiteli.cpp | 14 +++++++------- src/mame/drivers/itgambl2.cpp | 6 +++--- src/mame/drivers/itgambl3.cpp | 6 +++--- src/mame/drivers/itt3030.cpp | 6 +++--- src/mame/drivers/itt9216.cpp | 2 +- 19 files changed, 114 insertions(+), 114 deletions(-) diff --git a/src/mame/drivers/i7000.cpp b/src/mame/drivers/i7000.cpp index b209865ed3a..dbefadee7e9 100644 --- a/src/mame/drivers/i7000.cpp +++ b/src/mame/drivers/i7000.cpp @@ -83,8 +83,8 @@ private: required_ioport_array<8> m_kbd; uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - uint8_t m_row; - tilemap_t *m_bg_tilemap; + uint8_t m_row = 0; + tilemap_t *m_bg_tilemap = nullptr; TILE_GET_INFO_MEMBER(get_bg_tile_info); MC6845_ON_UPDATE_ADDR_CHANGED(crtc_addr); diff --git a/src/mame/drivers/ibm6580.cpp b/src/mame/drivers/ibm6580.cpp index fa9aaa011ca..1651408d33d 100644 --- a/src/mame/drivers/ibm6580.cpp +++ b/src/mame/drivers/ibm6580.cpp @@ -263,24 +263,24 @@ private: void mcu_io(address_map &map); void mcu_mem(address_map &map); - uint16_t m_gate; - uint8_t m_dma0pg; - uint8_t m_p40, m_p4a, m_p50; - uint8_t m_kb_data, m_ppi_c, m_led_state; - bool m_e000; - bool m_kb_data_bit, m_kb_strobe, m_kb_clock; + uint16_t m_gate = 0; + uint8_t m_dma0pg = 0; + uint8_t m_p40 = 0, m_p4a = 0, m_p50 = 0; + uint8_t m_kb_data = 0, m_ppi_c = 0, m_led_state = 0; + bool m_e000 = false; + bool m_kb_data_bit = false, m_kb_strobe = false, m_kb_clock = false; - uint8_t m_mcu_p1, m_mcu_p2; - uint8_t m_mcuppi_a, m_mcuppi_b, m_mcuppi_c; + uint8_t m_mcu_p1 = 0, m_mcu_p2 = 0; + uint8_t m_mcuppi_a = 0, m_mcuppi_b = 0, m_mcuppi_c = 0; void mcu_io_w(offs_t offset, uint8_t data); uint8_t mcu_io_r(offs_t offset); void mcuppi_c_w(uint8_t data); - bool m_floppy_intrq, m_floppy_idle; - uint8_t m_floppy_mcu_wrap; - struct { floppy_image_device *image; bool hdl; } m_floppy[2]; + bool m_floppy_intrq = false, m_floppy_idle = false; + uint8_t m_floppy_mcu_wrap = 0; + struct { floppy_image_device *image = nullptr; bool hdl = false; } m_floppy[2]; required_shared_ptr m_p_videoram; required_device m_ram; diff --git a/src/mame/drivers/ibmpcjr.cpp b/src/mame/drivers/ibmpcjr.cpp index b48687bc24f..b2dded4d58b 100644 --- a/src/mame/drivers/ibmpcjr.cpp +++ b/src/mame/drivers/ibmpcjr.cpp @@ -82,27 +82,27 @@ private: DECLARE_DEVICE_IMAGE_LOAD_MEMBER(cart2_load) { return load_cart(image, m_cart2); } void pc_speaker_set_spkrdata(uint8_t data); - uint8_t m_pc_spkrdata; - uint8_t m_pit_out2; - uint8_t m_pcjr_dor; - uint8_t m_pcjx_1ff_count; - uint8_t m_pcjx_1ff_val; - uint8_t m_pcjx_1ff_bankval; - uint8_t m_pcjx_1ff_bank[20][2]; - int m_ppi_portc_switch_high; - uint8_t m_ppi_portb; - - uint8_t m_pc_keyb_data; - uint8_t m_transferring; - uint8_t m_latch; - uint32_t m_raw_keyb_data; - int m_signal_count; - uint8_t m_nmi_enabled; + uint8_t m_pc_spkrdata = 0; + uint8_t m_pit_out2 = 0; + uint8_t m_pcjr_dor = 0; + uint8_t m_pcjx_1ff_count = 0; + uint8_t m_pcjx_1ff_val = 0; + uint8_t m_pcjx_1ff_bankval = 0; + uint8_t m_pcjx_1ff_bank[20][2]{}; + int m_ppi_portc_switch_high = 0; + uint8_t m_ppi_portb = 0; + + uint8_t m_pc_keyb_data = 0; + uint8_t m_transferring = 0; + uint8_t m_latch = 0; + uint32_t m_raw_keyb_data = 0; + int m_signal_count = 0; + uint8_t m_nmi_enabled = 0; virtual void device_timer(emu_timer &timer, device_timer_id id, int param) override; - emu_timer *m_pc_int_delay_timer; - emu_timer *m_pcjr_watchdog; - emu_timer *m_keyb_signal_timer; + emu_timer *m_pc_int_delay_timer = nullptr; + emu_timer *m_pcjr_watchdog = nullptr; + emu_timer *m_keyb_signal_timer = nullptr; enum { diff --git a/src/mame/drivers/icecold.cpp b/src/mame/drivers/icecold.cpp index e2da445893c..a2913d1056a 100644 --- a/src/mame/drivers/icecold.cpp +++ b/src/mame/drivers/icecold.cpp @@ -84,17 +84,17 @@ private: output_finder<> m_tilt_output; output_finder<> m_start_output; - uint8_t m_digit; // scanlines from i8279 - uint8_t m_sound_latch; // sound bus latch - uint8_t m_ay_ctrl; // ay controls line - uint8_t m_motors_ctrl; // motors control - int m_sint; // SINT line - int m_motenbl; // /MOTENBL line - int m_ball_gate_sw; // ball gate switch + uint8_t m_digit = 0; // scanlines from i8279 + uint8_t m_sound_latch = 0; // sound bus latch + uint8_t m_ay_ctrl = 0; // ay controls line + uint8_t m_motors_ctrl = 0; // motors control + int m_sint = 0; // SINT line + int m_motenbl = 0; // /MOTENBL line + int m_ball_gate_sw = 0; // ball gate switch // motors positions - int m_rmotor; // right motor position (0-100) - int m_lmotor; // left motor position (0-100) + int m_rmotor = 0; // right motor position (0-100) + int m_lmotor = 0; // left motor position (0-100) TIMER_DEVICE_CALLBACK_MEMBER(icecold_sint_timer); TIMER_DEVICE_CALLBACK_MEMBER(icecold_motors_timer); void icecold_map(address_map &map); diff --git a/src/mame/drivers/igs009.cpp b/src/mame/drivers/igs009.cpp index b505423c7f8..858bb86d6da 100644 --- a/src/mame/drivers/igs009.cpp +++ b/src/mame/drivers/igs009.cpp @@ -107,13 +107,13 @@ private: required_shared_ptr m_fg_color_ram; output_finder<7> m_leds; - tilemap_t *m_reel_tilemap[4]; - tilemap_t *m_fg_tilemap; - int m_video_enable; - int m_nmi_enable; - int m_hopper; - uint8_t m_out[3]; - uint8_t m_igs_magic[2]; + tilemap_t *m_reel_tilemap[4]{}; + tilemap_t *m_fg_tilemap = nullptr; + int m_video_enable = 0; + int m_nmi_enable = 0; + int m_hopper = 0; + uint8_t m_out[3]{}; + uint8_t m_igs_magic[2]{}; }; diff --git a/src/mame/drivers/igs017.cpp b/src/mame/drivers/igs017.cpp index 8dbdbe27915..bc5cedc85a9 100644 --- a/src/mame/drivers/igs017.cpp +++ b/src/mame/drivers/igs017.cpp @@ -410,7 +410,7 @@ protected: virtual void device_reset() override; private: - u8 m_val; + u8 m_val = 0; }; void igs_incdec_device::reset_w(u8 data) diff --git a/src/mame/drivers/igspoker.cpp b/src/mame/drivers/igspoker.cpp index 0c1a588d7b4..a6b77a220c5 100644 --- a/src/mame/drivers/igspoker.cpp +++ b/src/mame/drivers/igspoker.cpp @@ -169,13 +169,13 @@ private: required_device m_palette; output_finder<> m_led; output_finder<6> m_lamps; - int m_nmi_enable; - int m_bg_enable; - int m_hopper; - tilemap_t *m_fg_tilemap; - tilemap_t *m_bg_tilemap; - uint8_t m_out[3]; - uint8_t m_protection_res; + int m_nmi_enable = 0; + int m_bg_enable = 0; + int m_hopper = 0; + tilemap_t *m_fg_tilemap = nullptr; + tilemap_t *m_bg_tilemap = nullptr; + uint8_t m_out[3]{}; + uint8_t m_protection_res = 0; }; diff --git a/src/mame/drivers/indigo.cpp b/src/mame/drivers/indigo.cpp index 8f21674e6af..996a55419a6 100644 --- a/src/mame/drivers/indigo.cpp +++ b/src/mame/drivers/indigo.cpp @@ -60,7 +60,7 @@ protected: required_device m_eeprom; std::unique_ptr m_dsp_ram; required_device m_light; - address_space *m_space; + address_space *m_space = nullptr; }; class indigo3k_state : public indigo_state diff --git a/src/mame/drivers/indy_indigo2.cpp b/src/mame/drivers/indy_indigo2.cpp index 4673409196f..740e4cf8905 100644 --- a/src/mame/drivers/indy_indigo2.cpp +++ b/src/mame/drivers/indy_indigo2.cpp @@ -151,8 +151,8 @@ protected: optional_device m_gio64_exp0; optional_device m_gio64_exp1; - uint8_t m_volume_l; - uint8_t m_volume_r; + uint8_t m_volume_l = 0; + uint8_t m_volume_r = 0; }; class ip22_state : public ip24_state diff --git a/src/mame/drivers/instantm.cpp b/src/mame/drivers/instantm.cpp index 62da3a350fc..0089da7b754 100644 --- a/src/mame/drivers/instantm.cpp +++ b/src/mame/drivers/instantm.cpp @@ -49,8 +49,8 @@ private: void sub_io(address_map &map); void sub_map(address_map &map); - u8 m_port01; - bool m_clock_en; + u8 m_port01 = 0; + bool m_clock_en = false; virtual void machine_start() override; virtual void machine_reset() override; required_device m_maincpu; diff --git a/src/mame/drivers/interpro.cpp b/src/mame/drivers/interpro.cpp index ec6f07e2ac7..a8f6daef2ab 100644 --- a/src/mame/drivers/interpro.cpp +++ b/src/mame/drivers/interpro.cpp @@ -358,11 +358,11 @@ protected: virtual void machine_reset() override; output_finder<> m_diag_led; - emu_timer *m_reset_timer; + emu_timer *m_reset_timer = nullptr; - u16 m_error; - u16 m_status; - u16 m_led; + u16 m_error = 0; + u16 m_status = 0; + u16 m_led = 0; }; class emerald_state : public interpro_state @@ -427,8 +427,8 @@ protected: virtual void machine_reset() override; private: - u16 m_ctrl1; - u16 m_ctrl2; + u16 m_ctrl1 = 0; + u16 m_ctrl2 = 0; }; class turquoise_state : public interpro_state @@ -497,8 +497,8 @@ protected: virtual void machine_reset() override; private: - u16 m_ctrl1; - u16 m_ctrl2; + u16 m_ctrl1 = 0; + u16 m_ctrl2 = 0; }; class sapphire_state : public interpro_state @@ -562,8 +562,8 @@ protected: virtual void machine_reset() override; private: - u16 m_ctrl1; - u16 m_ctrl2; + u16 m_ctrl1 = 0; + u16 m_ctrl2 = 0; }; class cbus_sapphire_state : public sapphire_state diff --git a/src/mame/drivers/invqix.cpp b/src/mame/drivers/invqix.cpp index 6a51d9e74c6..321287fb0fc 100644 --- a/src/mame/drivers/invqix.cpp +++ b/src/mame/drivers/invqix.cpp @@ -163,7 +163,7 @@ private: // driver_device overrides virtual void video_start() override; - uint16_t m_vctl; // 0000 for normal, 0001 for flip, 0100 when going to change (blank?) + uint16_t m_vctl = 0; // 0000 for normal, 0001 for flip, 0100 when going to change (blank?) }; diff --git a/src/mame/drivers/iphone2g.cpp b/src/mame/drivers/iphone2g.cpp index 338a7269376..995272bfbce 100644 --- a/src/mame/drivers/iphone2g.cpp +++ b/src/mame/drivers/iphone2g.cpp @@ -42,9 +42,9 @@ private: devcb_write_line m_out_irq_func; - u8 cmd, tx_data; - u32 ctrl; - u16 status; + u8 m_cmd = 0, m_tx_data = 0; + u32 m_ctrl = 0; + u16 m_status = 0; }; DECLARE_DEVICE_TYPE(IPHONE2G_SPI, iphone2g_spi_device) @@ -56,20 +56,20 @@ void iphone2g_spi_device::device_timer(emu_timer &timer, device_timer_id id, int void iphone2g_spi_device::map(address_map &map) { - map(0x00,0x03).lrw32(NAME([this](offs_t offset){ return ctrl; }), NAME([this](offs_t offset, u32 data){ + map(0x00,0x03).lrw32(NAME([this](offs_t offset){ return m_ctrl; }), NAME([this](offs_t offset, u32 data){ if(data & 1) { - status |= 0xfff2; - cmd = tx_data; + m_status |= 0xfff2; + m_cmd = m_tx_data; timer_set(attotime::from_hz(1'000), TIMER_SEND_IRQ); } - ctrl = data; + m_ctrl = data; })); - map(0x08, 0x09).lr16([this](offs_t offset){ return status; }, "status").umask32(0x0000ffff); - map(0x10, 0x10).lrw8(NAME([this](offs_t offset){ return tx_data; }), NAME([this](offs_t offset, u8 data){ tx_data = data; })).umask32(0x000000ff); + map(0x08, 0x09).lr16([this](offs_t offset){ return m_status; }, "status").umask32(0x0000ffff); + map(0x10, 0x10).lrw8(NAME([this](offs_t offset){ return m_tx_data; }), NAME([this](offs_t offset, u8 data){ m_tx_data = data; })).umask32(0x000000ff); map(0x20, 0x20).lr8([this](offs_t offset){ // FIXME: make this less hacky - switch(cmd) + switch(m_cmd) { case 0x95: return 0x01; case 0xda: return 0x71; @@ -95,15 +95,15 @@ void iphone2g_spi_device::device_resolve_objects() void iphone2g_spi_device::device_start() { - save_item(NAME(cmd)); - save_item(NAME(ctrl)); - save_item(NAME(tx_data)); - save_item(NAME(status)); + save_item(NAME(m_cmd)); + save_item(NAME(m_ctrl)); + save_item(NAME(m_tx_data)); + save_item(NAME(m_status)); } void iphone2g_spi_device::device_reset() { - cmd = ctrl= status = tx_data = 0; + m_cmd = m_ctrl= m_status = m_tx_data = 0; } DEFINE_DEVICE_TYPE(IPHONE2G_SPI, iphone2g_spi_device, "iphone2g_spi", "iPhone 2G SPI controller") @@ -151,12 +151,12 @@ private: struct timer { - u16 config; - u8 state; - u32 count_buffer[2], count; + u16 config = 0; + u8 state = 0; + u32 count_buffer[2]{}, count = 0; } timers[7]; - u64 ticks; + //u64 m_ticks = 0; not used }; DECLARE_DEVICE_TYPE(IPHONE2G_TIMER, iphone2g_timer_device) diff --git a/src/mame/drivers/irisha.cpp b/src/mame/drivers/irisha.cpp index 0a51a6b624e..b2365a11a6a 100644 --- a/src/mame/drivers/irisha.cpp +++ b/src/mame/drivers/irisha.cpp @@ -63,12 +63,12 @@ private: void io_map(address_map &map); void mem_map(address_map &map); - bool m_sg1_line; - bool m_keypressed; - uint8_t m_keyboard_cnt; - uint8_t m_ppi_porta; - uint8_t m_ppi_portc; - emu_timer *m_key_timer; + bool m_sg1_line = false; + bool m_keypressed = false; + uint8_t m_keyboard_cnt = 0; + uint8_t m_ppi_porta = 0; + uint8_t m_ppi_portc = 0; + emu_timer *m_key_timer = nullptr; void update_speaker(); void machine_start() override; void machine_reset() override; diff --git a/src/mame/drivers/istrebiteli.cpp b/src/mame/drivers/istrebiteli.cpp index 06872e1ad7a..018d4675fab 100644 --- a/src/mame/drivers/istrebiteli.cpp +++ b/src/mame/drivers/istrebiteli.cpp @@ -192,16 +192,16 @@ private: required_device m_sound_dev; TILE_GET_INFO_MEMBER(get_tile_info); - tilemap_t *m_tilemap; + tilemap_t *m_tilemap = nullptr; uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); uint32_t moto_screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - uint8_t coin_count; - uint8_t m_spr_ctrl[2]; - uint8_t m_spr_collision[2]; - uint8_t m_spr_xy[8]; - uint8_t m_tileram[16]; - uint8_t m_road_scroll; + uint8_t coin_count = 0; + uint8_t m_spr_ctrl[2]{}; + uint8_t m_spr_collision[2]{}; + uint8_t m_spr_xy[8]{}; + uint8_t m_tileram[16]{}; + uint8_t m_road_scroll = 0; void io_map(address_map &map); void mem_map(address_map &map); diff --git a/src/mame/drivers/itgambl2.cpp b/src/mame/drivers/itgambl2.cpp index 26d1107f089..435a21ffaa7 100644 --- a/src/mame/drivers/itgambl2.cpp +++ b/src/mame/drivers/itgambl2.cpp @@ -82,9 +82,9 @@ protected: private: required_device m_maincpu; required_device m_palette; - int m_test_x; - int m_test_y; - int m_start_offs; + int m_test_x = 0; + int m_test_y = 0; + int m_start_offs = 0; void itgambl2_palette(palette_device &palette) const; uint32_t screen_update_itgambl2(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); diff --git a/src/mame/drivers/itgambl3.cpp b/src/mame/drivers/itgambl3.cpp index ea119054d62..a4aee2632f3 100644 --- a/src/mame/drivers/itgambl3.cpp +++ b/src/mame/drivers/itgambl3.cpp @@ -66,9 +66,9 @@ protected: virtual void video_start() override; private: - int m_test_x; - int m_test_y; - int m_start_offs; + int m_test_x = 0; + int m_test_y = 0; + int m_start_offs = 0; required_device m_maincpu; required_device m_palette; diff --git a/src/mame/drivers/itt3030.cpp b/src/mame/drivers/itt3030.cpp index 26c9d91ed0a..358bfcc453c 100644 --- a/src/mame/drivers/itt3030.cpp +++ b/src/mame/drivers/itt3030.cpp @@ -282,11 +282,11 @@ private: // shared pointers required_shared_ptr m_vram; - uint8_t m_kbdclk, m_kbdread, m_kbdport2; + uint8_t m_kbdclk = 0, m_kbdread = 0, m_kbdport2 = 0; required_device m_gfxdecode; required_device m_palette; - floppy_image_device *m_curfloppy; - bool m_fdc_irq, m_fdc_drq, m_fdc_hld; + floppy_image_device *m_curfloppy = nullptr; + bool m_fdc_irq = false, m_fdc_drq = false, m_fdc_hld = false; }; //************************************************************************** diff --git a/src/mame/drivers/itt9216.cpp b/src/mame/drivers/itt9216.cpp index 225f5fb7833..f0ad255a1f6 100644 --- a/src/mame/drivers/itt9216.cpp +++ b/src/mame/drivers/itt9216.cpp @@ -38,7 +38,7 @@ private: required_region_ptr m_chargen; std::unique_ptr m_mainram; - bool m_rom_enabled; + bool m_rom_enabled = true; }; void itt9216_state::machine_start() -- cgit v1.2.3