diff --git a/Machines/Apple/Macintosh/Macintosh.cpp b/Machines/Apple/Macintosh/Macintosh.cpp index 35424a2f31..cf1f65981b 100644 --- a/Machines/Apple/Macintosh/Macintosh.cpp +++ b/Machines/Apple/Macintosh/Macintosh.cpp @@ -91,8 +91,8 @@ template class ConcreteMachin mc68000_(*this), iwm_(CLOCK_RATE), video_(audio_, drive_speed_accumulator_), - via_(via_port_handler_), via_port_handler_(*this, clock_, keyboard_, audio_, iwm_, mouse_), + via_(via_port_handler_), scsi_bus_(CLOCK_RATE * 2), scsi_(scsi_bus_, CLOCK_RATE * 2), hard_drive_(scsi_bus_, 6 /* SCSI ID */), @@ -760,8 +760,8 @@ template class ConcreteMachin Apple::Clock::SerialClock clock_; Keyboard keyboard_; - MOS::MOS6522::MOS6522 via_; VIAPortHandler via_port_handler_; + MOS::MOS6522::MOS6522 via_; Zilog::SCC::z8530 scc_; SCSI::Bus scsi_bus_; diff --git a/Machines/Commodore/Vic-20/Vic20.cpp b/Machines/Commodore/Vic-20/Vic20.cpp index 89c1bb1dcc..181eb8cc9b 100644 --- a/Machines/Commodore/Vic-20/Vic20.cpp +++ b/Machines/Commodore/Vic-20/Vic20.cpp @@ -233,8 +233,8 @@ class Vic6560BusHandler { } // It is assumed that these pointers have been filled in by the machine. - uint8_t *video_memory_map[16]; // Segments video memory into 1kb portions. - uint8_t *colour_memory; // Colour memory must be contiguous. + uint8_t *video_memory_map[16]{}; // Segments video memory into 1kb portions. + uint8_t *colour_memory{}; // Colour memory must be contiguous. }; /*! diff --git a/Machines/MSX/MSX.cpp b/Machines/MSX/MSX.cpp index acf3fffa97..66dae2aa45 100644 --- a/Machines/MSX/MSX.cpp +++ b/Machines/MSX/MSX.cpp @@ -198,10 +198,10 @@ class ConcreteMachine: public: ConcreteMachine(const Target &target, const ROMMachine::ROMFetcher &rom_fetcher): z80_(*this), - i8255_(i8255_port_handler_), tape_player_(3579545 * 2), i8255_port_handler_(*this, speaker_.audio_toggle, tape_player_), ay_port_handler_(tape_player_), + i8255_(i8255_port_handler_), memory_slots_{{*this}, {*this}, {*this}, {*this}}, clock_(ClockRate) { set_clock_rate(ClockRate); @@ -913,7 +913,6 @@ class ConcreteMachine: CPU::Z80::Processor z80_; JustInTimeActor> vdp_; - Intel::i8255::i8255 i8255_; Storage::Tape::BinaryTapePlayer tape_player_; bool tape_player_is_sleeping_ = false; @@ -932,6 +931,8 @@ class ConcreteMachine: Speaker speaker_; AYPortHandler ay_port_handler_; + Intel::i8255::i8255 i8255_; + /// The current primary and secondary slot selections; the former retains whatever was written /// last to the 8255 PPI via port A8 and the latter — if enabled — captures 0xffff on a per-slot basis. uint8_t primary_slots_ = 0; diff --git a/Machines/Oric/Oric.cpp b/Machines/Oric/Oric.cpp index 63f574d629..f10a4e8848 100644 --- a/Machines/Oric/Oric.cpp +++ b/Machines/Oric/Oric.cpp @@ -36,6 +36,7 @@ #include "../../ClockReceiver/JustInTime.hpp" +#include #include #include #include @@ -284,7 +285,7 @@ template rom_, disk_rom_; - uint8_t ram_[65536]; + std::array ram_{}; // ROM bookkeeping uint16_t tape_get_byte_address_ = 0, tape_speed_address_ = 0; diff --git a/OSBindings/SDL/main.cpp b/OSBindings/SDL/main.cpp index 60620adb33..2231268c8d 100644 --- a/OSBindings/SDL/main.cpp +++ b/OSBindings/SDL/main.cpp @@ -444,7 +444,12 @@ std::string final_path_component(const std::string &path) { Executes @c command and returns its STDOUT. */ std::string system_get(const char *command) { - std::unique_ptr pipe(popen(command, "r"), pclose); + struct pcloser { + void operator()(FILE *file) { + pclose(file); + } + }; + std::unique_ptr pipe(popen(command, "r")); if(!pipe) return ""; std::string result;