From f18ec20dd5a8d0d863638dfdff185fd260dc5c8d Mon Sep 17 00:00:00 2001 From: Robbbert Date: Sat, 12 Mar 2022 22:59:26 +1100 Subject: Addressed a few coverity concerns. --- src/mame/drivers/a5105.cpp | 6 +++--- src/mame/drivers/a7150.cpp | 6 +++--- src/mame/drivers/ac1.cpp | 2 +- src/mame/drivers/altos5.cpp | 2 +- src/mame/drivers/apogee.cpp | 6 +++--- src/mame/drivers/bmjr.cpp | 10 +++++----- src/mame/drivers/homez80.cpp | 24 ++++++++++++------------ src/mame/drivers/junior80.cpp | 2 +- src/mame/drivers/jupiter.cpp | 2 +- src/mame/drivers/k1003.cpp | 6 +++--- src/mame/drivers/kramermc.cpp | 2 +- src/mame/drivers/max80.cpp | 2 +- src/mame/drivers/mccpm.cpp | 2 +- src/mame/drivers/micromon.cpp | 2 +- src/mame/drivers/mkit09.cpp | 2 +- src/mame/drivers/mod8.cpp | 6 +++--- src/mame/drivers/pes.cpp | 4 ++-- src/mame/drivers/rotaryf.cpp | 4 ++-- src/mame/drivers/s6.cpp | 2 +- src/mame/drivers/sm1800.cpp | 2 +- src/mame/drivers/squale.cpp | 14 +++++++------- src/mame/drivers/techno.cpp | 4 ++-- src/mame/drivers/tm990189.cpp | 14 +++++++------- 23 files changed, 63 insertions(+), 63 deletions(-) diff --git a/src/mame/drivers/a5105.cpp b/src/mame/drivers/a5105.cpp index 8ed4d735dea..4bad245982c 100644 --- a/src/mame/drivers/a5105.cpp +++ b/src/mame/drivers/a5105.cpp @@ -86,9 +86,9 @@ private: void a5105_mem(address_map &map); void upd7220_map(address_map &map); - uint8_t *m_ram_base; - uint8_t *m_rom_base; - uint8_t *m_char_ram; + uint8_t *m_ram_base = 0; + uint8_t *m_rom_base = 0; + uint8_t *m_char_ram = 0; uint16_t m_pcg_addr = 0U; uint16_t m_pcg_internal_addr = 0U; uint8_t m_key_mux = 0U; diff --git a/src/mame/drivers/a7150.cpp b/src/mame/drivers/a7150.cpp index 486de00403a..faf67818acf 100644 --- a/src/mame/drivers/a7150.cpp +++ b/src/mame/drivers/a7150.cpp @@ -91,9 +91,9 @@ private: void kbd_put(uint8_t data); void kgs_memory_remap(); - bool m_kgs_msel, m_kgs_iml; - uint8_t m_kgs_datao, m_kgs_datai, m_kgs_ctrl; - bool m_ifss_loopback; + bool m_kgs_msel = 0, m_kgs_iml = 0; + uint8_t m_kgs_datao = 0, m_kgs_datai = 0, m_kgs_ctrl = 0; + bool m_ifss_loopback = 0; uint32_t screen_update_k7072(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void screen_eof(screen_device &screen, bool state); diff --git a/src/mame/drivers/ac1.cpp b/src/mame/drivers/ac1.cpp index ea8fae0c277..921c56ececa 100644 --- a/src/mame/drivers/ac1.cpp +++ b/src/mame/drivers/ac1.cpp @@ -53,7 +53,7 @@ private: u32 screen_update_ac1_32(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); u8 ac1_port_b_r(); u8 ac1_port_a_r(); - bool has_lowercase; + bool has_lowercase = 0; void machine_start() override; void ac1_port_a_w(u8 data); void ac1_port_b_w(u8 data); diff --git a/src/mame/drivers/altos5.cpp b/src/mame/drivers/altos5.cpp index 126b840d60c..a662e4fcbc5 100644 --- a/src/mame/drivers/altos5.cpp +++ b/src/mame/drivers/altos5.cpp @@ -73,7 +73,7 @@ private: uint8_t m_port09 = 0U; bool m_ipl = 0; offs_t m_curr_bank = 0; - floppy_image_device *m_floppy; + floppy_image_device *m_floppy = 0; std::unique_ptr m_ram; // main ram 192k std::unique_ptr m_dummy; // for wrpt required_device m_maincpu; diff --git a/src/mame/drivers/apogee.cpp b/src/mame/drivers/apogee.cpp index 9ab9017a128..5fb80a2ba65 100644 --- a/src/mame/drivers/apogee.cpp +++ b/src/mame/drivers/apogee.cpp @@ -36,9 +36,9 @@ public: void apogee(machine_config &config); private: - uint8_t m_out0; - uint8_t m_out1; - uint8_t m_out2; + uint8_t m_out0 = 0U; + uint8_t m_out1 = 0U; + uint8_t m_out2 = 0U; DECLARE_WRITE_LINE_MEMBER(pit8253_out0_changed); DECLARE_WRITE_LINE_MEMBER(pit8253_out1_changed); DECLARE_WRITE_LINE_MEMBER(pit8253_out2_changed); diff --git a/src/mame/drivers/bmjr.cpp b/src/mame/drivers/bmjr.cpp index 93f0fedcf4c..28809861c8e 100644 --- a/src/mame/drivers/bmjr.cpp +++ b/src/mame/drivers/bmjr.cpp @@ -51,11 +51,11 @@ private: void xor_display_w(u8 data); u32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void mem_map(address_map &map); - bool m_tape_switch; - u8 m_xor_display; - u8 m_key_mux; - u16 m_casscnt; - bool m_cassold, m_cassbit; + bool m_tape_switch = 0; + u8 m_xor_display = 0U; + u8 m_key_mux = 0U; + u16 m_casscnt = 0U; + bool m_cassold = 0, m_cassbit = 0; TIMER_DEVICE_CALLBACK_MEMBER(kansas_r); virtual void machine_start() override; virtual void machine_reset() override; diff --git a/src/mame/drivers/homez80.cpp b/src/mame/drivers/homez80.cpp index c6e339af789..53b423d53d5 100644 --- a/src/mame/drivers/homez80.cpp +++ b/src/mame/drivers/homez80.cpp @@ -2,21 +2,21 @@ // copyright-holders:Miodrag Milanovic /*************************************************************************** - Homebrew Z80 Computer by Kun-Szabo Marton +Homebrew Z80 Computer by Kun-Szabo Marton - http://digitarworld.uw.hu/z80.htm +http://digitarworld.uw.hu/z80.htm - 31/10/2010 Initial driver by Miodrag Milanovic +2010-10-31 Initial driver by Miodrag Milanovic - All commands must be entered in uppercase, and since the capslock - doesn't work, you need to hold the shift key down. +All commands must be entered in uppercase, and since the capslock + doesn't work, you need to hold the shift key down. - There is next to no error checking, for example the T command - is to set the time. Entering T by itself will set the time to - 99:99:99, while G will cause a jump to 9999 and so forth. Also - the parameter must be right next to the command, spaces will cause - invalid input. Example M1234 will display a byte of memory at 1234, - while M 1234 will display memory at 9123. +There is next to no error checking, for example the T command + is to set the time. Entering T by itself will set the time to + 99:99:99, while G will cause a jump to 9999 and so forth. Also + the parameter must be right next to the command, spaces will cause + invalid input. Example M1234 will display a byte of memory at 1234, + while M 1234 will display memory at 9123. ****************************************************************************/ @@ -47,7 +47,7 @@ private: void mem_map(address_map &map); - bool m_irq; + bool m_irq = 0; void machine_reset() override; void machine_start() override; required_device m_maincpu; diff --git a/src/mame/drivers/junior80.cpp b/src/mame/drivers/junior80.cpp index 55cff38889d..a4c136a7584 100644 --- a/src/mame/drivers/junior80.cpp +++ b/src/mame/drivers/junior80.cpp @@ -165,7 +165,7 @@ private: void drive_w(offs_t offset, u8 data); - floppy_image_device *m_floppy; + floppy_image_device *m_floppy = 0; required_device m_maincpu; required_device m_ctc; required_device m_dma; diff --git a/src/mame/drivers/jupiter.cpp b/src/mame/drivers/jupiter.cpp index c5eaaae1245..6bf5bb7f341 100644 --- a/src/mame/drivers/jupiter.cpp +++ b/src/mame/drivers/jupiter.cpp @@ -101,7 +101,7 @@ private: void jupiter3_io(address_map &map); void jupiter3_mem(address_map &map); - uint8_t m_term_data; + uint8_t m_term_data = 0U; required_device m_maincpu; required_shared_ptr m_p_videoram; required_shared_ptr m_p_ram; diff --git a/src/mame/drivers/k1003.cpp b/src/mame/drivers/k1003.cpp index 7c7cd729421..861e4880cf3 100644 --- a/src/mame/drivers/k1003.cpp +++ b/src/mame/drivers/k1003.cpp @@ -54,9 +54,9 @@ private: void io_map(address_map &map); void mem_map(address_map &map); - uint8_t m_disp_1; - uint8_t m_disp_2; - u8 m_digit; + uint8_t m_disp_1 = 0U; + uint8_t m_disp_2 = 0U; + u8 m_digit = 0U; uint8_t bit_to_dec(uint8_t val); void machine_start() override; required_device m_maincpu; diff --git a/src/mame/drivers/kramermc.cpp b/src/mame/drivers/kramermc.cpp index 8a4032e5843..13ef6bb5b2e 100644 --- a/src/mame/drivers/kramermc.cpp +++ b/src/mame/drivers/kramermc.cpp @@ -80,7 +80,7 @@ public: void init_kramermc(); private: - u8 m_porta; + u8 m_porta = 0U; virtual void machine_start() override; virtual void machine_reset() override; uint32_t screen_update_kramermc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); diff --git a/src/mame/drivers/max80.cpp b/src/mame/drivers/max80.cpp index c60c76dc935..e5b6f0f0ae9 100644 --- a/src/mame/drivers/max80.cpp +++ b/src/mame/drivers/max80.cpp @@ -131,7 +131,7 @@ private: bool m_fdc_int = 0; bool m_allow_nmi = 0; u8 m_mode = 0U; - floppy_image_device *m_floppy; + floppy_image_device *m_floppy = 0; required_device m_maincpu; //required_region_ptr m_p_chargen; //required_shared_ptr m_p_vram; diff --git a/src/mame/drivers/mccpm.cpp b/src/mame/drivers/mccpm.cpp index e70d50897e5..621a1cf3b98 100644 --- a/src/mame/drivers/mccpm.cpp +++ b/src/mame/drivers/mccpm.cpp @@ -65,7 +65,7 @@ private: template void bd_q_w(offs_t offset, u8 data); u8 m_fdc_status = 0U; - floppy_image_device *m_floppy; + floppy_image_device *m_floppy = 0; required_device m_maincpu; required_device m_bank; diff --git a/src/mame/drivers/micromon.cpp b/src/mame/drivers/micromon.cpp index c9e1e45fc73..7c8e3c497f2 100644 --- a/src/mame/drivers/micromon.cpp +++ b/src/mame/drivers/micromon.cpp @@ -40,7 +40,7 @@ private: void mem_map(address_map &map); virtual void machine_reset() override; - uint8_t m_resetcnt; + uint8_t m_resetcnt = 0U; required_device m_maincpu; }; diff --git a/src/mame/drivers/mkit09.cpp b/src/mame/drivers/mkit09.cpp index 2fef381d402..492daf03619 100644 --- a/src/mame/drivers/mkit09.cpp +++ b/src/mame/drivers/mkit09.cpp @@ -66,7 +66,7 @@ public: protected: u8 pa_r(); u8 pb_r(); - u8 m_digit; + u8 m_digit = 0U; u8 m_seg = 0U; void machine_reset() override; void machine_start() override; diff --git a/src/mame/drivers/mod8.cpp b/src/mame/drivers/mod8.cpp index 6ce16207aab..87604626d4c 100644 --- a/src/mame/drivers/mod8.cpp +++ b/src/mame/drivers/mod8.cpp @@ -78,9 +78,9 @@ private: void io_map(address_map &map); void mem_map(address_map &map); - uint16_t m_tty_data_out; - uint8_t m_tty_data_in; - int m_tty_cnt; + uint16_t m_tty_data_out = 0U; + uint8_t m_tty_data_in = 0U; + int m_tty_cnt = 0; void machine_start() override; required_device m_teleprinter; required_device m_maincpu; diff --git a/src/mame/drivers/pes.cpp b/src/mame/drivers/pes.cpp index 3728fe719c3..545c23397c6 100644 --- a/src/mame/drivers/pes.cpp +++ b/src/mame/drivers/pes.cpp @@ -82,8 +82,8 @@ public: private: - u8 m_term_data; - u8 m_port3; + u8 m_term_data = 0U; + u8 m_port3 = 0U; virtual void machine_reset() override; void port3_w(u8 data); u8 port3_r(); diff --git a/src/mame/drivers/rotaryf.cpp b/src/mame/drivers/rotaryf.cpp index fd7da906eda..9b2786e42a8 100644 --- a/src/mame/drivers/rotaryf.cpp +++ b/src/mame/drivers/rotaryf.cpp @@ -52,8 +52,8 @@ private: void portc_w(uint8_t data); void port30_w(uint8_t data); - bool m_flipscreen; - uint8_t m_last; + bool m_flipscreen = 0; + uint8_t m_last = 0U; virtual void machine_start() override; diff --git a/src/mame/drivers/s6.cpp b/src/mame/drivers/s6.cpp index be361b41eeb..81cc7aaa12c 100644 --- a/src/mame/drivers/s6.cpp +++ b/src/mame/drivers/s6.cpp @@ -123,7 +123,7 @@ private: u8 m_row = 0; bool m_data_ok = 0; u8 m_lamp_data = 0; - emu_timer* m_irq_timer; + emu_timer* m_irq_timer = 0; static const device_timer_id TIMER_IRQ = 0; required_device m_maincpu; required_device m_s6sound; diff --git a/src/mame/drivers/sm1800.cpp b/src/mame/drivers/sm1800.cpp index 949ceb2f7c2..9f70c78868f 100644 --- a/src/mame/drivers/sm1800.cpp +++ b/src/mame/drivers/sm1800.cpp @@ -48,7 +48,7 @@ private: void portc_w(uint8_t data); uint8_t porta_r(); uint8_t portc_r(); - uint8_t m_irq_state; + uint8_t m_irq_state = 0U; void machine_start() override; void sm1800_palette(palette_device &palette) const; INTERRUPT_GEN_MEMBER(vblank_interrupt); diff --git a/src/mame/drivers/squale.cpp b/src/mame/drivers/squale.cpp index 17ef6158c09..f4bacd6f278 100644 --- a/src/mame/drivers/squale.cpp +++ b/src/mame/drivers/squale.cpp @@ -152,13 +152,13 @@ private: virtual void machine_start() override; virtual void machine_reset() override; - uint8_t keyboard_line; - uint8_t fdc_sel0; - uint8_t fdc_sel1; + uint8_t keyboard_line = 0U; + uint8_t fdc_sel0 = 0U; + uint8_t fdc_sel1 = 0U; - uint8_t cart_addr_counter_inc_ck; - uint8_t cart_addr_counter_reset; - uint16_t cart_addr_counter; + uint8_t cart_addr_counter_inc_ck = 0U; + uint8_t cart_addr_counter_reset = 0U; + uint16_t cart_addr_counter = 0U; TIMER_DEVICE_CALLBACK_MEMBER(squale_scanline); @@ -176,7 +176,7 @@ private: floppy_image_device *m_floppy; required_device m_cart; - memory_region *m_cart_rom; + memory_region *m_cart_rom = 0; }; /***************************************** diff --git a/src/mame/drivers/techno.cpp b/src/mame/drivers/techno.cpp index f6af05fbd3e..4fec24f50b7 100644 --- a/src/mame/drivers/techno.cpp +++ b/src/mame/drivers/techno.cpp @@ -91,8 +91,8 @@ private: output_finder<48> m_digits; output_finder<96> m_io_outputs; // 64 lamps + 32 solenoids - emu_timer *m_irq_set_timer; - emu_timer *m_irq_advance_timer; + emu_timer *m_irq_set_timer = 0; + emu_timer *m_irq_advance_timer = 0; bool m_digwait = 0; u8 m_keyrow = 0U; diff --git a/src/mame/drivers/tm990189.cpp b/src/mame/drivers/tm990189.cpp index 167a83dfa9a..ee9c3673305 100644 --- a/src/mame/drivers/tm990189.cpp +++ b/src/mame/drivers/tm990189.cpp @@ -142,7 +142,7 @@ private: DECLARE_MACHINE_START(tm990_189_v); DECLARE_MACHINE_RESET(tm990_189_v); - emu_timer *m_rs232_input_timer; + emu_timer *m_rs232_input_timer = 0; void tm990_189_cru_map(address_map &map); void tm990_189_memmap(address_map &map); @@ -172,15 +172,15 @@ private: int m_digitsel = 0; int m_segment = 0; - emu_timer *m_displayena_timer; + emu_timer *m_displayena_timer = 0; uint8_t m_segment_state[10]{}; uint8_t m_old_segment_state[10]{}; uint8_t m_LED_state = 0U; - emu_timer *m_joy1x_timer; - emu_timer *m_joy1y_timer; - emu_timer *m_joy2x_timer; - emu_timer *m_joy2y_timer; - device_image_interface *m_rs232_fp; + emu_timer *m_joy1x_timer = 0; + emu_timer *m_joy1y_timer = 0; + emu_timer *m_joy2x_timer = 0; + emu_timer *m_joy2y_timer = 0; + device_image_interface *m_rs232_fp = 0; //uint8_t m_rs232_rts; uint8_t m_bogus_read_save = 0U; }; -- cgit v1.2.3