From 267006782f72ac0e8a8e14844084021c21ce2036 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Sat, 30 May 2020 00:37:06 -0400 Subject: [PATCH] Starts to add Qt target; resolves many build warnings. --- Activity/Observer.hpp | 10 +- .../Implementation/MultiProducer.hpp | 2 +- Analyser/Static/AtariST/StaticAnalyser.cpp | 2 +- Analyser/Static/Oric/StaticAnalyser.cpp | 2 +- Components/1770/1770.cpp | 6 +- Components/1770/1770.hpp | 1 + Components/5380/ncr5380.cpp | 4 +- Components/6522/6522.hpp | 12 +- .../Implementation/IRQDelegatePortHandler.cpp | 2 +- Components/6532/6532.hpp | 8 +- Components/6560/6560.hpp | 2 +- Components/8255/i8255.hpp | 6 +- Components/8272/i8272.cpp | 6 +- Components/8272/i8272.hpp | 5 +- Components/9918/Implementation/9918Base.hpp | 6 +- Components/AY38910/AY38910.hpp | 4 +- Components/AudioToggle/AudioToggle.cpp | 2 +- Components/DiskII/DiskII.cpp | 2 +- Components/DiskII/IWM.hpp | 2 +- Components/KonamiSCC/KonamiSCC.hpp | 1 - Inputs/Joystick.hpp | 7 +- Inputs/Mouse.hpp | 4 +- Machines/AmstradCPC/AmstradCPC.cpp | 8 +- Machines/AmstradCPC/AmstradCPC.hpp | 2 +- Machines/Apple/AppleII/AppleII.hpp | 2 +- Machines/Apple/AppleII/Card.hpp | 4 +- Machines/Apple/AppleII/DiskIICard.cpp | 4 +- Machines/Apple/AppleII/Video.hpp | 2 +- Machines/Apple/Macintosh/Keyboard.hpp | 2 +- Machines/Apple/Macintosh/Macintosh.cpp | 10 +- Machines/Atari/2600/Atari2600.cpp | 2 +- Machines/Atari/2600/Cartridges/Cartridge.hpp | 2 +- Machines/Atari/2600/Cartridges/Pitfall2.hpp | 1 - Machines/Atari/2600/TIA.cpp | 2 +- Machines/Atari/2600/TIA.hpp | 10 +- Machines/Atari/ST/AtariST.cpp | 4 +- Machines/Commodore/1540/C1540.hpp | 2 +- .../Commodore/1540/Implementation/C1540.cpp | 10 +- Machines/Commodore/SerialBus.hpp | 1 + Machines/Commodore/Vic-20/Vic20.cpp | 6 +- Machines/Electron/Electron.cpp | 2 +- Machines/Electron/Plus3.hpp | 4 +- Machines/KeyboardMachine.hpp | 4 +- Machines/MSX/DiskROM.cpp | 6 +- Machines/MSX/MSX.cpp | 2 +- Machines/MSX/ROMSlotHandler.hpp | 4 +- Machines/Oric/Oric.cpp | 8 +- Machines/ScanProducer.hpp | 2 +- Machines/Utility/Typer.hpp | 4 +- Machines/ZX8081/Video.hpp | 1 + .../Mac/Clock Signal/Machine/NSData+CRC32.m | 4 +- .../Clock SignalTests/68000ArithmeticTests.mm | 4 +- .../Mac/Clock SignalTests/68000BCDTests.mm | 2 +- .../Clock SignalTests/68000BitwiseTests.mm | 2 +- .../68000ControlFlowTests.mm | 2 +- .../Mac/Clock SignalTests/68000MoveTests.mm | 2 +- .../Clock SignalTests/68000RollShiftTests.mm | 2 +- .../Mac/Clock SignalTests/68000Tests.mm | 2 +- .../Mac/Clock SignalTests/EmuTOSTests.mm | 8 +- OSBindings/Qt/ClockSignal.pro | 143 ++++++++++++++++++ OSBindings/Qt/ClockSignal_en_GB.ts | 3 + OSBindings/Qt/main.cpp | 11 ++ OSBindings/Qt/mainwindow.cpp | 15 ++ OSBindings/Qt/mainwindow.h | 21 +++ OSBindings/Qt/mainwindow.ui | 22 +++ Outputs/CRT/CRT.hpp | 4 +- Outputs/OpenGL/ScanTarget.cpp | 6 +- Outputs/OpenGL/ScanTargetGLSLFragments.cpp | 2 +- Outputs/ScanTarget.hpp | 12 +- .../Speaker/Implementation/CompoundSource.hpp | 2 +- .../Speaker/Implementation/LowpassSpeaker.hpp | 2 +- .../Speaker/Implementation/SampleSource.hpp | 4 +- Outputs/Speaker/Speaker.hpp | 4 +- Processors/6502/6502.hpp | 2 +- Processors/68000/68000.hpp | 6 +- .../68000/Implementation/68000Storage.hpp | 4 +- Processors/Z80/Implementation/Z80Storage.hpp | 14 +- Processors/Z80/Z80.hpp | 10 +- Reflection/Struct.cpp | 14 +- Reflection/Struct.hpp | 2 +- SignalProcessing/FIRFilter.hpp | 5 +- Storage/Disk/Controller/DiskController.cpp | 2 +- Storage/Disk/DiskImage/DiskImage.hpp | 2 +- Storage/Disk/Drive.hpp | 6 +- Storage/MassStorage/MassStorageDevice.hpp | 2 +- Storage/MassStorage/SCSI/Target.hpp | 10 +- Storage/Tape/Formats/CSW.cpp | 2 +- Storage/Tape/Parsers/Acorn.cpp | 1 - Storage/Tape/Parsers/Acorn.hpp | 1 - Storage/Tape/Tape.cpp | 2 +- Storage/Tape/Tape.hpp | 1 + Storage/TimedEventLoop.hpp | 2 +- 92 files changed, 395 insertions(+), 179 deletions(-) create mode 100644 OSBindings/Qt/ClockSignal.pro create mode 100644 OSBindings/Qt/ClockSignal_en_GB.ts create mode 100644 OSBindings/Qt/main.cpp create mode 100644 OSBindings/Qt/mainwindow.cpp create mode 100644 OSBindings/Qt/mainwindow.h create mode 100644 OSBindings/Qt/mainwindow.ui diff --git a/Activity/Observer.hpp b/Activity/Observer.hpp index 349511123..bcc3071fa 100644 --- a/Activity/Observer.hpp +++ b/Activity/Observer.hpp @@ -24,13 +24,13 @@ namespace Activity { class Observer { public: /// Announces to the receiver that there is an LED of name @c name. - virtual void register_led(const std::string &name) {} + virtual void register_led([[maybe_unused]] const std::string &name) {} /// Announces to the receiver that there is a drive of name @c name. - virtual void register_drive(const std::string &name) {} + virtual void register_drive([[maybe_unused]] const std::string &name) {} /// Informs the receiver of the new state of the LED with name @c name. - virtual void set_led_status(const std::string &name, bool lit) {} + virtual void set_led_status([[maybe_unused]] const std::string &name, [[maybe_unused]] bool lit) {} enum class DriveEvent { StepNormal, @@ -39,10 +39,10 @@ class Observer { }; /// Informs the receiver that the named event just occurred for the drive with name @c name. - virtual void announce_drive_event(const std::string &name, DriveEvent event) {} + virtual void announce_drive_event([[maybe_unused]] const std::string &name, [[maybe_unused]] DriveEvent event) {} /// Informs the receiver of the motor-on status of the drive with name @c name. - virtual void set_drive_motor_status(const std::string &name, bool is_on) {} + virtual void set_drive_motor_status([[maybe_unused]] const std::string &name, [[maybe_unused]] bool is_on) {} }; } diff --git a/Analyser/Dynamic/MultiMachine/Implementation/MultiProducer.hpp b/Analyser/Dynamic/MultiMachine/Implementation/MultiProducer.hpp index 30507fef6..543e24e5b 100644 --- a/Analyser/Dynamic/MultiMachine/Implementation/MultiProducer.hpp +++ b/Analyser/Dynamic/MultiMachine/Implementation/MultiProducer.hpp @@ -69,7 +69,7 @@ class MultiTimedMachine: public MultiInterface, publ void run_for(Time::Seconds duration) final; private: - void run_for(const Cycles cycles) final {} + void run_for(const Cycles) final {} Delegate *delegate_ = nullptr; }; diff --git a/Analyser/Static/AtariST/StaticAnalyser.cpp b/Analyser/Static/AtariST/StaticAnalyser.cpp index 47d3dba8a..f0524b353 100644 --- a/Analyser/Static/AtariST/StaticAnalyser.cpp +++ b/Analyser/Static/AtariST/StaticAnalyser.cpp @@ -9,7 +9,7 @@ #include "StaticAnalyser.hpp" #include "Target.hpp" -Analyser::Static::TargetList Analyser::Static::AtariST::GetTargets(const Media &media, const std::string &file_name, TargetPlatform::IntType potential_platforms) { +Analyser::Static::TargetList Analyser::Static::AtariST::GetTargets(const Media &media, const std::string &, TargetPlatform::IntType) { // This analyser can comprehend disks and mass-storage devices only. if(media.disks.empty()) return {}; diff --git a/Analyser/Static/Oric/StaticAnalyser.cpp b/Analyser/Static/Oric/StaticAnalyser.cpp index 22d607f29..2077ec265 100644 --- a/Analyser/Static/Oric/StaticAnalyser.cpp +++ b/Analyser/Static/Oric/StaticAnalyser.cpp @@ -145,7 +145,7 @@ bool is_bd500(Storage::Encodings::MFM::Parser &parser) { } -Analyser::Static::TargetList Analyser::Static::Oric::GetTargets(const Media &media, const std::string &file_name, TargetPlatform::IntType potential_platforms) { +Analyser::Static::TargetList Analyser::Static::Oric::GetTargets(const Media &media, const std::string &, TargetPlatform::IntType) { auto target = std::make_unique(); target->confidence = 0.5; diff --git a/Components/1770/1770.cpp b/Components/1770/1770.cpp index 3f8cf9a85..2845155cd 100644 --- a/Components/1770/1770.cpp +++ b/Components/1770/1770.cpp @@ -498,7 +498,7 @@ void WD1770::posit_event(int new_event_type) { if(get_crc_generator().get_value()) { LOG("CRC error; terminating"); - update_status([this] (Status &status) { + update_status([] (Status &status) { status.crc_error = true; }); goto wait_for_command; @@ -816,8 +816,8 @@ void WD1770::update_status(std::function updater) { if(status_.busy != old_status.busy) update_clocking_observer(); } -void WD1770::set_head_load_request(bool head_load) {} -void WD1770::set_motor_on(bool motor_on) {} +void WD1770::set_head_load_request(bool) {} +void WD1770::set_motor_on(bool) {} void WD1770::set_head_loaded(bool head_loaded) { head_is_loaded_ = head_loaded; diff --git a/Components/1770/1770.hpp b/Components/1770/1770.hpp index 877d33050..0c25edeb2 100644 --- a/Components/1770/1770.hpp +++ b/Components/1770/1770.hpp @@ -31,6 +31,7 @@ class WD1770: public Storage::Disk::MFMController { @param p The type of controller to emulate. */ WD1770(Personality p); + virtual ~WD1770() {} /// Sets the value of the double-density input; when @c is_double_density is @c true, reads and writes double-density format data. using Storage::Disk::MFMController::set_is_double_density; diff --git a/Components/5380/ncr5380.cpp b/Components/5380/ncr5380.cpp index 6084b1e79..81bb6883a 100644 --- a/Components/5380/ncr5380.cpp +++ b/Components/5380/ncr5380.cpp @@ -20,7 +20,7 @@ NCR5380::NCR5380(SCSI::Bus &bus, int clock_rate) : bus_.add_observer(this); } -void NCR5380::write(int address, uint8_t value, bool dma_acknowledge) { +void NCR5380::write(int address, uint8_t value, bool) { switch(address & 7) { case 0: // LOG("[SCSI 0] Set current SCSI bus state to " << PADHEX(2) << int(value)); @@ -128,7 +128,7 @@ void NCR5380::write(int address, uint8_t value, bool dma_acknowledge) { } } -uint8_t NCR5380::read(int address, bool dma_acknowledge) { +uint8_t NCR5380::read(int address, bool) { switch(address & 7) { case 0: // LOG("[SCSI 0] Get current SCSI bus state: " << PADHEX(2) << (bus_.get_state() & 0xff)); diff --git a/Components/6522/6522.hpp b/Components/6522/6522.hpp index 4ab35e558..8e0811e66 100644 --- a/Components/6522/6522.hpp +++ b/Components/6522/6522.hpp @@ -37,22 +37,22 @@ enum Line { class PortHandler { public: /// Requests the current input value of @c port from the port handler. - uint8_t get_port_input(Port port) { return 0xff; } + uint8_t get_port_input([[maybe_unused]] Port port) { return 0xff; } /// Sets the current output value of @c port and provides @c direction_mask, indicating which pins are marked as output. - void set_port_output(Port port, uint8_t value, uint8_t direction_mask) {} + void set_port_output([[maybe_unused]] Port port, [[maybe_unused]] uint8_t value, [[maybe_unused]] uint8_t direction_mask) {} /// Sets the current logical output level for line @c line on port @c port. - void set_control_line_output(Port port, Line line, bool value) {} + void set_control_line_output([[maybe_unused]] Port port, [[maybe_unused]] Line line, [[maybe_unused]] bool value) {} /// Sets the current logical value of the interrupt line. - void set_interrupt_status(bool status) {} + void set_interrupt_status([[maybe_unused]] bool status) {} /// Provides a measure of time elapsed between other calls. - void run_for(HalfCycles duration) {} + void run_for([[maybe_unused]] HalfCycles duration) {} /// Receives passed-on flush() calls from the 6522. - void flush() {} + void flush() {} }; /*! diff --git a/Components/6522/Implementation/IRQDelegatePortHandler.cpp b/Components/6522/Implementation/IRQDelegatePortHandler.cpp index 320026aba..54e80c75b 100644 --- a/Components/6522/Implementation/IRQDelegatePortHandler.cpp +++ b/Components/6522/Implementation/IRQDelegatePortHandler.cpp @@ -14,6 +14,6 @@ void IRQDelegatePortHandler::set_interrupt_delegate(Delegate *delegate) { delegate_ = delegate; } -void IRQDelegatePortHandler::set_interrupt_status(bool new_status) { +void IRQDelegatePortHandler::set_interrupt_status(bool) { if(delegate_) delegate_->mos6522_did_change_interrupt_status(this); } diff --git a/Components/6532/6532.hpp b/Components/6532/6532.hpp index 059905546..4607e1a8e 100644 --- a/Components/6532/6532.hpp +++ b/Components/6532/6532.hpp @@ -173,9 +173,11 @@ template class MOS6532 { bool interrupt_line_ = false; // expected to be overridden - uint8_t get_port_input(int port) { return 0xff; } - void set_port_output(int port, uint8_t value, uint8_t output_mask) {} - void set_irq_line(bool new_value) {} + void set_port_output([[maybe_unused]] int port, [[maybe_unused]] uint8_t value, [[maybe_unused]] uint8_t output_mask) {} + uint8_t get_port_input([[maybe_unused]] int port) { + return 0xff; + } + void set_irq_line(bool) {} inline void evaluate_interrupts() { interrupt_line_ = diff --git a/Components/6560/6560.hpp b/Components/6560/6560.hpp index c89ad8c2e..76f2c7d4d 100644 --- a/Components/6560/6560.hpp +++ b/Components/6560/6560.hpp @@ -43,7 +43,7 @@ class AudioGenerator: public ::Outputs::Speaker::SampleSource { }; struct BusHandler { - void perform_read(uint16_t address, uint8_t *pixel_data, uint8_t *colour_data) { + void perform_read([[maybe_unused]] uint16_t address, [[maybe_unused]] uint8_t *pixel_data, [[maybe_unused]] uint8_t *colour_data) { *pixel_data = 0xff; *colour_data = 0xff; } diff --git a/Components/8255/i8255.hpp b/Components/8255/i8255.hpp index 4d2451c59..d8e2a42f6 100644 --- a/Components/8255/i8255.hpp +++ b/Components/8255/i8255.hpp @@ -9,13 +9,15 @@ #ifndef i8255_hpp #define i8255_hpp +#include + namespace Intel { namespace i8255 { class PortHandler { public: - void set_value(int port, uint8_t value) {} - uint8_t get_value(int port) { return 0xff; } + void set_value([[maybe_unused]] int port, [[maybe_unused]] uint8_t value) {} + uint8_t get_value([[maybe_unused]] int port) { return 0xff; } }; // TODO: Modes 1 and 2. diff --git a/Components/8272/i8272.cpp b/Components/8272/i8272.cpp index 95cf6af72..5c9c617b9 100644 --- a/Components/8272/i8272.cpp +++ b/Components/8272/i8272.cpp @@ -880,13 +880,13 @@ bool i8272::seek_is_satisfied(int drive) { (drives_[drive].target_head_position == -1 && get_drive().get_is_track_zero()); } -void i8272::set_dma_acknowledge(bool dack) { +void i8272::set_dma_acknowledge(bool) { } -void i8272::set_terminal_count(bool tc) { +void i8272::set_terminal_count(bool) { } -void i8272::set_data_input(uint8_t value) { +void i8272::set_data_input(uint8_t) { } uint8_t i8272::get_data_output() { diff --git a/Components/8272/i8272.hpp b/Components/8272/i8272.hpp index cde43e1ee..6b8371883 100644 --- a/Components/8272/i8272.hpp +++ b/Components/8272/i8272.hpp @@ -20,8 +20,9 @@ namespace i8272 { class BusHandler { public: - virtual void set_dma_data_request(bool drq) {} - virtual void set_interrupt(bool irq) {} + virtual ~BusHandler() {} + virtual void set_dma_data_request([[maybe_unused]] bool drq) {} + virtual void set_interrupt([[maybe_unused]] bool irq) {} }; class i8272 : public Storage::Disk::MFMController { diff --git a/Components/9918/Implementation/9918Base.hpp b/Components/9918/Implementation/9918Base.hpp index 6fff286da..5003527ae 100644 --- a/Components/9918/Implementation/9918Base.hpp +++ b/Components/9918/Implementation/9918Base.hpp @@ -40,7 +40,7 @@ enum class TVStandard { class Base { public: - static const uint32_t palette_pack(uint8_t r, uint8_t g, uint8_t b) { + static uint32_t palette_pack(uint8_t r, uint8_t g, uint8_t b) { uint32_t result = 0; uint8_t *const result_ptr = reinterpret_cast(&result); result_ptr[0] = r; @@ -449,7 +449,7 @@ class Base { /*********************************************** - TMS9918 Fetching Code + TMS9918 Fetching Code ************************************************/ template void fetch_tms_refresh(int start, int end) { @@ -693,7 +693,7 @@ class Base { /*********************************************** - Master System Fetching Code + Master System Fetching Code ************************************************/ template void fetch_sms(int start, int end) { diff --git a/Components/AY38910/AY38910.hpp b/Components/AY38910/AY38910.hpp index 5e04d91f5..34a8302fd 100644 --- a/Components/AY38910/AY38910.hpp +++ b/Components/AY38910/AY38910.hpp @@ -30,7 +30,7 @@ class PortHandler { @param port_b @c true if the input being queried is Port B. @c false if it is Port A. */ - virtual uint8_t get_port_input(bool port_b) { + virtual uint8_t get_port_input([[maybe_unused]] bool port_b) { return 0xff; } @@ -40,7 +40,7 @@ class PortHandler { @param port_b @c true if the output being posted is Port B. @c false if it is Port A. @param value the value now being output. */ - virtual void set_port_output(bool port_b, uint8_t value) {} + virtual void set_port_output([[maybe_unused]] bool port_b, [[maybe_unused]] uint8_t value) {} }; /*! diff --git a/Components/AudioToggle/AudioToggle.cpp b/Components/AudioToggle/AudioToggle.cpp index 794fe8bc5..d3bbe90bb 100644 --- a/Components/AudioToggle/AudioToggle.cpp +++ b/Components/AudioToggle/AudioToggle.cpp @@ -23,7 +23,7 @@ void Toggle::set_sample_volume_range(std::int16_t range) { volume_ = range; } -void Toggle::skip_samples(const std::size_t number_of_samples) {} +void Toggle::skip_samples(std::size_t) {} void Toggle::set_output(bool enabled) { if(is_enabled_ == enabled) return; diff --git a/Components/DiskII/DiskII.cpp b/Components/DiskII/DiskII.cpp index 6aa63e519..e223f908d 100644 --- a/Components/DiskII/DiskII.cpp +++ b/Components/DiskII/DiskII.cpp @@ -219,7 +219,7 @@ void DiskII::process_event(const Storage::Disk::Drive::Event &event) { } } -void DiskII::set_component_prefers_clocking(ClockingHint::Source *component, ClockingHint::Preference preference) { +void DiskII::set_component_prefers_clocking(ClockingHint::Source *, ClockingHint::Preference) { drive_is_sleeping_[0] = drives_[0].preferred_clocking() == ClockingHint::Preference::None; drive_is_sleeping_[1] = drives_[1].preferred_clocking() == ClockingHint::Preference::None; decide_clocking_preference(); diff --git a/Components/DiskII/IWM.hpp b/Components/DiskII/IWM.hpp index b3c7ec82e..a5e391a30 100644 --- a/Components/DiskII/IWM.hpp +++ b/Components/DiskII/IWM.hpp @@ -24,7 +24,7 @@ namespace Apple { Defines the drive interface used by the IWM, derived from the external pinout as per e.g. https://old.pinouts.ru/HD/MacExtDrive_pinout.shtml - These are subclassed of Storage::Disk::Drive, so accept any disk the emulator supports, + These are subclasses of Storage::Disk::Drive, so accept any disk the emulator supports, and provide the usual read/write interface for on-disk data. */ struct IWMDrive: public Storage::Disk::Drive { diff --git a/Components/KonamiSCC/KonamiSCC.hpp b/Components/KonamiSCC/KonamiSCC.hpp index edb3882eb..f08bc5619 100644 --- a/Components/KonamiSCC/KonamiSCC.hpp +++ b/Components/KonamiSCC/KonamiSCC.hpp @@ -61,7 +61,6 @@ class SCC: public ::Outputs::Speaker::SampleSource { } waves_[4]; std::uint8_t channel_enable_ = 0; - std::uint8_t test_register_ = 0; void evaluate_output_volume(); diff --git a/Inputs/Joystick.hpp b/Inputs/Joystick.hpp index 3d0313f78..baa1a6e67 100644 --- a/Inputs/Joystick.hpp +++ b/Inputs/Joystick.hpp @@ -216,11 +216,8 @@ class ConcreteJoystick: public Joystick { } protected: - virtual void did_set_input(const Input &input, float value) { - } - - virtual void did_set_input(const Input &input, bool value) { - } + virtual void did_set_input([[maybe_unused]] const Input &input, [[maybe_unused]] float value) {} + virtual void did_set_input([[maybe_unused]] const Input &input, [[maybe_unused]] bool value) {} private: const std::vector inputs_; diff --git a/Inputs/Mouse.hpp b/Inputs/Mouse.hpp index 2d6fe7a82..5ea3ec8b8 100644 --- a/Inputs/Mouse.hpp +++ b/Inputs/Mouse.hpp @@ -20,7 +20,7 @@ class Mouse { /*! Indicates a movement of the mouse. */ - virtual void move(int x, int y) {} + virtual void move([[maybe_unused]] int x, [[maybe_unused]] int y) {} /*! @returns the number of buttons on this mouse. @@ -34,7 +34,7 @@ class Mouse { The intention is that @c index be semantic, not positional: 0 for the primary button, 1 for the secondary, 2 for the tertiary, etc. */ - virtual void set_button_pressed(int index, bool is_pressed) {} + virtual void set_button_pressed([[maybe_unused]] int index, [[maybe_unused]] bool is_pressed) {} /*! Releases all depressed buttons. diff --git a/Machines/AmstradCPC/AmstradCPC.cpp b/Machines/AmstradCPC/AmstradCPC.cpp index e05d92b95..459a1b88f 100644 --- a/Machines/AmstradCPC/AmstradCPC.cpp +++ b/Machines/AmstradCPC/AmstradCPC.cpp @@ -691,11 +691,11 @@ class FDC: public Intel::i8272::i8272 { get_drive().set_motor_on(on); } - void select_drive(int c) { - // TODO: support more than one drive. + void select_drive(int) { + // TODO: support more than one drive. (and in set_disk) } - void set_disk(std::shared_ptr disk, int drive) { + void set_disk(std::shared_ptr disk, int) { get_drive().set_disk(disk); } @@ -1075,7 +1075,7 @@ template class ConcreteMachine: return !media.tapes.empty() || (!media.disks.empty() && has_fdc); } - void set_component_prefers_clocking(ClockingHint::Source *component, ClockingHint::Preference clocking) final { + void set_component_prefers_clocking(ClockingHint::Source *, ClockingHint::Preference) final { fdc_is_sleeping_ = fdc_.preferred_clocking() == ClockingHint::Preference::None; tape_player_is_sleeping_ = tape_player_.preferred_clocking() == ClockingHint::Preference::None; } diff --git a/Machines/AmstradCPC/AmstradCPC.hpp b/Machines/AmstradCPC/AmstradCPC.hpp index 56c1186a2..b12a8c08a 100644 --- a/Machines/AmstradCPC/AmstradCPC.hpp +++ b/Machines/AmstradCPC/AmstradCPC.hpp @@ -32,7 +32,7 @@ class Machine { class Options: public Reflection::StructImpl, public Configurable::DisplayOption { friend Configurable::DisplayOption; public: - Options(Configurable::OptionsType type) : Configurable::DisplayOption(Configurable::Display::RGB) { + Options(Configurable::OptionsType) : Configurable::DisplayOption(Configurable::Display::RGB) { if(needs_declare()) { declare_display_option(); limit_enum(&output, Configurable::Display::RGB, Configurable::Display::CompositeColour, -1); diff --git a/Machines/Apple/AppleII/AppleII.hpp b/Machines/Apple/AppleII/AppleII.hpp index 1e1434f63..e373da4b8 100644 --- a/Machines/Apple/AppleII/AppleII.hpp +++ b/Machines/Apple/AppleII/AppleII.hpp @@ -30,7 +30,7 @@ class Machine { class Options: public Reflection::StructImpl, public Configurable::DisplayOption { friend Configurable::DisplayOption; public: - Options(Configurable::OptionsType type) : Configurable::DisplayOption(Configurable::Display::CompositeColour) { + Options(Configurable::OptionsType) : Configurable::DisplayOption(Configurable::Display::CompositeColour) { if(needs_declare()) { declare_display_option(); limit_enum(&output, Configurable::Display::CompositeMonochrome, Configurable::Display::CompositeColour, -1); diff --git a/Machines/Apple/AppleII/Card.hpp b/Machines/Apple/AppleII/Card.hpp index 7db80b39e..692de839e 100644 --- a/Machines/Apple/AppleII/Card.hpp +++ b/Machines/Apple/AppleII/Card.hpp @@ -54,7 +54,7 @@ class Card { no constraints, that want to be informed of every machine cycle, will receive a call to perform_bus_operation every cycle and should use that for time keeping. */ - virtual void run_for(Cycles half_cycles, int stretches) {} + virtual void run_for([[maybe_unused]] Cycles half_cycles, [[maybe_unused]] int stretches) {} /// Requests a flush of any pending audio or video output. virtual void flush() {} @@ -89,7 +89,7 @@ class Card { } /*! Cards may supply a target for activity observation if desired. */ - virtual void set_activity_observer(Activity::Observer *observer) {} + virtual void set_activity_observer([[maybe_unused]] Activity::Observer *observer) {} struct Delegate { virtual void card_did_change_select_constraints(Card *card) = 0; diff --git a/Machines/Apple/AppleII/DiskIICard.cpp b/Machines/Apple/AppleII/DiskIICard.cpp index eb21ad69f..ef9bd238d 100644 --- a/Machines/Apple/AppleII/DiskIICard.cpp +++ b/Machines/Apple/AppleII/DiskIICard.cpp @@ -50,7 +50,7 @@ void DiskIICard::perform_bus_operation(Select select, bool is_read, uint16_t add } } -void DiskIICard::run_for(Cycles cycles, int stretches) { +void DiskIICard::run_for(Cycles cycles, int) { if(diskii_clocking_preference_ == ClockingHint::Preference::None) return; diskii_.run_for(Cycles(cycles.as_integral() * 2)); } @@ -63,7 +63,7 @@ void DiskIICard::set_activity_observer(Activity::Observer *observer) { diskii_.set_activity_observer(observer); } -void DiskIICard::set_component_prefers_clocking(ClockingHint::Source *component, ClockingHint::Preference preference) { +void DiskIICard::set_component_prefers_clocking(ClockingHint::Source *, ClockingHint::Preference preference) { diskii_clocking_preference_ = preference; set_select_constraints((preference != ClockingHint::Preference::RealTime) ? (IO | Device) : None); } diff --git a/Machines/Apple/AppleII/Video.hpp b/Machines/Apple/AppleII/Video.hpp index 07297222e..d75fd3f4e 100644 --- a/Machines/Apple/AppleII/Video.hpp +++ b/Machines/Apple/AppleII/Video.hpp @@ -29,7 +29,7 @@ class BusHandler { from auxiliary memory to @c auxiliary_target. If the machine has no axiliary memory, it needn't write anything to auxiliary_target. */ - void perform_read(uint16_t address, size_t count, uint8_t *base_target, uint8_t *auxiliary_target) { + void perform_read([[maybe_unused]] uint16_t address, [[maybe_unused]] size_t count, [[maybe_unused]] uint8_t *base_target, [[maybe_unused]] uint8_t *auxiliary_target) { } }; diff --git a/Machines/Apple/Macintosh/Keyboard.hpp b/Machines/Apple/Macintosh/Keyboard.hpp index 241fef658..0ff1d6036 100644 --- a/Machines/Apple/Macintosh/Keyboard.hpp +++ b/Machines/Apple/Macintosh/Keyboard.hpp @@ -135,7 +135,7 @@ class Keyboard { /*! The keyboard expects ~10 µs-frequency ticks, i.e. a clock rate of just around 100 kHz. */ - void run_for(HalfCycles cycle) { + void run_for(HalfCycles) { // TODO: honour the HalfCycles argument. switch(mode_) { default: case Mode::Waiting: return; diff --git a/Machines/Apple/Macintosh/Macintosh.cpp b/Machines/Apple/Macintosh/Macintosh.cpp index 03f025a4c..9ac6791c8 100644 --- a/Machines/Apple/Macintosh/Macintosh.cpp +++ b/Machines/Apple/Macintosh/Macintosh.cpp @@ -183,7 +183,7 @@ template class ConcreteMachin using Microcycle = CPU::MC68000::Microcycle; - forceinline HalfCycles perform_bus_operation(const Microcycle &cycle, int is_supervisor) { + forceinline HalfCycles perform_bus_operation(const Microcycle &cycle, int) { // Advance time. advance_time(cycle.length); @@ -490,7 +490,7 @@ template class ConcreteMachin // MARK: Interrupt updates. - void did_change_interrupt_status(Zilog::SCC::z8530 *sender, bool new_status) final { + void did_change_interrupt_status(Zilog::SCC::z8530 *, bool) final { update_interrupt_input(); } @@ -541,7 +541,7 @@ template class ConcreteMachin private: bool quickboot_ = false; - void set_component_prefers_clocking(ClockingHint::Source *component, ClockingHint::Preference clocking) final { + void set_component_prefers_clocking(ClockingHint::Source *, ClockingHint::Preference) final { scsi_bus_is_clocked_ = scsi_bus_.preferred_clocking() != ClockingHint::Preference::None; } @@ -654,7 +654,7 @@ template class ConcreteMachin using Port = MOS::MOS6522::Port; using Line = MOS::MOS6522::Line; - void set_port_output(Port port, uint8_t value, uint8_t direction_mask) { + void set_port_output(Port port, uint8_t value, uint8_t) { /* Peripheral lines: keyboard data, interrupt configuration. (See p176 [/215]) @@ -745,7 +745,7 @@ template class ConcreteMachin audio_.flush(); } - void set_interrupt_status(bool status) { + void set_interrupt_status(bool) { machine_.update_interrupt_input(); } diff --git a/Machines/Atari/2600/Atari2600.cpp b/Machines/Atari/2600/Atari2600.cpp index 6906b72ab..6aeaa4f9c 100644 --- a/Machines/Atari/2600/Atari2600.cpp +++ b/Machines/Atari/2600/Atari2600.cpp @@ -212,7 +212,7 @@ class ConcreteMachine: using namespace Atari2600; -Machine *Machine::Atari2600(const Analyser::Static::Target *target, const ROMMachine::ROMFetcher &rom_fetcher) { +Machine *Machine::Atari2600(const Analyser::Static::Target *target, const ROMMachine::ROMFetcher &) { const Target *const atari_target = dynamic_cast(target); return new Atari2600::ConcreteMachine(*atari_target); } diff --git a/Machines/Atari/2600/Cartridges/Cartridge.hpp b/Machines/Atari/2600/Cartridges/Cartridge.hpp index 29d07d2ab..60ffafd7b 100644 --- a/Machines/Atari/2600/Cartridges/Cartridge.hpp +++ b/Machines/Atari/2600/Cartridges/Cartridge.hpp @@ -19,7 +19,7 @@ class BusExtender: public CPU::MOS6502::BusHandler { public: BusExtender(uint8_t *rom_base, std::size_t rom_size) : rom_base_(rom_base), rom_size_(rom_size) {} - void advance_cycles(int cycles) {} + void advance_cycles(int) {} protected: uint8_t *rom_base_; diff --git a/Machines/Atari/2600/Cartridges/Pitfall2.hpp b/Machines/Atari/2600/Cartridges/Pitfall2.hpp index c42ac9e7f..daf9ad3ec 100644 --- a/Machines/Atari/2600/Cartridges/Pitfall2.hpp +++ b/Machines/Atari/2600/Cartridges/Pitfall2.hpp @@ -117,7 +117,6 @@ class Pitfall2: public BusExtender { uint16_t featcher_address_[8] = {0, 0, 0, 0, 0, 0, 0, 0}; uint8_t top_[8], bottom_[8], mask_[8] = {0, 0, 0, 0, 0, 0, 0, 0}; - uint8_t music_mode_[3]; uint8_t random_number_generator_ = 0; uint8_t *rom_ptr_; uint8_t audio_channel_[3]; diff --git a/Machines/Atari/2600/TIA.cpp b/Machines/Atari/2600/TIA.cpp index bcadd7f01..7eb35ce40 100644 --- a/Machines/Atari/2600/TIA.cpp +++ b/Machines/Atari/2600/TIA.cpp @@ -586,7 +586,7 @@ template void TIA::perform_motion_step(T &object) { } } -template void TIA::perform_border_motion(T &object, int start, int end) { +template void TIA::perform_border_motion(T &object, int, int end) { while(object.is_moving && object.motion_time < end) perform_motion_step(object); } diff --git a/Machines/Atari/2600/TIA.hpp b/Machines/Atari/2600/TIA.hpp index 0ecf1cb4a..a17736a4d 100644 --- a/Machines/Atari/2600/TIA.hpp +++ b/Machines/Atari/2600/TIA.hpp @@ -239,15 +239,15 @@ class TIA { int size = 1; const bool enqueues = false; - inline void skip_pixels(const int count, int from_horizontal_counter) { + inline void skip_pixels(const int count, int) { pixel_position = std::max(0, pixel_position - count); } - inline void reset_pixels(int copy) { + inline void reset_pixels(int) { pixel_position = size; } - inline void output_pixels(uint8_t *const target, const int count, const uint8_t collision_identity, int from_horizontal_counter) { + inline void output_pixels(uint8_t *const target, const int count, const uint8_t collision_identity, [[maybe_unused]] int from_horizontal_counter) { int output_cursor = 0; while(pixel_position && output_cursor < count) { @@ -257,8 +257,8 @@ class TIA { } } - void dequeue_pixels(uint8_t *const target, const uint8_t collision_identity, const int time_now) {} - void enqueue_pixels(const int start, const int end, int from_horizontal_counter) {} + void dequeue_pixels([[maybe_unused]] uint8_t *const target, [[maybe_unused]] uint8_t collision_identity, [[maybe_unused]] int time_now) {} + void enqueue_pixels([[maybe_unused]] int start, [[maybe_unused]] int end, [[maybe_unused]] int from_horizontal_counter) {} }; // missile state diff --git a/Machines/Atari/ST/AtariST.cpp b/Machines/Atari/ST/AtariST.cpp index 722604358..55dd45d3b 100644 --- a/Machines/Atari/ST/AtariST.cpp +++ b/Machines/Atari/ST/AtariST.cpp @@ -529,7 +529,7 @@ class ConcreteMachine: bool keyboard_needs_clock_ = false; bool mfp_is_realtime_ = false; ClockingHint::Preference dma_clocking_preference_ = ClockingHint::Preference::None; - void set_component_prefers_clocking(ClockingHint::Source *component, ClockingHint::Preference clocking) final { + void set_component_prefers_clocking(ClockingHint::Source *, ClockingHint::Preference) final { // This is being called by one of the components; avoid any time flushing here as that's // already dealt with (and, just to be absolutely sure, to avoid recursive mania). may_defer_acias_ = @@ -580,7 +580,7 @@ class ConcreteMachine: } // MARK - MFP input. - void mfp68901_did_change_interrupt_status(Motorola::MFP68901::MFP68901 *mfp) final { + void mfp68901_did_change_interrupt_status(Motorola::MFP68901::MFP68901 *) final { update_interrupt_input(); } diff --git a/Machines/Commodore/1540/C1540.hpp b/Machines/Commodore/1540/C1540.hpp index a3d17b17d..1b747b1ef 100644 --- a/Machines/Commodore/1540/C1540.hpp +++ b/Machines/Commodore/1540/C1540.hpp @@ -39,7 +39,7 @@ namespace C1540 { /*! Provides an emulation of the C1540. */ -class Machine: public MachineBase { +class Machine final: public MachineBase { public: Machine(Personality personality, const ROMMachine::ROMFetcher &rom_fetcher); diff --git a/Machines/Commodore/1540/Implementation/C1540.cpp b/Machines/Commodore/1540/Implementation/C1540.cpp index 6a553fb33..6a60aa59f 100644 --- a/Machines/Commodore/1540/Implementation/C1540.cpp +++ b/Machines/Commodore/1540/Implementation/C1540.cpp @@ -122,7 +122,7 @@ void MachineBase::set_activity_observer(Activity::Observer *observer) { // MARK: - 6522 delegate -void MachineBase::mos6522_did_change_interrupt_status(void *mos6522) { +void MachineBase::mos6522_did_change_interrupt_status(void *) { // both VIAs are connected to the IRQ line m6502_.set_irq_line(serial_port_VIA_.get_interrupt_line() || drive_VIA_.get_interrupt_line()); } @@ -153,11 +153,11 @@ void MachineBase::process_index_hole() {} // MARK: - Drive VIA delegate -void MachineBase::drive_via_did_step_head(void *driveVIA, int direction) { +void MachineBase::drive_via_did_step_head(void *, int direction) { get_drive().step(Storage::Disk::HeadPosition(direction, 2)); } -void MachineBase::drive_via_did_set_data_density(void *driveVIA, int density) { +void MachineBase::drive_via_did_set_data_density(void *, int density) { set_expected_bit_length(Storage::Encodings::CommodoreGCR::length_of_a_bit_in_time_zone(unsigned(density))); } @@ -170,7 +170,7 @@ uint8_t SerialPortVIA::get_port_input(MOS::MOS6522::Port port) { return 0xff; } -void SerialPortVIA::set_port_output(MOS::MOS6522::Port port, uint8_t value, uint8_t mask) { +void SerialPortVIA::set_port_output(MOS::MOS6522::Port port, uint8_t value, uint8_t) { if(port) { std::shared_ptr<::Commodore::Serial::Port> serialPort = serial_port_.lock(); if(serialPort) { @@ -243,7 +243,7 @@ void DriveVIA::set_control_line_output(MOS::MOS6522::Port port, MOS::MOS6522::Li } } -void DriveVIA::set_port_output(MOS::MOS6522::Port port, uint8_t value, uint8_t direction_mask) { +void DriveVIA::set_port_output(MOS::MOS6522::Port port, uint8_t value, uint8_t) { if(port) { if(previous_port_b_output_ != value) { // record drive motor state diff --git a/Machines/Commodore/SerialBus.hpp b/Machines/Commodore/SerialBus.hpp index 877a86447..52b6288b7 100644 --- a/Machines/Commodore/SerialBus.hpp +++ b/Machines/Commodore/SerialBus.hpp @@ -75,6 +75,7 @@ namespace Serial { class Port { public: Port() : line_levels_{High, High, High, High, High} {} + virtual ~Port() {} /*! Sets the current level of an output line on this serial port. diff --git a/Machines/Commodore/Vic-20/Vic20.cpp b/Machines/Commodore/Vic-20/Vic20.cpp index 9630f2dd4..70ec12dab 100644 --- a/Machines/Commodore/Vic-20/Vic20.cpp +++ b/Machines/Commodore/Vic-20/Vic20.cpp @@ -99,7 +99,7 @@ class UserPortVIA: public MOS::MOS6522::IRQDelegatePortHandler { } /// Receives announcements from the 6522 of user-port output, which might affect what's currently being presented onto the serial bus. - void set_port_output(MOS::MOS6522::Port port, uint8_t value, uint8_t mask) { + void set_port_output(MOS::MOS6522::Port port, uint8_t value, uint8_t) { // Line 7 of port A is inverted and output as serial ATN. if(!port) { std::shared_ptr<::Commodore::Serial::Port> serialPort = serial_port_.lock(); @@ -654,7 +654,7 @@ class ConcreteMachine: return mos6560_.get_speaker(); } - void mos6522_did_change_interrupt_status(void *mos6522) final { + void mos6522_did_change_interrupt_status(void *) final { m6502_.set_nmi_line(user_port_via_.get_interrupt_line()); m6502_.set_irq_line(keyboard_via_.get_interrupt_line()); } @@ -691,7 +691,7 @@ class ConcreteMachine: set_use_fast_tape(); } - void set_component_prefers_clocking(ClockingHint::Source *component, ClockingHint::Preference clocking) final { + void set_component_prefers_clocking(ClockingHint::Source *, ClockingHint::Preference clocking) final { tape_is_sleeping_ = clocking == ClockingHint::Preference::None; set_use_fast_tape(); } diff --git a/Machines/Electron/Electron.cpp b/Machines/Electron/Electron.cpp index 39251917f..1bf54f0f8 100644 --- a/Machines/Electron/Electron.cpp +++ b/Machines/Electron/Electron.cpp @@ -421,7 +421,7 @@ class ConcreteMachine: m6502_.run_for(cycles); } - void tape_did_change_interrupt_status(Tape *tape) final { + void tape_did_change_interrupt_status(Tape *) final { interrupt_status_ = (interrupt_status_ & ~(Interrupt::TransmitDataEmpty | Interrupt::ReceiveDataFull | Interrupt::HighToneDetect)) | tape_.get_interrupt_status(); evaluate_interrupts(); } diff --git a/Machines/Electron/Plus3.hpp b/Machines/Electron/Plus3.hpp index 9d19ce631..8f326c682 100644 --- a/Machines/Electron/Plus3.hpp +++ b/Machines/Electron/Plus3.hpp @@ -14,7 +14,7 @@ namespace Electron { -class Plus3 : public WD::WD1770 { +class Plus3 final : public WD::WD1770 { public: Plus3(); @@ -26,7 +26,7 @@ class Plus3 : public WD::WD1770 { void set_control_register(uint8_t control, uint8_t changes); uint8_t last_control_ = 0; - void set_motor_on(bool on); + void set_motor_on(bool on) override; std::string drive_name(size_t drive); }; diff --git a/Machines/KeyboardMachine.hpp b/Machines/KeyboardMachine.hpp index 1ef6fcec0..6ed5a8fc8 100644 --- a/Machines/KeyboardMachine.hpp +++ b/Machines/KeyboardMachine.hpp @@ -26,7 +26,7 @@ struct KeyActions { Indicates that the key @c key has been either pressed or released, according to the state of @c isPressed. */ - virtual void set_key_state(uint16_t key, bool is_pressed) {} + virtual void set_key_state([[maybe_unused]] uint16_t key, [[maybe_unused]] bool is_pressed) {} /*! Instructs that all keys should now be treated as released. @@ -49,7 +49,7 @@ class KeyboardMachine: public KeyActions { /*! @returns @c true if this machine can type the character @c c as part of a @c type_string; @c false otherwise. */ - virtual bool can_type(char c) const { return false; } + virtual bool can_type([[maybe_unused]] char c) const { return false; } /*! Provides a destination for keyboard input. diff --git a/Machines/MSX/DiskROM.cpp b/Machines/MSX/DiskROM.cpp index e56b6a111..a0c990954 100644 --- a/Machines/MSX/DiskROM.cpp +++ b/Machines/MSX/DiskROM.cpp @@ -17,14 +17,14 @@ DiskROM::DiskROM(const std::vector &rom) : set_is_double_density(true); } -void DiskROM::write(uint16_t address, uint8_t value, bool pc_is_outside_bios) { +void DiskROM::write(uint16_t address, uint8_t value, bool) { switch(address) { case 0x7ff8: case 0x7ff9: case 0x7ffa: case 0x7ffb: WD::WD1770::write(address, value); break; case 0x7ffc: { const int selected_head = value & 1; - for_all_drives([selected_head] (Storage::Disk::Drive &drive, size_t index) { + for_all_drives([selected_head] (Storage::Disk::Drive &drive, size_t) { drive.set_head(selected_head); }); } break; @@ -32,7 +32,7 @@ void DiskROM::write(uint16_t address, uint8_t value, bool pc_is_outside_bios) { set_drive(1 << (value & 1)); const bool drive_motor = value & 0x80; - for_all_drives([drive_motor] (Storage::Disk::Drive &drive, size_t index) { + for_all_drives([drive_motor] (Storage::Disk::Drive &drive, size_t) { drive.set_motor_on(drive_motor); }); } break; diff --git a/Machines/MSX/MSX.cpp b/Machines/MSX/MSX.cpp index 2bd9ee16c..febf9dbba 100644 --- a/Machines/MSX/MSX.cpp +++ b/Machines/MSX/MSX.cpp @@ -662,7 +662,7 @@ class ConcreteMachine: } // MARK: - Sleeper - void set_component_prefers_clocking(ClockingHint::Source *component, ClockingHint::Preference clocking) final { + void set_component_prefers_clocking(ClockingHint::Source *, ClockingHint::Preference) final { tape_player_is_sleeping_ = tape_player_.preferred_clocking() == ClockingHint::Preference::None; set_use_fast_tape(); } diff --git a/Machines/MSX/ROMSlotHandler.hpp b/Machines/MSX/ROMSlotHandler.hpp index 120ce737e..f8c5d6f76 100644 --- a/Machines/MSX/ROMSlotHandler.hpp +++ b/Machines/MSX/ROMSlotHandler.hpp @@ -47,13 +47,13 @@ class ROMSlotHandler { virtual ~ROMSlotHandler() {} /*! Advances time by @c half_cycles. */ - virtual void run_for(HalfCycles half_cycles) {} + virtual void run_for([[maybe_unused]] HalfCycles half_cycles) {} /*! Announces an attempt to write @c value to @c address. */ virtual void write(uint16_t address, uint8_t value, bool pc_is_outside_bios) = 0; /*! Seeks the result of a read at @c address; this is used only if the area is unmapped. */ - virtual uint8_t read(uint16_t address) { return 0xff; } + virtual uint8_t read([[maybe_unused]] uint16_t address) { return 0xff; } enum class WrappingStrategy { /// Repeat causes all accesses to be modulo the size of the ROM. diff --git a/Machines/Oric/Oric.cpp b/Machines/Oric/Oric.cpp index e336148a0..5e56c5037 100644 --- a/Machines/Oric/Oric.cpp +++ b/Machines/Oric/Oric.cpp @@ -155,7 +155,7 @@ class VIAPortHandler: public MOS::MOS6522::IRQDelegatePortHandler { Reponds to changes in the 6522's port output. On an Oric port B sets the tape motor control and the keyboard's active row. Port A is connected to the AY's data bus. */ - void set_port_output(MOS::MOS6522::Port port, uint8_t value, uint8_t direction_mask) { + void set_port_output(MOS::MOS6522::Port port, uint8_t value, uint8_t) { if(port) { keyboard_.set_active_row(value); tape_player_.set_motor_control(value & 0x40); @@ -568,7 +568,7 @@ template class Co } // to satisfy MOS::MOS6522IRQDelegate::Delegate - void mos6522_did_change_interrupt_status(void *mos6522) final { + void mos6522_did_change_interrupt_status(void *) final { set_interrupt_line(); } @@ -608,7 +608,7 @@ template class Co } // WD::WD1770::Delegate - void wd1770_did_change_output(WD::WD1770 *wd1770) final { + void wd1770_did_change_output(WD::WD1770 *) final { set_interrupt_line(); } @@ -648,7 +648,7 @@ template class Co } } - void set_component_prefers_clocking(ClockingHint::Source *component, ClockingHint::Preference preference) final { + void set_component_prefers_clocking(ClockingHint::Source *, ClockingHint::Preference) final { diskii_clocking_preference_ = diskii_.preferred_clocking(); } diff --git a/Machines/ScanProducer.hpp b/Machines/ScanProducer.hpp index 3fbf95839..9bea9a6b0 100644 --- a/Machines/ScanProducer.hpp +++ b/Machines/ScanProducer.hpp @@ -91,7 +91,7 @@ class ScanProducer { /*! Sets the display type. */ - virtual void set_display_type(Outputs::Display::DisplayType display_type) {} + virtual void set_display_type(Outputs::Display::DisplayType) {} /*! Gets the display type. diff --git a/Machines/Utility/Typer.hpp b/Machines/Utility/Typer.hpp index 0e2ed9ef1..5ca3bd57d 100644 --- a/Machines/Utility/Typer.hpp +++ b/Machines/Utility/Typer.hpp @@ -38,7 +38,7 @@ class CharacterMapper { /// that may not be necessary — it'll often depends on whether the machine needs time to /// observe a modifier like shift before it sees the actual keypress. /// @returns @c true if the typer should pause after forwarding @c key; @c false otherwise. - virtual bool needs_pause_after_key(uint16_t key) const { return true; } + virtual bool needs_pause_after_key([[maybe_unused]] uint16_t key) const { return true; } protected: typedef uint16_t KeySequence[16]; @@ -127,7 +127,7 @@ class TypeRecipient: public Typer::Delegate { Provided in order to conform to that part of the Typer::Delegate interface that goes above and beyond KeyboardMachine::Machine; responds to the end of typing by clearing all keys. */ - void typer_reset(Typer *typer) { + void typer_reset(Typer *) override { clear_all_keys(); // It's unsafe to deallocate typer right now, since it is the caller, but also it has a small diff --git a/Machines/ZX8081/Video.hpp b/Machines/ZX8081/Video.hpp index b99e18f33..fff641a32 100644 --- a/Machines/ZX8081/Video.hpp +++ b/Machines/ZX8081/Video.hpp @@ -31,6 +31,7 @@ class Video { /// Advances time by @c half-cycles. void run_for(const HalfCycles); + /// Forces output to catch up to the current output position. void flush(); diff --git a/OSBindings/Mac/Clock Signal/Machine/NSData+CRC32.m b/OSBindings/Mac/Clock Signal/Machine/NSData+CRC32.m index e31513f92..177830c3c 100644 --- a/OSBindings/Mac/Clock Signal/Machine/NSData+CRC32.m +++ b/OSBindings/Mac/Clock Signal/Machine/NSData+CRC32.m @@ -8,12 +8,10 @@ #import "NSData+CRC32.h" -#include - @implementation NSData (StdVector) - (NSNumber *)crc32 { - return @(crc32(crc32(0, Z_NULL, 0), self.bytes, (uInt)self.length)); + return @(crc32(crc32(0, Z_NULL, 0), self.bytes, (uInt)self.length)); } @end diff --git a/OSBindings/Mac/Clock SignalTests/68000ArithmeticTests.mm b/OSBindings/Mac/Clock SignalTests/68000ArithmeticTests.mm index 2dd3c27ad..07fa28df2 100644 --- a/OSBindings/Mac/Clock SignalTests/68000ArithmeticTests.mm +++ b/OSBindings/Mac/Clock SignalTests/68000ArithmeticTests.mm @@ -23,7 +23,7 @@ } - (void)setUp { - _machine = std::make_unique(); + _machine = std::make_unique(); } - (void)tearDown { @@ -1137,7 +1137,7 @@ - (void)testMULU_Imm { self.machine->set_program({ - 0xc4fc, 0xffff // MULU.W #$ffff, D2 + 0xc4fc, 0xffff // MULU.W #$ffff, D2 }); auto state = self.machine->get_processor_state(); state.data[2] = 0xffff; diff --git a/OSBindings/Mac/Clock SignalTests/68000BCDTests.mm b/OSBindings/Mac/Clock SignalTests/68000BCDTests.mm index ac159b25f..1768a0195 100644 --- a/OSBindings/Mac/Clock SignalTests/68000BCDTests.mm +++ b/OSBindings/Mac/Clock SignalTests/68000BCDTests.mm @@ -19,7 +19,7 @@ } - (void)setUp { - _machine = std::make_unique(); + _machine = std::make_unique(); } - (void)tearDown { diff --git a/OSBindings/Mac/Clock SignalTests/68000BitwiseTests.mm b/OSBindings/Mac/Clock SignalTests/68000BitwiseTests.mm index a5908c099..51bea342f 100644 --- a/OSBindings/Mac/Clock SignalTests/68000BitwiseTests.mm +++ b/OSBindings/Mac/Clock SignalTests/68000BitwiseTests.mm @@ -19,7 +19,7 @@ } - (void)setUp { - _machine = std::make_unique(); + _machine = std::make_unique(); } - (void)tearDown { diff --git a/OSBindings/Mac/Clock SignalTests/68000ControlFlowTests.mm b/OSBindings/Mac/Clock SignalTests/68000ControlFlowTests.mm index 6ba2d8d83..947abf8fe 100644 --- a/OSBindings/Mac/Clock SignalTests/68000ControlFlowTests.mm +++ b/OSBindings/Mac/Clock SignalTests/68000ControlFlowTests.mm @@ -20,7 +20,7 @@ } - (void)setUp { - _machine = std::make_unique(); + _machine = std::make_unique(); } - (void)tearDown { diff --git a/OSBindings/Mac/Clock SignalTests/68000MoveTests.mm b/OSBindings/Mac/Clock SignalTests/68000MoveTests.mm index ab34fb094..27fbd04ac 100644 --- a/OSBindings/Mac/Clock SignalTests/68000MoveTests.mm +++ b/OSBindings/Mac/Clock SignalTests/68000MoveTests.mm @@ -19,7 +19,7 @@ } - (void)setUp { - _machine = std::make_unique(); + _machine = std::make_unique(); } - (void)tearDown { diff --git a/OSBindings/Mac/Clock SignalTests/68000RollShiftTests.mm b/OSBindings/Mac/Clock SignalTests/68000RollShiftTests.mm index 21c9497ea..24b85da5b 100644 --- a/OSBindings/Mac/Clock SignalTests/68000RollShiftTests.mm +++ b/OSBindings/Mac/Clock SignalTests/68000RollShiftTests.mm @@ -20,7 +20,7 @@ } - (void)setUp { - _machine = std::make_unique(); + _machine = std::make_unique(); } - (void)tearDown { diff --git a/OSBindings/Mac/Clock SignalTests/68000Tests.mm b/OSBindings/Mac/Clock SignalTests/68000Tests.mm index 716b2e880..dc524b328 100644 --- a/OSBindings/Mac/Clock SignalTests/68000Tests.mm +++ b/OSBindings/Mac/Clock SignalTests/68000Tests.mm @@ -110,7 +110,7 @@ class CPU::MC68000::ProcessorStorageTests { } - (void)setUp { - _machine = std::make_unique(); + _machine = std::make_unique(); } - (void)tearDown { diff --git a/OSBindings/Mac/Clock SignalTests/EmuTOSTests.mm b/OSBindings/Mac/Clock SignalTests/EmuTOSTests.mm index e2157d8ea..785da74c6 100644 --- a/OSBindings/Mac/Clock SignalTests/EmuTOSTests.mm +++ b/OSBindings/Mac/Clock SignalTests/EmuTOSTests.mm @@ -105,15 +105,15 @@ class EmuTOS: public ComparativeBusHandler { - (void)testImage:(NSString *)image trace:(NSString *)trace length:(int)length { const std::vector rom_names = {{"AtariST", "", image.UTF8String, 0, 0 }}; - const auto roms = CSROMFetcher()(rom_names); + const auto roms = CSROMFetcher()(rom_names); NSString *const traceLocation = [[NSBundle bundleForClass:[self class]] pathForResource:trace ofType:@"trace.txt.gz"]; - _machine = std::make_unique(*roms[0], traceLocation.UTF8String); - _machine->run_for(HalfCycles(length)); + _machine = std::make_unique(*roms[0], traceLocation.UTF8String); + _machine->run_for(HalfCycles(length)); } - (void)testEmuTOSStartup { [self testImage:@"etos192uk.img" trace:@"etos192uk" length:313490]; - // TODO: assert that machine is now STOPped. + // TODO: assert that machine is now STOPped. } - (void)testTOSStartup { diff --git a/OSBindings/Qt/ClockSignal.pro b/OSBindings/Qt/ClockSignal.pro new file mode 100644 index 000000000..8142b25bc --- /dev/null +++ b/OSBindings/Qt/ClockSignal.pro @@ -0,0 +1,143 @@ +QT += core gui + +greaterThan(QT_MAJOR_VERSION, 4): QT += widgets + +CONFIG += c++17 + +# Permit multiple source files in different directories to have the same file name. +CONFIG += object_parallel_to_source + +# Ensure ZLib is linked against. +INCLUDEPATH += $$[QT_INSTALL_PREFIX]/src/3rdparty/zlib +LIBS += -lz + +# The following define makes your compiler emit warnings if you use +# any Qt feature that has been marked deprecated (the exact warnings +# depend on your compiler). Please consult the documentation of the +# deprecated API in order to know how to port your code away from it. +DEFINES += QT_DEPRECATED_WARNINGS + +# You can also make your code fail to compile if it uses deprecated APIs. +# In order to do so, uncomment the following line. +# You can also select to disable deprecated APIs only up to a certain version of Qt. +#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 + +SOURCES += \ + ../../Analyser/Dynamic/*.cpp \ + ../../Analyser/Dynamic/MultiMachine/*.cpp \ + ../../Analyser/Dynamic/MultiMachine/Implementation/*.cpp \ +\ + ../../Analyser/Static/*.cpp \ + ../../Analyser/Static/Acorn/*.cpp \ + ../../Analyser/Static/AmstradCPC/*.cpp \ + ../../Analyser/Static/AppleII/*.cpp \ + ../../Analyser/Static/Atari2600/*.cpp \ + ../../Analyser/Static/AtariST/*.cpp \ + ../../Analyser/Static/Coleco/*.cpp \ + ../../Analyser/Static/Commodore/*.cpp \ + ../../Analyser/Static/Disassembler/*.cpp \ + ../../Analyser/Static/DiskII/*.cpp \ + ../../Analyser/Static/Macintosh/*.cpp \ + ../../Analyser/Static/MSX/*.cpp \ + ../../Analyser/Static/Oric/*.cpp \ + ../../Analyser/Static/Sega/*.cpp \ + ../../Analyser/Static/ZX8081/*.cpp \ +\ + ../../Components/1770/*.cpp \ + ../../Components/5380/*.cpp \ + ../../Components/6522/Implementation/*.cpp \ + ../../Components/6560/*.cpp \ + ../../Components/6850/*.cpp \ + ../../Components/68901/*.cpp \ + ../../Components/8272/*.cpp \ + ../../Components/8530/*.cpp \ + ../../Components/9918/*.cpp \ + ../../Components/AudioToggle/*.cpp \ + ../../Components/AY38910/*.cpp \ + ../../Components/DiskII/*.cpp \ + ../../Components/KonamiSCC/*.cpp \ + ../../Components/OPx/*.cpp \ + ../../Components/SN76489/*.cpp \ + ../../Components/Serial/*.cpp \ +\ + ../../Concurrency/*.cpp \ +\ + ../../Inputs/*.cpp \ +\ + ../../Machines/*.cpp \ + ../../Machines/AmstradCPC/*.cpp \ + ../../Machines/Apple/AppleII/*.cpp \ + ../../Machines/Apple/Macintosh/*.cpp \ + ../../Machines/Atari/2600/*.cpp \ + ../../Machines/Atari/ST/*.cpp \ + ../../Machines/ColecoVision/*.cpp \ + ../../Machines/Commodore/*.cpp \ + ../../Machines/Commodore/1540/Implementation/*.cpp \ + ../../Machines/Commodore/Vic-20/*.cpp \ + ../../Machines/Electron/*.cpp \ + ../../Machines/MasterSystem/*.cpp \ + ../../Machines/MSX/*.cpp \ + ../../Machines/Oric/*.cpp \ + ../../Machines/Utility/*.cpp \ + ../../Machines/ZX8081/*.cpp \ +\ + ../../Outputs/*.cpp \ + ../../Outputs/CRT/*.cpp \ + ../../Outputs/OpenGL/*.cpp \ + ../../Outputs/OpenGL/Primitives/*.cpp \ +\ + ../../Processors/6502/Implementation/*.cpp \ + ../../Processors/6502/State/*.cpp \ + ../../Processors/68000/Implementation/*.cpp \ + ../../Processors/68000/State/*.cpp \ + ../../Processors/Z80/Implementation/*.cpp \ + ../../Processors/Z80/State/*.cpp \ +\ + ../../Reflection/*.cpp \ +\ + ../../SignalProcessing/*.cpp \ +\ + ../../Storage/*.cpp \ + ../../Storage/Cartridge/*.cpp \ + ../../Storage/Cartridge/Encodings/*.cpp \ + ../../Storage/Cartridge/Formats/*.cpp \ + ../../Storage/Data/*.cpp \ + ../../Storage/Disk/*.cpp \ + ../../Storage/Disk/Controller/*.cpp \ + ../../Storage/Disk/DiskImage/Formats/*.cpp \ + ../../Storage/Disk/DiskImage/Formats/Utility/*.cpp \ + ../../Storage/Disk/Encodings/*.cpp \ + ../../Storage/Disk/Encodings/AppleGCR/*.cpp \ + ../../Storage/Disk/Encodings/MFM/*.cpp \ + ../../Storage/Disk/Parsers/*.cpp \ + ../../Storage/Disk/Track/*.cpp \ + ../../Storage/MassStorage/*.cpp \ + ../../Storage/MassStorage/Encodings/*.cpp \ + ../../Storage/MassStorage/Formats/*.cpp \ + ../../Storage/MassStorage/SCSI/*.cpp \ + ../../Storage/Tape/*.cpp \ + ../../Storage/Tape/Formats/*.cpp \ + ../../Storage/Tape/Parsers/*.cpp \ +\ + main.cpp \ + mainwindow.cpp + +HEADERS += \ + ../../Activity/*.hpp \ + ../../Analyser/*.hpp \ + ../../Analyser/Dynamic/*.hpp \ + ../../Analyser/Dynamic/MultiMachine/*.hpp \ + ../../Analyser/Dynamic/MultiMachine/Implementation/*.hpp \ + ../../ClockReceiver/*.hpp \ + mainwindow.h + +FORMS += \ + mainwindow.ui + +TRANSLATIONS += \ + ClockSignal_en_GB.ts + +# Default rules for deployment. +qnx: target.path = /tmp/$${TARGET}/bin +else: unix:!android: target.path = /opt/$${TARGET}/bin +!isEmpty(target.path): INSTALLS += target diff --git a/OSBindings/Qt/ClockSignal_en_GB.ts b/OSBindings/Qt/ClockSignal_en_GB.ts new file mode 100644 index 000000000..469cab634 --- /dev/null +++ b/OSBindings/Qt/ClockSignal_en_GB.ts @@ -0,0 +1,3 @@ + + + diff --git a/OSBindings/Qt/main.cpp b/OSBindings/Qt/main.cpp new file mode 100644 index 000000000..fd3e53341 --- /dev/null +++ b/OSBindings/Qt/main.cpp @@ -0,0 +1,11 @@ +#include "mainwindow.h" + +#include + +int main(int argc, char *argv[]) +{ + QApplication a(argc, argv); + MainWindow w; + w.show(); + return a.exec(); +} diff --git a/OSBindings/Qt/mainwindow.cpp b/OSBindings/Qt/mainwindow.cpp new file mode 100644 index 000000000..41a26bdf8 --- /dev/null +++ b/OSBindings/Qt/mainwindow.cpp @@ -0,0 +1,15 @@ +#include "mainwindow.h" +#include "ui_mainwindow.h" + +MainWindow::MainWindow(QWidget *parent) + : QMainWindow(parent) + , ui(new Ui::MainWindow) +{ + ui->setupUi(this); +} + +MainWindow::~MainWindow() +{ + delete ui; +} + diff --git a/OSBindings/Qt/mainwindow.h b/OSBindings/Qt/mainwindow.h new file mode 100644 index 000000000..4643e322a --- /dev/null +++ b/OSBindings/Qt/mainwindow.h @@ -0,0 +1,21 @@ +#ifndef MAINWINDOW_H +#define MAINWINDOW_H + +#include + +QT_BEGIN_NAMESPACE +namespace Ui { class MainWindow; } +QT_END_NAMESPACE + +class MainWindow : public QMainWindow +{ + Q_OBJECT + +public: + MainWindow(QWidget *parent = nullptr); + ~MainWindow(); + +private: + Ui::MainWindow *ui; +}; +#endif // MAINWINDOW_H diff --git a/OSBindings/Qt/mainwindow.ui b/OSBindings/Qt/mainwindow.ui new file mode 100644 index 000000000..b232854ba --- /dev/null +++ b/OSBindings/Qt/mainwindow.ui @@ -0,0 +1,22 @@ + + + MainWindow + + + + 0 + 0 + 800 + 600 + + + + MainWindow + + + + + + + + diff --git a/Outputs/CRT/CRT.hpp b/Outputs/CRT/CRT.hpp index 2e6f34e22..5ca2c53a0 100644 --- a/Outputs/CRT/CRT.hpp +++ b/Outputs/CRT/CRT.hpp @@ -123,7 +123,7 @@ class CRT { bool should_alternate, Outputs::Display::InputDataType data_type); - /*! Constructs a monitor-style CRT — one that will take only an RGB or monochrome signal, and therefore has + /*! Constructs a monitor-style CRT — one that will take only an RGB or monochrome signal, and therefore has no colour space or colour subcarrier frequency. This monitor will automatically map colour bursts to the black level. */ CRT(int cycles_per_line, @@ -319,7 +319,7 @@ template class CRTFrequencyMismatchWarner: public Outputs::C public: CRTFrequencyMismatchWarner(Receiver &receiver) : receiver_(receiver) {} - void crt_did_end_batch_of_frames(Outputs::CRT::CRT *crt, int number_of_frames, int number_of_unexpected_vertical_syncs) final { + void crt_did_end_batch_of_frames(Outputs::CRT::CRT *, int number_of_frames, int number_of_unexpected_vertical_syncs) final { frame_records_[frame_record_pointer_ % frame_records_.size()].number_of_frames = number_of_frames; frame_records_[frame_record_pointer_ % frame_records_.size()].number_of_unexpected_vertical_syncs = number_of_unexpected_vertical_syncs; ++frame_record_pointer_; diff --git a/Outputs/OpenGL/ScanTarget.cpp b/Outputs/OpenGL/ScanTarget.cpp index 869368ae1..0ad44193d 100644 --- a/Outputs/OpenGL/ScanTarget.cpp +++ b/Outputs/OpenGL/ScanTarget.cpp @@ -45,7 +45,7 @@ constexpr GLenum AccumulationTextureUnit = GL_TEXTURE3; #define TextureAddressGetX(v) uint16_t((v) & 0x7ff) #define TextureSub(a, b) (((a) - (b)) & 0x3fffff) -const GLint internalFormatForDepth(std::size_t depth) { +constexpr GLint internalFormatForDepth(std::size_t depth) { switch(depth) { default: return GL_FALSE; case 1: return GL_R8UI; @@ -55,7 +55,7 @@ const GLint internalFormatForDepth(std::size_t depth) { } } -const GLenum formatForDepth(std::size_t depth) { +constexpr GLenum formatForDepth(std::size_t depth) { switch(depth) { default: return GL_FALSE; case 1: return GL_RED_INTEGER; @@ -408,7 +408,7 @@ bool ScanTarget::is_soft_display_type() { return modals_.display_type == DisplayType::CompositeColour || modals_.display_type == DisplayType::CompositeMonochrome; } -void ScanTarget::update(int output_width, int output_height) { +void ScanTarget::update(int, int output_height) { if(fence_ != nullptr) { // if the GPU is still busy, don't wait; we'll catch it next time if(glClientWaitSync(fence_, GL_SYNC_FLUSH_COMMANDS_BIT, 0) == GL_TIMEOUT_EXPIRED) { diff --git a/Outputs/OpenGL/ScanTargetGLSLFragments.cpp b/Outputs/OpenGL/ScanTargetGLSLFragments.cpp index cf18e6c26..745b1da64 100644 --- a/Outputs/OpenGL/ScanTargetGLSLFragments.cpp +++ b/Outputs/OpenGL/ScanTargetGLSLFragments.cpp @@ -56,7 +56,7 @@ void ScanTarget::set_uniforms(ShaderType type, Shader &target) const { } } -void ScanTarget::set_sampling_window(int output_width, int output_height, Shader &target) { +void ScanTarget::set_sampling_window(int output_width, int, Shader &target) { if(modals_.display_type != DisplayType::CompositeColour) { const float one_pixel_width = float(modals_.cycles_per_line) * modals_.visible_area.size.width / float(output_width); const float clocks_per_angle = float(modals_.cycles_per_line) * float(modals_.colour_cycle_denominator) / float(modals_.colour_cycle_numerator); diff --git a/Outputs/ScanTarget.hpp b/Outputs/ScanTarget.hpp index 1b25c4bb1..f463ab414 100644 --- a/Outputs/ScanTarget.hpp +++ b/Outputs/ScanTarget.hpp @@ -267,7 +267,7 @@ struct ScanTarget { /// and indicates that its actual final size was @c actual_length. /// /// It is required that every call to begin_data be paired with a call to end_data. - virtual void end_data(size_t actual_length) {} + virtual void end_data([[maybe_unused]] size_t actual_length) {} /// Tells the scan target that its owner is about to change; this is a hint that existing /// data and scan allocations should be invalidated. @@ -318,7 +318,7 @@ struct ScanTarget { @param location The location of the event. @param composite_amplitude The amplitude of the colour burst on this line (0, if no colour burst was found). */ - virtual void announce(Event event, bool is_visible, const Scan::EndPoint &location, uint8_t composite_amplitude) {} + virtual void announce([[maybe_unused]] Event event, [[maybe_unused]] bool is_visible, [[maybe_unused]] const Scan::EndPoint &location, [[maybe_unused]] uint8_t composite_amplitude) {} }; struct ScanStatus { @@ -373,10 +373,10 @@ struct ScanStatus { Provides a null target for scans. */ struct NullScanTarget: public ScanTarget { - void set_modals(Modals) {} - Scan *begin_scan() { return nullptr; } - uint8_t *begin_data(size_t required_length, size_t required_alignment = 1) { return nullptr; } - void submit() {} + void set_modals(Modals) override {} + Scan *begin_scan() override { return nullptr; } + uint8_t *begin_data(size_t, size_t) override { return nullptr; } + void submit() override {} static NullScanTarget singleton; }; diff --git a/Outputs/Speaker/Implementation/CompoundSource.hpp b/Outputs/Speaker/Implementation/CompoundSource.hpp index 21be56290..01f39f68f 100644 --- a/Outputs/Speaker/Implementation/CompoundSource.hpp +++ b/Outputs/Speaker/Implementation/CompoundSource.hpp @@ -86,7 +86,7 @@ template class CompoundSource: std::memset(target, 0, sizeof(std::int16_t) * number_of_samples); } - void set_scaled_volume_range(int16_t range, double *volumes, double scale) {} + void set_scaled_volume_range(int16_t, double *, double) {} static constexpr std::size_t size() { return 0; diff --git a/Outputs/Speaker/Implementation/LowpassSpeaker.hpp b/Outputs/Speaker/Implementation/LowpassSpeaker.hpp index a8f34fd8c..595ae04cc 100644 --- a/Outputs/Speaker/Implementation/LowpassSpeaker.hpp +++ b/Outputs/Speaker/Implementation/LowpassSpeaker.hpp @@ -65,7 +65,7 @@ template class LowpassSpeaker: public Speaker { } // Implemented as per Speaker. - void set_computed_output_rate(float cycles_per_second, int buffer_size, bool stereo) final { + void set_computed_output_rate(float cycles_per_second, int buffer_size, bool) final { std::lock_guard lock_guard(filter_parameters_mutex_); if(filter_parameters_.output_cycles_per_second == cycles_per_second && size_t(buffer_size) == output_buffer_.size()) { return; diff --git a/Outputs/Speaker/Implementation/SampleSource.hpp b/Outputs/Speaker/Implementation/SampleSource.hpp index 17a2e6a5d..2446b9d9a 100644 --- a/Outputs/Speaker/Implementation/SampleSource.hpp +++ b/Outputs/Speaker/Implementation/SampleSource.hpp @@ -25,7 +25,7 @@ class SampleSource { /*! Should write the next @c number_of_samples to @c target. */ - void get_samples(std::size_t number_of_samples, std::int16_t *target) {} + void get_samples([[maybe_unused]] std::size_t number_of_samples, [[maybe_unused]] std::int16_t *target) {} /*! Should skip the next @c number_of_samples. Subclasses of this SampleSource @@ -51,7 +51,7 @@ class SampleSource { Sets the proper output range for this sample source; it should write values between 0 and volume. */ - void set_sample_volume_range(std::int16_t volume) {} + void set_sample_volume_range([[maybe_unused]] std::int16_t volume) {} /*! Indicates whether this component will write stereo samples. diff --git a/Outputs/Speaker/Speaker.hpp b/Outputs/Speaker/Speaker.hpp index 0de8f4bc2..3319cb08c 100644 --- a/Outputs/Speaker/Speaker.hpp +++ b/Outputs/Speaker/Speaker.hpp @@ -76,7 +76,7 @@ class Speaker { Provides the delegate with a hint that the input clock rate has changed, which provides an opportunity to renegotiate the ideal clock rate, if desired. */ - virtual void speaker_did_change_input_clock(Speaker *speaker) {} + virtual void speaker_did_change_input_clock([[maybe_unused]] Speaker *speaker) {} }; virtual void set_delegate(Delegate *delegate) { delegate_ = delegate; @@ -87,7 +87,7 @@ class Speaker { virtual void set_computed_output_rate(float cycles_per_second, int buffer_size, bool stereo) = 0; protected: - void did_complete_samples(Speaker *speaker, const std::vector &buffer, bool is_stereo) { + void did_complete_samples(Speaker *, const std::vector &buffer, bool is_stereo) { // Test the delegate for existence again, as it may have changed. const auto delegate = delegate_.load(); if(!delegate) return; diff --git a/Processors/6502/6502.hpp b/Processors/6502/6502.hpp index 74a69da76..d91b5a010 100644 --- a/Processors/6502/6502.hpp +++ b/Processors/6502/6502.hpp @@ -107,7 +107,7 @@ class BusHandler { during some periods; one way to simulate that is to have the bus handler return a number other than Cycles(1) to describe lengthened bus cycles. */ - Cycles perform_bus_operation(CPU::MOS6502::BusOperation operation, uint16_t address, uint8_t *value) { + Cycles perform_bus_operation([[maybe_unused]] CPU::MOS6502::BusOperation operation, [[maybe_unused]] uint16_t address, [[maybe_unused]] uint8_t *value) { return Cycles(1); } diff --git a/Processors/68000/68000.hpp b/Processors/68000/68000.hpp index afc90b8af..5f57c081b 100644 --- a/Processors/68000/68000.hpp +++ b/Processors/68000/68000.hpp @@ -99,7 +99,7 @@ struct Microcycle { HalfCycles length = HalfCycles(4); /*! - For expediency, this provides a full 32-bit byte-resolution address — e.g. + For expediency, this provides a full 32-bit byte-resolution address — e.g. if reading indirectly via an address register, this will indicate the full value of the address register. @@ -334,7 +334,7 @@ class BusHandler { FC0 and FC1 are provided inside the microcycle as the IsData and IsProgram flags; FC2 is provided here as is_supervisor — it'll be either 0 or 1. */ - HalfCycles perform_bus_operation(const Microcycle &cycle, int is_supervisor) { + HalfCycles perform_bus_operation([[maybe_unused]] const Microcycle &cycle, [[maybe_unused]] int is_supervisor) { return HalfCycles(0); } @@ -343,7 +343,7 @@ class BusHandler { /*! Provides information about the path of execution if enabled via the template. */ - void will_perform(uint32_t address, uint16_t opcode) {} + void will_perform([[maybe_unused]] uint32_t address, [[maybe_unused]] uint16_t opcode) {} }; #include "Implementation/68000Storage.hpp" diff --git a/Processors/68000/Implementation/68000Storage.hpp b/Processors/68000/Implementation/68000Storage.hpp index a0de08b93..ccb5c938a 100644 --- a/Processors/68000/Implementation/68000Storage.hpp +++ b/Processors/68000/Implementation/68000Storage.hpp @@ -369,11 +369,11 @@ class ProcessorStorage { /// b4-b6 = destination address register. uint8_t source_dest = 0; - void set_source_address(ProcessorStorage &storage, int index) { + void set_source_address([[maybe_unused]] ProcessorStorage &storage, int index) { source_dest = uint8_t((source_dest & 0x0f) | (index << 4)); } - void set_destination_address(ProcessorStorage &storage, int index) { + void set_destination_address([[maybe_unused]] ProcessorStorage &storage, int index) { source_dest = uint8_t((source_dest & 0xf0) | index); } diff --git a/Processors/Z80/Implementation/Z80Storage.hpp b/Processors/Z80/Implementation/Z80Storage.hpp index 91577739d..fb0f6bcdc 100644 --- a/Processors/Z80/Implementation/Z80Storage.hpp +++ b/Processors/Z80/Implementation/Z80Storage.hpp @@ -110,10 +110,10 @@ class ProcessorStorage { /// Resets: IFF1, IFF2, interrupt mode, the PC, I and R; sets all flags, the SP to 0xffff and a_ to 0xff. Reset }; - Type type; + Type type = Type::Reset; void *source = nullptr; void *destination = nullptr; - PartialMachineCycle machine_cycle; + PartialMachineCycle machine_cycle{}; }; struct InstructionPage { @@ -121,10 +121,8 @@ class ProcessorStorage { std::vector all_operations; std::vector fetch_decode_execute; MicroOp *fetch_decode_execute_data = nullptr; - uint8_t r_step; - bool is_indexed; - - InstructionPage() : r_step(1), is_indexed(false) {} + uint8_t r_step = 1; + bool is_indexed = false; }; ProcessorStorage(); @@ -230,6 +228,6 @@ class ProcessorStorage { void assemble_cb_page(InstructionPage &target, RegisterPair16 &index, bool add_offsets); void assemble_base_page(InstructionPage &target, RegisterPair16 &index, bool add_offsets, InstructionPage &cb_page); - // Allos state objects to capture and apply state. - friend class State; + // Allow state objects to capture and apply state. + friend struct State; }; diff --git a/Processors/Z80/Z80.hpp b/Processors/Z80/Z80.hpp index f470a6614..777fd1cdc 100644 --- a/Processors/Z80/Z80.hpp +++ b/Processors/Z80/Z80.hpp @@ -94,15 +94,15 @@ struct PartialMachineCycle { InterruptStart, }; /// The operation being carried out by the Z80. See the various getters below for better classification. - const Operation operation; + const Operation operation = Operation::Internal; /// The length of this operation. const HalfCycles length; /// The current value of the address bus. - const uint16_t *const address; + const uint16_t *const address = nullptr; /// If the Z80 is outputting to the data bus, a pointer to that value. Otherwise, a pointer to the location where the current data bus value should be placed. - uint8_t *const value; + uint8_t *const value = nullptr; /// @c true if this operation is occurring only because of an external request; @c false otherwise. - const bool was_requested; + const bool was_requested = false; /*! @returns @c true if the processor believes that the bus handler should actually do something with @@ -145,7 +145,7 @@ class BusHandler { during some periods or may impose wait states so predictably that it's more efficient just to add them via this mechanism. */ - HalfCycles perform_machine_cycle(const PartialMachineCycle &cycle) { + HalfCycles perform_machine_cycle([[maybe_unused]] const PartialMachineCycle &cycle) { return HalfCycles(0); } diff --git a/Reflection/Struct.cpp b/Reflection/Struct.cpp index e4d772adc..3c3a47cc3 100644 --- a/Reflection/Struct.cpp +++ b/Reflection/Struct.cpp @@ -99,7 +99,7 @@ template <> bool Reflection::set(Struct &target, const std::string &name, double } template <> bool Reflection::set(Struct &target, const std::string &name, int value, size_t offset) { - return set(target, name, value); + return set(target, name, value, offset); } template <> bool Reflection::set(Struct &target, const std::string &name, int64_t value, size_t offset) { @@ -153,7 +153,7 @@ template <> bool Reflection::set(Struct &target, const std::string &name, const template <> bool Reflection::set(Struct &target, const std::string &name, const char *value, size_t offset) { const std::string string(value); - return set(target, name, string); + return set(target, name, string, offset); } template <> bool Reflection::set(Struct &target, const std::string &name, bool value, size_t offset) { @@ -529,10 +529,10 @@ struct ArrayReceiver: public Reflection::Struct { target_(target), type_(type), key_(key), count_(count) {} std::vector all_keys() const final { return {}; } - const std::type_info *type_of(const std::string &name) const final { return type_; } - size_t count_of(const std::string &name) const final { return 0; } + const std::type_info *type_of(const std::string &) const final { return type_; } + size_t count_of(const std::string &) const final { return 0; } - void set(const std::string &name, const void *value, size_t offset) final { + void set(const std::string &name, const void *value, size_t) final { const auto index = size_t(std::stoi(name)); if(index >= count_) { return; @@ -540,11 +540,11 @@ struct ArrayReceiver: public Reflection::Struct { target_->set(key_, value, index); } - virtual std::vector values_for(const std::string &name) const final { + virtual std::vector values_for(const std::string &) const final { return {}; } - void *get(const std::string &name) final { + void *get(const std::string &) final { return nullptr; } diff --git a/Reflection/Struct.hpp b/Reflection/Struct.hpp index 68278c7ab..14870760e 100644 --- a/Reflection/Struct.hpp +++ b/Reflection/Struct.hpp @@ -71,7 +71,7 @@ struct Struct { /*! Called to determine whether @c key should be included in the serialisation of this struct. */ - virtual bool should_serialise(const std::string &key) const { return true; } + virtual bool should_serialise([[maybe_unused]] const std::string &key) const { return true; } private: void append(std::ostringstream &stream, const std::string &key, const std::type_info *type, size_t offset) const; diff --git a/SignalProcessing/FIRFilter.hpp b/SignalProcessing/FIRFilter.hpp index 738b14a7d..b64c90150 100644 --- a/SignalProcessing/FIRFilter.hpp +++ b/SignalProcessing/FIRFilter.hpp @@ -9,7 +9,10 @@ #ifndef FIRFilter_hpp #define FIRFilter_hpp -#ifdef __APPLE__ +// Use the Accelerate framework to vectorise, unless this is a Qt build. +// Primarily that avoids gymnastics in the QMake file; it also eliminates +// a difference in the Qt build across platforms. +#if defined(__APPLE__) && !defined(QT_VERSION) #include #define USE_ACCELERATE #endif diff --git a/Storage/Disk/Controller/DiskController.cpp b/Storage/Disk/Controller/DiskController.cpp index d7f2d75ba..5972e2dc6 100644 --- a/Storage/Disk/Controller/DiskController.cpp +++ b/Storage/Disk/Controller/DiskController.cpp @@ -20,7 +20,7 @@ Controller::Controller(Cycles clock_rate) : set_expected_bit_length(Time(1)); } -void Controller::set_component_prefers_clocking(ClockingHint::Source *component, ClockingHint::Preference clocking) { +void Controller::set_component_prefers_clocking(ClockingHint::Source *, ClockingHint::Preference) { update_clocking_observer(); } diff --git a/Storage/Disk/DiskImage/DiskImage.hpp b/Storage/Disk/DiskImage/DiskImage.hpp index 6b20e09f8..32c535761 100644 --- a/Storage/Disk/DiskImage/DiskImage.hpp +++ b/Storage/Disk/DiskImage/DiskImage.hpp @@ -56,7 +56,7 @@ class DiskImage { /*! Replaces the Tracks indicated by the map, that maps from physical address to track content. */ - virtual void set_tracks(const std::map> &tracks) {} + virtual void set_tracks(const std::map> &) {} /*! Communicates that it is likely to be a while before any more tracks are written. diff --git a/Storage/Disk/Drive.hpp b/Storage/Disk/Drive.hpp index 30349057e..b512cc8fc 100644 --- a/Storage/Disk/Drive.hpp +++ b/Storage/Disk/Drive.hpp @@ -35,7 +35,7 @@ class Drive: public ClockingHint::Source, public TimedEventLoop { Drive(int input_clock_rate, int revolutions_per_minute, int number_of_heads, ReadyType rdy_type = ReadyType::ShugartRDY); Drive(int input_clock_rate, int number_of_heads, ReadyType rdy_type = ReadyType::ShugartRDY); - ~Drive(); + virtual ~Drive(); /*! Replaces whatever is in the drive with @c disk. Supply @c nullptr to eject any current disk and leave none inserted. @@ -145,7 +145,7 @@ class Drive: public ClockingHint::Source, public TimedEventLoop { virtual void process_write_completed() {} /// Informs the delegate of the passing of @c cycles. - virtual void advance(const Cycles cycles) {} + virtual void advance([[maybe_unused]] Cycles cycles) {} }; /// Sets the current event delegate. @@ -183,7 +183,7 @@ class Drive: public ClockingHint::Source, public TimedEventLoop { /*! Announces the result of a step. */ - virtual void did_step(HeadPosition to_position) {} + virtual void did_step([[maybe_unused]] HeadPosition to_position) {} /*! Announces new media installation. diff --git a/Storage/MassStorage/MassStorageDevice.hpp b/Storage/MassStorage/MassStorageDevice.hpp index 567711c80..61e48859c 100644 --- a/Storage/MassStorage/MassStorageDevice.hpp +++ b/Storage/MassStorage/MassStorageDevice.hpp @@ -52,7 +52,7 @@ class MassStorageDevice { /*! Sets new contents for the block at @c address. */ - virtual void set_block(size_t address, const std::vector &) {} + virtual void set_block([[maybe_unused]] size_t address, const std::vector &) {} }; } diff --git a/Storage/MassStorage/SCSI/Target.hpp b/Storage/MassStorage/SCSI/Target.hpp index e75baec4f..4f34fa65f 100644 --- a/Storage/MassStorage/SCSI/Target.hpp +++ b/Storage/MassStorage/SCSI/Target.hpp @@ -135,8 +135,8 @@ struct Responder { Terminates a SCSI command, sending the proper sequence of status and message phases. */ void terminate_command(Status status) { - send_status(status, [] (const Target::CommandState &state, Target::Responder &responder) { - responder.send_message(Target::Responder::Message::CommandComplete, [] (const Target::CommandState &state, Target::Responder &responder) { + send_status(status, [] (const Target::CommandState &, Target::Responder &responder) { + responder.send_message(Target::Responder::Message::CommandComplete, [] (const Target::CommandState &, Target::Responder &responder) { responder.end_command(); }); }); @@ -191,7 +191,7 @@ struct Executor { if(specs.allocated_bytes < response.size()) { response.resize(specs.allocated_bytes); } - responder.send_data(std::move(response), [] (const Target::CommandState &state, Target::Responder &responder) { + responder.send_data(std::move(response), [] (const Target::CommandState &, Target::Responder &responder) { responder.terminate_command(Target::Responder::Status::Good); }); @@ -201,7 +201,7 @@ struct Executor { bool mode_select(const CommandState &state, Responder &responder) { const auto specs = state.mode_select_specs(); - responder.receive_data(specs.parameter_list_length, [] (const Target::CommandState &state, Target::Responder &responder) { + responder.receive_data(specs.parameter_list_length, [] (const Target::CommandState &, Target::Responder &responder) { // TODO: parse data according to current sense mode. responder.terminate_command(Target::Responder::Status::Good); }); @@ -295,7 +295,7 @@ struct Executor { response.resize(allocated_bytes); } - responder.send_data(std::move(response), [] (const Target::CommandState &state, Target::Responder &responder) { + responder.send_data(std::move(response), [] (const Target::CommandState &, Target::Responder &responder) { responder.terminate_command(Target::Responder::Status::Good); }); diff --git a/Storage/Tape/Formats/CSW.cpp b/Storage/Tape/Formats/CSW.cpp index 644d88145..4b6e04721 100644 --- a/Storage/Tape/Formats/CSW.cpp +++ b/Storage/Tape/Formats/CSW.cpp @@ -86,7 +86,7 @@ CSW::CSW(const std::string &file_name) : invert_pulse(); } -CSW::CSW(const std::vector &&data, CompressionType compression_type, bool initial_level, uint32_t sampling_rate) { +CSW::CSW(const std::vector &&data, CompressionType compression_type, bool initial_level, uint32_t sampling_rate) : compression_type_(compression_type) { pulse_.length.clock_rate = sampling_rate; pulse_.type = initial_level ? Pulse::High : Pulse::Low; source_data_ = std::move(data); diff --git a/Storage/Tape/Parsers/Acorn.cpp b/Storage/Tape/Parsers/Acorn.cpp index 03f219aac..4c8895ec2 100644 --- a/Storage/Tape/Parsers/Acorn.cpp +++ b/Storage/Tape/Parsers/Acorn.cpp @@ -69,7 +69,6 @@ Shifter::Shifter() : pll_(PLLClockRate / 4800, *this), was_high_(false), input_pattern_(0), - input_bit_counter_(0), delegate_(nullptr) {} void Shifter::process_pulse(const Storage::Tape::Tape::Pulse &pulse) { diff --git a/Storage/Tape/Parsers/Acorn.hpp b/Storage/Tape/Parsers/Acorn.hpp index b3d8255e2..5d4673701 100644 --- a/Storage/Tape/Parsers/Acorn.hpp +++ b/Storage/Tape/Parsers/Acorn.hpp @@ -38,7 +38,6 @@ class Shifter { bool was_high_; unsigned int input_pattern_; - unsigned int input_bit_counter_; Delegate *delegate_; }; diff --git a/Storage/Tape/Tape.cpp b/Storage/Tape/Tape.cpp index 62d242cfa..95d57346a 100644 --- a/Storage/Tape/Tape.cpp +++ b/Storage/Tape/Tape.cpp @@ -134,7 +134,7 @@ bool BinaryTapePlayer::get_motor_control() const { return motor_is_running_; } -void BinaryTapePlayer::set_tape_output(bool set) { +void BinaryTapePlayer::set_tape_output(bool) { // TODO } diff --git a/Storage/Tape/Tape.hpp b/Storage/Tape/Tape.hpp index a64aed0cf..d506e8851 100644 --- a/Storage/Tape/Tape.hpp +++ b/Storage/Tape/Tape.hpp @@ -98,6 +98,7 @@ class Tape { class TapePlayer: public TimedEventLoop, public ClockingHint::Source { public: TapePlayer(int input_clock_rate); + virtual ~TapePlayer() {} void set_tape(std::shared_ptr tape); bool has_tape(); diff --git a/Storage/TimedEventLoop.hpp b/Storage/TimedEventLoop.hpp index 64d4ce3a0..88d80bf77 100644 --- a/Storage/TimedEventLoop.hpp +++ b/Storage/TimedEventLoop.hpp @@ -79,7 +79,7 @@ namespace Storage { forward between calls into run_for; a subclass can receive arbitrarily many instructions to advance before receiving a process_next_event. */ - virtual void advance(const Cycles cycles) {}; + virtual void advance([[maybe_unused]] const Cycles cycles) {}; /*! Resets timing, throwing away any current internal state. So clears any fractional ticks