Switch to `= default`.

This commit is contained in:
Thomas Harte 2024-02-16 21:47:23 -05:00
parent a758112084
commit bc5727af14
67 changed files with 52 additions and 89 deletions

View File

@ -23,7 +23,7 @@ namespace Activity {
*/
class Observer {
public:
virtual ~Observer() {}
virtual ~Observer() = default;
/// Provides hints as to the sort of information presented on an LED.
enum LEDPresentation: uint8_t {

View File

@ -57,7 +57,7 @@ struct Media {
*/
struct Target {
Target(Machine machine) : machine(machine) {}
virtual ~Target() {}
virtual ~Target() = default;
// This field is entirely optional.
std::unique_ptr<Reflection::Struct> state;

View File

@ -30,7 +30,7 @@ class WD1770: public Storage::Disk::MFMController {
@param p The type of controller to emulate.
*/
WD1770(Personality p);
virtual ~WD1770() {}
virtual ~WD1770() = default;
/// 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;

View File

@ -21,7 +21,7 @@ namespace Intel::i8272 {
class BusHandler {
public:
virtual ~BusHandler() {}
virtual ~BusHandler() = default;
virtual void set_dma_data_request([[maybe_unused]] bool drq) {}
virtual void set_interrupt([[maybe_unused]] bool irq) {}
};

View File

@ -132,7 +132,7 @@ struct Command {
CommandContext &context;
ModeDescription &mode_description;
Command(CommandContext &context, ModeDescription &mode_description) : context(context), mode_description(mode_description) {}
virtual ~Command() {}
virtual ~Command() = default;
/// @returns @c true if all output from this command is done; @c false otherwise.
virtual bool done() = 0;

View File

@ -21,8 +21,6 @@ namespace Apple::Clock {
*/
class ClockStorage {
public:
ClockStorage() {}
/*!
Advances the clock by 1 second.

View File

@ -19,7 +19,7 @@ namespace Inputs {
*/
class Joystick {
public:
virtual ~Joystick() {}
virtual ~Joystick() = default;
/*!
Defines a single input, any individually-measured thing a fire button or

View File

@ -45,7 +45,7 @@ class Keyboard {
/// Constructs a Keyboard that declares itself to observe only members of @c observed_keys.
Keyboard(const std::set<Key> &observed_keys, const std::set<Key> &essential_modifiers);
virtual ~Keyboard() {}
virtual ~Keyboard() = default;
// Host interface.

View File

@ -222,7 +222,7 @@ struct Instruction {
Instruction(Operation operation, AddressingMode addressing_mode, uint8_t opcode) : operation(operation), addressing_mode(addressing_mode), opcode(opcode) {}
Instruction(uint8_t opcode) : opcode(opcode) {}
Instruction() {}
Instruction() = default;
};
/*!

View File

@ -478,7 +478,7 @@ class Preinstruction {
static constexpr int SizeShift = 0;
};
Preinstruction() {}
Preinstruction() = default;
/// Produces a string description of this instruction; if @c opcode
/// is supplied then any quick fields in this instruction will be decoded;

View File

@ -256,5 +256,3 @@ std::unique_ptr<Machine> Machine::Amiga(const Analyser::Static::Target *target,
const Target *const amiga_target = dynamic_cast<const Target *>(target);
return std::make_unique<Amiga::ConcreteMachine>(*amiga_target, rom_fetcher);
}
Machine::~Machine() {}

View File

@ -17,7 +17,7 @@ namespace Amiga {
class Machine {
public:
virtual ~Machine();
virtual ~Machine() = default;
/// Creates and returns an Amiga.
static std::unique_ptr<Machine> Amiga(const Analyser::Static::Target *target, const ROMMachine::ROMFetcher &rom_fetcher);

View File

@ -62,7 +62,7 @@ template <bool record_bus = false> class Blitter: public DMADevice<4, 4> {
uint32_t address = 0;
uint16_t value = 0;
Transaction() {}
Transaction() = default;
Transaction(Type type) : type(type) {}
Transaction(Type type, uint32_t address, uint16_t value) : type(type), address(address), value(value) {}

View File

@ -1293,5 +1293,3 @@ std::unique_ptr<Machine> Machine::AmstradCPC(const Analyser::Static::Target *tar
case Target::Model::CPC464: return std::make_unique<AmstradCPC::ConcreteMachine<false>>(*cpc_target, rom_fetcher);
}
}
Machine::~Machine() {}

View File

@ -22,7 +22,7 @@ namespace AmstradCPC {
*/
class Machine {
public:
virtual ~Machine();
virtual ~Machine() = default;
/// Creates and returns an Amstrad CPC.
static std::unique_ptr<Machine> AmstradCPC(const Analyser::Static::Target *target, const ROMMachine::ROMFetcher &rom_fetcher);

View File

@ -34,7 +34,7 @@ struct Command {
uint8_t device = AllDevices;
uint8_t reg = NoRegister;
Command() {}
Command() = default;
Command(Type type) : type(type) {}
Command(Type type, uint8_t device) : type(type), device(device) {}
Command(Type type, uint8_t device, uint8_t reg) : type(type), device(device), reg(reg) {}

View File

@ -1107,5 +1107,3 @@ std::unique_ptr<Machine> Machine::AppleII(const Analyser::Static::Target *target
}
}
}
Machine::~Machine() {}

View File

@ -19,7 +19,7 @@ namespace Apple::II {
class Machine {
public:
virtual ~Machine();
virtual ~Machine() = default;
/// Creates and returns an AppleII.
static std::unique_ptr<Machine> AppleII(const Analyser::Static::Target *target, const ROMMachine::ROMFetcher &rom_fetcher);

View File

@ -1013,6 +1013,3 @@ using namespace Apple::IIgs;
std::unique_ptr<Machine> Machine::AppleIIgs(const Analyser::Static::Target *target, const ROMMachine::ROMFetcher &rom_fetcher) {
return std::make_unique<ConcreteMachine>(*dynamic_cast<const Analyser::Static::AppleIIgs::Target *>(target), rom_fetcher);
}
Machine::~Machine() {}

View File

@ -19,7 +19,7 @@ namespace Apple::IIgs {
class Machine {
public:
virtual ~Machine();
virtual ~Machine() = default;
/// Creates and returns an AppleIIgs.
static std::unique_ptr<Machine> AppleIIgs(const Analyser::Static::Target *target, const ROMMachine::ROMFetcher &rom_fetcher);

View File

@ -852,5 +852,3 @@ std::unique_ptr<Machine> Machine::Macintosh(const Analyser::Static::Target *targ
case Model::MacPlus: return std::make_unique<ConcreteMachine<Model::MacPlus>>(*mac_target, rom_fetcher);
}
}
Machine::~Machine() {}

View File

@ -17,7 +17,7 @@ namespace Apple::Macintosh {
class Machine {
public:
virtual ~Machine();
virtual ~Machine() = default;
/// Creates and returns a Macintosh.
static std::unique_ptr<Machine> Macintosh(const Analyser::Static::Target *target, const ROMMachine::ROMFetcher &rom_fetcher);

View File

@ -216,5 +216,3 @@ std::unique_ptr<Machine> Machine::Atari2600(const Analyser::Static::Target *targ
const Target *const atari_target = dynamic_cast<const Target *>(target);
return std::make_unique<Atari2600::ConcreteMachine>(*atari_target);
}
Machine::~Machine() {}

View File

@ -23,7 +23,7 @@ namespace Atari2600 {
*/
class Machine {
public:
virtual ~Machine();
virtual ~Machine() = default;
/// Creates and returns an Atari 2600 on the heap.
static std::unique_ptr<Machine> Atari2600(const Analyser::Static::Target *target, const ROMMachine::ROMFetcher &rom_fetcher);

View File

@ -717,5 +717,3 @@ std::unique_ptr<Machine> Machine::AtariST(const Analyser::Static::Target *target
return std::make_unique<ConcreteMachine>(*atari_target, rom_fetcher);
}
Machine::~Machine() {}

View File

@ -19,7 +19,7 @@ namespace Atari::ST {
class Machine {
public:
virtual ~Machine();
virtual ~Machine() = default;
static std::unique_ptr<Machine> AtariST(const Analyser::Static::Target *target, const ROMMachine::ROMFetcher &rom_fetcher);

View File

@ -415,5 +415,3 @@ using namespace Coleco::Vision;
std::unique_ptr<Machine> Machine::ColecoVision(const Analyser::Static::Target *target, const ROMMachine::ROMFetcher &rom_fetcher) {
return std::make_unique<ConcreteMachine>(*target, rom_fetcher);
}
Machine::~Machine() {}

View File

@ -19,7 +19,7 @@ namespace Coleco::Vision {
class Machine {
public:
virtual ~Machine();
virtual ~Machine() = default;
static std::unique_ptr<Machine> ColecoVision(const Analyser::Static::Target *target, const ROMMachine::ROMFetcher &rom_fetcher);
class Options: public Reflection::StructImpl<Options>, public Configurable::DisplayOption<Options> {

View File

@ -73,7 +73,7 @@ namespace Commodore::Serial {
class Port {
public:
Port() : line_levels_{High, High, High, High, High} {}
virtual ~Port() {}
virtual ~Port() = default;
/*!
Sets the current level of an output line on this serial port.

View File

@ -767,5 +767,3 @@ std::unique_ptr<Machine> Machine::Vic20(const Analyser::Static::Target *target,
const Target *const commodore_target = dynamic_cast<const Target *>(target);
return std::make_unique<Vic20::ConcreteMachine>(*commodore_target, rom_fetcher);
}
Machine::~Machine() {}

View File

@ -22,7 +22,7 @@ std::unique_ptr<Reflection::Struct> get_options();
class Machine {
public:
virtual ~Machine();
virtual ~Machine() = default;
/// Creates and returns a Vic-20.
static std::unique_ptr<Machine> Vic20(const Analyser::Static::Target *target, const ROMMachine::ROMFetcher &rom_fetcher);

View File

@ -20,7 +20,7 @@ namespace Machine {
the machine's parent class or, therefore, the need to establish a common one.
*/
struct DynamicMachine {
virtual ~DynamicMachine() {}
virtual ~DynamicMachine() = default;
virtual Activity::Source *activity_source() = 0;
virtual Configurable::Device *configurable_device() = 0;

View File

@ -796,5 +796,3 @@ std::unique_ptr<Machine> Machine::Electron(const Analyser::Static::Target *targe
return std::make_unique<Electron::ConcreteMachine<true>>(*acorn_target, rom_fetcher);
}
}
Machine::~Machine() {}

View File

@ -25,7 +25,7 @@ namespace Electron {
*/
class Machine {
public:
virtual ~Machine();
virtual ~Machine() = default;
/// Creates and returns an Electron.
static std::unique_ptr<Machine> Electron(const Analyser::Static::Target *target, const ROMMachine::ROMFetcher &rom_fetcher);

View File

@ -768,5 +768,3 @@ std::unique_ptr<Machine> Machine::Enterprise(const Analyser::Static::Target *tar
return nullptr;
}
Machine::~Machine() {}

View File

@ -25,7 +25,7 @@ namespace Enterprise {
*/
class Machine {
public:
virtual ~Machine();
virtual ~Machine() = default;
static std::unique_ptr<Machine> Enterprise(const Analyser::Static::Target *target, const ROMMachine::ROMFetcher &rom_fetcher);
/// Defines the runtime options available for an Enterprise.

View File

@ -1050,5 +1050,3 @@ std::unique_ptr<Machine> Machine::MSX(const Analyser::Static::Target *target, co
}
}
}
Machine::~Machine() {}

View File

@ -19,7 +19,7 @@ namespace MSX {
class Machine {
public:
virtual ~Machine();
virtual ~Machine() = default;
static std::unique_ptr<Machine> MSX(const Analyser::Static::Target *target, const ROMMachine::ROMFetcher &rom_fetcher);
class Options: public Reflection::StructImpl<Options>, public Configurable::DisplayOption<Options>, public Configurable::QuickloadOption<Options> {

View File

@ -121,7 +121,7 @@ class PrimarySlot {
class MemorySlotHandler {
public:
virtual ~MemorySlotHandler() {}
virtual ~MemorySlotHandler() = default;
/*! Advances time by @c half_cycles. */
virtual void run_for([[maybe_unused]] HalfCycles half_cycles) {}

View File

@ -570,5 +570,3 @@ std::unique_ptr<Machine> Machine::MasterSystem(const Analyser::Static::Target *t
return nullptr;
}
}
Machine::~Machine() {}

View File

@ -19,7 +19,7 @@ namespace Sega::MasterSystem {
class Machine {
public:
virtual ~Machine();
virtual ~Machine() = default;
static std::unique_ptr<Machine> MasterSystem(const Analyser::Static::Target *target, const ROMMachine::ROMFetcher &rom_fetcher);
class Options: public Reflection::StructImpl<Options>, public Configurable::DisplayOption<Options> {

View File

@ -816,5 +816,3 @@ std::unique_ptr<Machine> Machine::Oric(const Analyser::Static::Target *target_hi
return nullptr;
}
Machine::~Machine() {}

View File

@ -22,7 +22,7 @@ namespace Oric {
*/
class Machine {
public:
virtual ~Machine();
virtual ~Machine() = default;
/// Creates and returns an Oric.
static std::unique_ptr<Machine> Oric(const Analyser::Static::Target *target, const ROMMachine::ROMFetcher &rom_fetcher);

View File

@ -1208,5 +1208,3 @@ std::unique_ptr<Machine> Machine::PCCompatible(const Analyser::Static::Target *t
default: return nullptr;
}
}
Machine::~Machine() {}

View File

@ -20,7 +20,7 @@ namespace PCCompatible {
*/
class Machine {
public:
virtual ~Machine();
virtual ~Machine() = default;
/// Creates and returns a PC Compatible.
static std::unique_ptr<Machine> PCCompatible(

View File

@ -503,5 +503,3 @@ std::unique_ptr<Machine> Machine::ZX8081(const Analyser::Static::Target *target,
if(zx_target->is_ZX81) return std::make_unique<ConcreteMachine<true>>(*zx_target, rom_fetcher);
else return std::make_unique<ConcreteMachine<false>>(*zx_target, rom_fetcher);
}
Machine::~Machine() {}

View File

@ -20,7 +20,7 @@ namespace Sinclair::ZX8081 {
/// The ZX80/81 machine.
class Machine {
public:
virtual ~Machine();
virtual ~Machine() = default;
static std::unique_ptr<Machine> ZX8081(const Analyser::Static::Target *target, const ROMMachine::ROMFetcher &rom_fetcher);
virtual void set_tape_is_playing(bool is_playing) = 0;

View File

@ -1008,5 +1008,3 @@ std::unique_ptr<Machine> Machine::ZXSpectrum(const Analyser::Static::Target *tar
return nullptr;
}
Machine::~Machine() {}

View File

@ -19,7 +19,7 @@ namespace Sinclair::ZXSpectrum {
class Machine {
public:
virtual ~Machine();
virtual ~Machine() = default;
static std::unique_ptr<Machine> ZXSpectrum(const Analyser::Static::Target *target, const ROMMachine::ROMFetcher &rom_fetcher);
virtual void set_tape_is_playing(bool is_playing) = 0;

View File

@ -222,7 +222,7 @@ std::vector<Description> all_descriptions();
struct Request {
Request(Name name, bool optional = false);
Request() {}
Request() = default;
/// Forms the request that would be satisfied by @c this plus the right-hand side.
Request operator &&(const Request &);

View File

@ -22,7 +22,7 @@ namespace Utility {
*/
class CharacterMapper {
public:
virtual ~CharacterMapper() {}
virtual ~CharacterMapper() = default;
/// @returns The EndSequence-terminated sequence of keys that would cause @c character to be typed.
virtual const uint16_t *sequence_for_character(char character) const = 0;

View File

@ -20,7 +20,7 @@ namespace CPU {
/// Provides access to all intermediate parts of a larger int.
template <typename Full, typename Half> union alignas(Full) alignas(Half) RegisterPair {
RegisterPair(Full v) : full(v) {}
RegisterPair() {}
RegisterPair() = default;
Full full;
#if TARGET_RT_BIG_ENDIAN

View File

@ -981,7 +981,7 @@ int main(int argc, char *argv[]) {
KeyPress(uint32_t timestamp, const char *text) : timestamp(timestamp), input(text) {}
KeyPress(uint32_t timestamp, SDL_Scancode scancode, SDL_Keycode keycode, bool is_down, bool repeat) :
timestamp(timestamp), scancode(scancode), keycode(keycode), is_down(is_down), repeat(repeat) {}
KeyPress() {}
KeyPress() = default;
};
std::vector<KeyPress> keypresses;

View File

@ -198,7 +198,7 @@ inline std::array<float, 9> from_rgb_matrix(ColourSpace colour_space) {
for use of shared memory where available.
*/
struct ScanTarget {
virtual ~ScanTarget() {}
virtual ~ScanTarget() = default;
/*

View File

@ -55,7 +55,7 @@ template <bool stereo> struct SampleT {
*/
class Speaker {
public:
virtual ~Speaker() {}
virtual ~Speaker() = default;
/*!
@returns The best output clock rate for the audio being supplied to this speaker, from the range given.

View File

@ -17,7 +17,7 @@ class AllRAMProcessor:
public ::CPU::AllRAMProcessor {
public:
static AllRAMProcessor *Processor(CPU::MOS6502Esque::Type type, bool has_cias = false);
virtual ~AllRAMProcessor() {}
virtual ~AllRAMProcessor() = default;
virtual void run_for(const Cycles cycles) = 0;
virtual void run_for_instructions(int) = 0;

View File

@ -37,7 +37,7 @@ struct Struct {
return const_cast<Struct *>(this)->get(name);
}
virtual std::vector<std::string> values_for(const std::string &name) const = 0;
virtual ~Struct() {}
virtual ~Struct() = default;
/*!
@returns A string describing this struct. This string has no guaranteed layout, may not be

View File

@ -70,9 +70,9 @@ class Cartridge {
const std::vector<Segment> &get_segments() const {
return segments_;
}
virtual ~Cartridge() {}
virtual ~Cartridge() = default;
Cartridge() {}
Cartridge() = default;
Cartridge(const std::vector<Segment> &segments) : segments_(segments) {}
protected:

View File

@ -24,7 +24,7 @@ namespace Storage::Disk {
*/
class Disk {
public:
virtual ~Disk() {}
virtual ~Disk() = default;
/*!
@returns the number of discrete positions that this disk uses to model its complete surface area.

View File

@ -31,7 +31,7 @@ enum class Error {
*/
class DiskImage {
public:
virtual ~DiskImage() {}
virtual ~DiskImage() = default;
/*!
@returns the distance at which there stops being any further content.

View File

@ -56,7 +56,7 @@ struct Sector {
};
Encoding encoding = Encoding::SixAndTwo;
Sector() {}
Sector() = default;
Sector(Sector &&rhs) :
address(rhs.address),

View File

@ -82,7 +82,7 @@ enum class SurfaceItem {
class MFMEncoder: public Encoder {
public:
MFMEncoder(std::vector<bool> &target, std::vector<bool> *fuzzy_target = nullptr) : Encoder(target, fuzzy_target) {}
virtual ~MFMEncoder() {}
virtual ~MFMEncoder() = default;
void add_byte(uint8_t input, uint8_t fuzzy_mask = 0) final {
crc_generator_.add(input);

View File

@ -42,7 +42,7 @@ std::shared_ptr<Storage::Disk::Track> TrackWithSectors(
class Encoder {
public:
Encoder(std::vector<bool> &target, std::vector<bool> *fuzzy_target);
virtual ~Encoder() {}
virtual ~Encoder() = default;
virtual void reset_target(std::vector<bool> &target, std::vector<bool> *fuzzy_target = nullptr);
virtual void add_byte(uint8_t input, uint8_t fuzzy_mask = 0) = 0;

View File

@ -104,7 +104,7 @@ struct PCMSegment {
Constructs an instance of PCMSegment where each bit window is 1 unit of time
long and @c data is empty.
*/
PCMSegment() {}
PCMSegment() = default;
/// Empties the PCMSegment.
void clear() {

View File

@ -68,7 +68,7 @@ class HeadPosition {
*/
class Track {
public:
virtual ~Track() {}
virtual ~Track() = default;
/*!
Describes the location of a track, implementing < to allow for use as a set key.

View File

@ -27,7 +27,7 @@ namespace Storage::MassStorage {
*/
class MassStorageDevice {
public:
virtual ~MassStorageDevice() {}
virtual ~MassStorageDevice() = default;
/*!
@returns The size of each individual block.

View File

@ -39,7 +39,7 @@ class Tape {
Time length;
Pulse(Type type, Time length) : type(type), length(length) {}
Pulse() {}
Pulse() = default;
};
/*!
@ -78,7 +78,7 @@ class Tape {
*/
virtual void seek(Time &time);
virtual ~Tape() {};
virtual ~Tape() = default;
private:
uint64_t offset_;
@ -98,7 +98,7 @@ class Tape {
class TapePlayer: public TimedEventLoop, public ClockingHint::Source {
public:
TapePlayer(int input_clock_rate);
virtual ~TapePlayer() {}
virtual ~TapePlayer() = default;
void set_tape(std::shared_ptr<Storage::Tape::Tape> tape);
bool has_tape();