diff --git a/Components/1770/1770.cpp b/Components/1770/1770.cpp index 6fffad845..d03d8166c 100644 --- a/Components/1770/1770.cpp +++ b/Components/1770/1770.cpp @@ -137,23 +137,23 @@ void WD1770::run_for(const Cycles cycles) { void WD1770::posit_event(const int new_event_type) { #define WAIT_FOR_EVENT(mask) { \ - interesting_event_mask_ = int(mask); \ + interesting_event_mask_ = int(mask); \ static constexpr int location = __COUNTER__ + 1; \ - resume_point_ = location; \ - return; \ + resume_point_ = location; \ + return; \ case location: \ (void)0; \ } -#define WAIT_FOR_TIME(ms) \ - delay_time_ = ms * 8000; \ +#define WAIT_FOR_TIME(ms) \ + delay_time_ = ms * 8000; \ WAIT_FOR_EVENT(Event1770::Timer); -#define WAIT_FOR_BYTES(count) \ - distance_into_section_ = 0; \ - WAIT_FOR_EVENT(Event::Token); \ +#define WAIT_FOR_BYTES(count) \ + distance_into_section_ = 0; \ + WAIT_FOR_EVENT(Event::Token); \ distance_into_section_ += get_latest_token().type == Token::Byte; \ - if(distance_into_section_ < count) { \ + if(distance_into_section_ < count) { \ RESUME_WAIT(Event::Token); \ } diff --git a/Components/8272/i8272.cpp b/Components/8272/i8272.cpp index c1286f96c..c1203517a 100644 --- a/Components/8272/i8272.cpp +++ b/Components/8272/i8272.cpp @@ -150,22 +150,22 @@ void i8272::posit_event(const int event_type) { #define WAIT_FOR_EVENT(mask) { \ static constexpr int location = __COUNTER__ + 1; \ - resume_point_ = location; \ - interesting_event_mask_ = int(mask); \ - return; \ + resume_point_ = location; \ + interesting_event_mask_ = int(mask); \ + return; \ case location: \ (void)0; \ } #define WAIT_FOR_TIME(ms) { \ static constexpr int location = __COUNTER__ + 1; \ - interesting_event_mask_ = int(Event8272::Timer); \ - delay_time_ = ms_to_cycles(ms); \ + interesting_event_mask_ = int(Event8272::Timer); \ + delay_time_ = ms_to_cycles(ms); \ is_sleeping_ = false; \ - update_clocking_observer(); \ + update_clocking_observer(); \ resume_point_ = location; \ - [[fallthrough]]; \ - case location: \ + [[fallthrough]]; \ + case location: \ if(delay_time_) return; \ } diff --git a/InstructionSets/x86/Decoder.cpp b/InstructionSets/x86/Decoder.cpp index a394d8fe1..f42c3fc7b 100644 --- a/InstructionSets/x86/Decoder.cpp +++ b/InstructionSets/x86/Decoder.cpp @@ -909,7 +909,7 @@ std::pair::InstructionT> Decoder::decode( destination_ = source_ = memreg; switch(reg) { - default: return undefined(); + default: return undefined(); case 0: set(Operation::SLDT); break; case 1: set(Operation::STR); break; @@ -924,7 +924,7 @@ std::pair::InstructionT> Decoder::decode( destination_ = source_ = memreg; switch(reg) { - default: return undefined(); + default: return undefined(); case 0: set(Operation::SGDT); break; case 1: set(Operation::SIDT); break; diff --git a/InstructionSets/x86/Descriptors.hpp b/InstructionSets/x86/Descriptors.hpp index 6dc0d0415..e195fa028 100644 --- a/InstructionSets/x86/Descriptors.hpp +++ b/InstructionSets/x86/Descriptors.hpp @@ -204,7 +204,7 @@ struct SegmentDescriptor { /// Accesses must be `>= bounds().begin` and `<= bounds().end`. DescriptorBounds bounds() const { return bounds_; } - bool present() const { return type_ & 0x80; } + bool present() const { return type_ & 0x80; } int privilege_level() const { return (type_ >> 5) & 3; } uint8_t access_rights() const { return uint8_t(type_); } diff --git a/InstructionSets/x86/Implementation/Arithmetic.hpp b/InstructionSets/x86/Implementation/Arithmetic.hpp index cdd24823b..5133c9de7 100644 --- a/InstructionSets/x86/Implementation/Arithmetic.hpp +++ b/InstructionSets/x86/Implementation/Arithmetic.hpp @@ -290,7 +290,7 @@ void idiv( FI; ELSE (* quadword/doubleword operation *) temp ← EDX:EAX / SRC; (* signed division *) - IF (temp > 7FFFFFFFH) OR (temp < 80000000H) (* if a positive result is greater than 7FFFFFFFH + IF (temp > 7FFFFFFFH) OR (temp < 80000000H) (* if a positive result is greater than 7FFFFFFFH or a negative result is less than 80000000H *) THEN #DE; (* divide error *) ; ELSE diff --git a/InstructionSets/x86/Implementation/PerformImplementation.hpp b/InstructionSets/x86/Implementation/PerformImplementation.hpp index 6f7405845..8eea4c669 100644 --- a/InstructionSets/x86/Implementation/PerformImplementation.hpp +++ b/InstructionSets/x86/Implementation/PerformImplementation.hpp @@ -450,8 +450,12 @@ template < } return; - case Operation::OUT: Primitive::out(port(instruction.destination().source()), pair_low(), context); return; - case Operation::IN: Primitive::in(port(instruction.source().source()), pair_low(), context); return; + case Operation::OUT: + Primitive::out(port(instruction.destination().source()), pair_low(), context); + return; + case Operation::IN: + Primitive::in(port(instruction.source().source()), pair_low(), context); + return; case Operation::XLAT: Primitive::xlat(instruction, context); return; diff --git a/InstructionSets/x86/Implementation/ShiftRoll.hpp b/InstructionSets/x86/Implementation/ShiftRoll.hpp index b3f56be29..80083e286 100644 --- a/InstructionSets/x86/Implementation/ShiftRoll.hpp +++ b/InstructionSets/x86/Implementation/ShiftRoll.hpp @@ -299,10 +299,10 @@ void sal( } else { const auto mask = (Numeric::top_bit() >> (count - 1)); context.flags.template set_from( - destination & mask + destination & mask ); context.flags.template set_from(IntT( - (destination ^ (destination << 1)) & mask + (destination ^ (destination << 1)) & mask )); destination <<= count; } diff --git a/InstructionSets/x86/Registers.hpp b/InstructionSets/x86/Registers.hpp index 4560956c1..d38cd7ad1 100644 --- a/InstructionSets/x86/Registers.hpp +++ b/InstructionSets/x86/Registers.hpp @@ -127,8 +127,8 @@ public: template void set(const DescriptorTablePointer location) { switch(table) { - case DescriptorTable::Local: local_ = location; break; - case DescriptorTable::Global: global_ = location; break; + case DescriptorTable::Local: local_ = location; break; + case DescriptorTable::Global: global_ = location; break; case DescriptorTable::Interrupt: interrupt_ = location; break; } } diff --git a/Machines/Acorn/BBCMicro/Keyboard.hpp b/Machines/Acorn/BBCMicro/Keyboard.hpp index ebca423b5..964f8ab66 100644 --- a/Machines/Acorn/BBCMicro/Keyboard.hpp +++ b/Machines/Acorn/BBCMicro/Keyboard.hpp @@ -43,8 +43,8 @@ enum class Key: uint16_t { ForwardSlash = 0x68, Bit1 = 0x08, - Right = 0x79, Left = 0x19, Down = 0x29, Up = 0x39, - Return = 0x49, Delete = 0x59, Copy = 0x69, Bit0 = 0x09, + Right = 0x79, Left = 0x19, Down = 0x29, Up = 0x39, + Return = 0x49, Delete = 0x59, Copy = 0x69, Bit0 = 0x09, // // Break; a key, but not on the keyboard matrix. @@ -60,12 +60,12 @@ enum class Key: uint16_t { // // Master only keys. // - Keypad4 = 0x7a, Keypad6 = 0x1a, Keypad8 = 0x2a, KeypadPlus = 0x3a, - KeypadDivide = 0x4a, KeypadHash = 0x5a, Keypad0 = 0x6a, - Keypad5 = 0x7b, Keypad7 = 0x1b, Keypad9 = 0x2b, KeypadMinus = 0x3b, - KeypadDeleted = 0x4b, KeypadMultiply = 0x5b, Keypad1 = 0x6b, - Keypad2 = 0x7c, F11 = 0x1c, PauseBreak = 0x2c, KeypadReturn = 0x3c, - KeypadDot = 0x4c, KeypadComma = 0x5c, Keypad3 = 0x6c, + Keypad4 = 0x7a, Keypad6 = 0x1a, Keypad8 = 0x2a, KeypadPlus = 0x3a, + KeypadDivide = 0x4a, KeypadHash = 0x5a, Keypad0 = 0x6a, + Keypad5 = 0x7b, Keypad7 = 0x1b, Keypad9 = 0x2b, KeypadMinus = 0x3b, + KeypadDeleted = 0x4b, KeypadMultiply = 0x5b, Keypad1 = 0x6b, + Keypad2 = 0x7c, F11 = 0x1c, PauseBreak = 0x2c, KeypadReturn = 0x3c, + KeypadDot = 0x4c, KeypadComma = 0x5c, Keypad3 = 0x6c, Alt = 0x02, LeftShift = 0x03, diff --git a/Machines/Commodore/Vic-20/Vic20.cpp b/Machines/Commodore/Vic-20/Vic20.cpp index a4371c3d9..698874174 100644 --- a/Machines/Commodore/Vic-20/Vic20.cpp +++ b/Machines/Commodore/Vic-20/Vic20.cpp @@ -253,7 +253,7 @@ public: void did_set_input(const Input &digital_input, const bool is_active) final { if(const auto mapped_input = [&]() -> std::optional { switch(digital_input.type) { - default: return std::nullopt; + default: return std::nullopt; case Input::Up: return Up; case Input::Down: return Down; case Input::Left: return Left; diff --git a/Machines/PCCompatible/DMA.hpp b/Machines/PCCompatible/DMA.hpp index 6872033bc..8a3e6eafb 100644 --- a/Machines/PCCompatible/DMA.hpp +++ b/Machines/PCCompatible/DMA.hpp @@ -104,9 +104,9 @@ public: return channels_[channel].address.halves.low; } } - } - case 0x8: return status(); - case 0xd: return temporary_register(); + } + case 0x8: return status(); + case 0xd: return temporary_register(); } } diff --git a/Machines/PCCompatible/KeyboardController.hpp b/Machines/PCCompatible/KeyboardController.hpp index f379c78ef..ae435ca11 100644 --- a/Machines/PCCompatible/KeyboardController.hpp +++ b/Machines/PCCompatible/KeyboardController.hpp @@ -266,7 +266,7 @@ public: // Status: // b7 = 1 => parity error on transmission; // b6 = 1 => receive timeout; - // b5 = 1 => transmit timeout; + // b5 = 1 => transmit timeout; // b4 = 1 => keyboard enabled via physical key; // b3 = 1 = data at 0060 is command, 0 = data; // b2 = 1 = selftest OK; 0 = just powered up or reset; @@ -328,7 +328,7 @@ private: switch(command) { case Command::SelfTest: return 15; - default: return 0; + default: return 0; } } @@ -448,11 +448,11 @@ private: bool has_input_ = false; bool has_command_ = false; - // bit 7 = 0 keyboard inhibited - // bit 6 = 0 CGA, else MDA - // bit 5 = 0 manufacturing jumper installed - // bit 4 = 0 system RAM 512K, else 640K - // bit 3-0 reserved + // bit 7 = 0 keyboard inhibited + // bit 6 = 0 CGA, else MDA + // bit 5 = 0 manufacturing jumper installed + // bit 4 = 0 system RAM 512K, else 640K + // bit 3-0 reserved uint8_t switches_ = 0b1011'0000; int perform_delay_ = 0; diff --git a/Machines/PCCompatible/PCCompatible.cpp b/Machines/PCCompatible/PCCompatible.cpp index 53092b90a..a77ad7a98 100644 --- a/Machines/PCCompatible/PCCompatible.cpp +++ b/Machines/PCCompatible/PCCompatible.cpp @@ -540,14 +540,14 @@ private: case 0x0086: return dma_.pages.template page<6>(); case 0x0087: return dma_.pages.template page<7>(); - case 0x0088: if(require_at(port)) return dma_.pages.template page<0x8>(); break; - case 0x0089: if(require_at(port)) return dma_.pages.template page<0x9>(); break; - case 0x008a: if(require_at(port)) return dma_.pages.template page<0xa>(); break; - case 0x008b: if(require_at(port)) return dma_.pages.template page<0xb>(); break; - case 0x008c: if(require_at(port)) return dma_.pages.template page<0xc>(); break; - case 0x008d: if(require_at(port)) return dma_.pages.template page<0xd>(); break; - case 0x008e: if(require_at(port)) return dma_.pages.template page<0xe>(); break; - case 0x008f: if(require_at(port)) return dma_.pages.template page<0xf>(); break; + case 0x0088: if(require_at(port)) return dma_.pages.template page<0x8>(); break; + case 0x0089: if(require_at(port)) return dma_.pages.template page<0x9>(); break; + case 0x008a: if(require_at(port)) return dma_.pages.template page<0xa>(); break; + case 0x008b: if(require_at(port)) return dma_.pages.template page<0xb>(); break; + case 0x008c: if(require_at(port)) return dma_.pages.template page<0xc>(); break; + case 0x008d: if(require_at(port)) return dma_.pages.template page<0xd>(); break; + case 0x008e: if(require_at(port)) return dma_.pages.template page<0xe>(); break; + case 0x008f: if(require_at(port)) return dma_.pages.template page<0xf>(); break; case 0x03f4: return fdc_.status(); case 0x03f5: return fdc_.read(); diff --git a/Machines/Sinclair/ZXSpectrum/Video.hpp b/Machines/Sinclair/ZXSpectrum/Video.hpp index 989b98609..be38498ac 100644 --- a/Machines/Sinclair/ZXSpectrum/Video.hpp +++ b/Machines/Sinclair/ZXSpectrum/Video.hpp @@ -90,7 +90,7 @@ private: delays[6] * 2, delays[7] * 2 } - {} + {} }; static constexpr Timings get_timings() { diff --git a/OSBindings/Mac/Clock Signal/Views/CSScanTargetView.m b/OSBindings/Mac/Clock Signal/Views/CSScanTargetView.m index fc472d946..1b018ebce 100644 --- a/OSBindings/Mac/Clock Signal/Views/CSScanTargetView.m +++ b/OSBindings/Mac/Clock Signal/Views/CSScanTargetView.m @@ -236,7 +236,7 @@ static CVReturn DisplayLinkCallback(__unused CVDisplayLinkRef displayLink, const } _windowTrackingArea = [[NSTrackingArea alloc] - initWithRect:self.bounds + initWithRect:self.bounds options:NSTrackingMouseEnteredAndExited | NSTrackingMouseMoved | NSTrackingActiveWhenFirstResponder owner:self userInfo:nil]; diff --git a/OSBindings/Mac/Clock SignalTests/8088Tests.mm b/OSBindings/Mac/Clock SignalTests/8088Tests.mm index cc2ebc6d9..203366fb2 100644 --- a/OSBindings/Mac/Clock SignalTests/8088Tests.mm +++ b/OSBindings/Mac/Clock SignalTests/8088Tests.mm @@ -46,7 +46,7 @@ NSSet *const allowList = [NSSet setWithArray:@[ // "Known bad" test hashes. NSSet *knownBad = [NSSet setWithArray:@[ // Things that ostensibly push an SS to the stack rather than CS, likely due to a recording error: - @"7df1d2a948c416f5a4416e2f747d2d357d497570", // ce.json; INTO + @"7df1d2a948c416f5a4416e2f747d2d357d497570", // ce.json; INTO @"ab0cea0f2b89ae469a98eaf20dedc9ff2ca08c91", // ff.3.json; far CALL @"ba5bb16b5a4306333a359c3abd2169b871ffa42c", // cd.json; int 3bh diff --git a/OSBindings/Mac/Clock SignalTests/FUSETests.swift b/OSBindings/Mac/Clock SignalTests/FUSETests.swift index 203f88c1a..78122eb7b 100644 --- a/OSBindings/Mac/Clock SignalTests/FUSETests.swift +++ b/OSBindings/Mac/Clock SignalTests/FUSETests.swift @@ -117,7 +117,7 @@ fileprivate struct RegisterState { interruptMode = Int(machine.value(for: .IM)) isHalted = machine.isHalted - tStates = 0 // TODO (?) + tStates = 0 // TODO (?) memptr = machine.value(for: .memPtr) } } diff --git a/Processors/6502Mk2/Perform.hpp b/Processors/6502Mk2/Perform.hpp index 686d49d63..cf9894d77 100644 --- a/Processors/6502Mk2/Perform.hpp +++ b/Processors/6502Mk2/Perform.hpp @@ -413,7 +413,7 @@ void perform( case ASL: Operations::asl(registers, operand); break; case ASO: Operations::aso(registers, operand); break; case ROL: Operations::rol(registers, operand); break; - case RLA: Operations::rla(registers, operand); break; + case RLA: Operations::rla(registers, operand); break; case LSR: Operations::lsr(registers, operand); break; case LSE: Operations::lse(registers, operand); break; case ASR: Operations::asr(registers, operand); break; @@ -448,7 +448,7 @@ void perform( case SBC: Operations::sbc(registers, operand); break; case ADC: Operations::adc(registers, operand); break; case ARR: Operations::arr(registers, operand); break; - case SBX: Operations::sbx(registers, operand); break; + case SBX: Operations::sbx(registers, operand); break; } } diff --git a/Processors/Z80/Implementation/Z80Storage.cpp b/Processors/Z80/Implementation/Z80Storage.cpp index 7d3785d3e..f1d6c0701 100644 --- a/Processors/Z80/Implementation/Z80Storage.cpp +++ b/Processors/Z80/Implementation/Z80Storage.cpp @@ -363,7 +363,7 @@ void ProcessorStorage::assemble_base_page(InstructionPage &target, RegisterPair1 DEC_INC_DEC_LD(de_, de_.halves.low), /* 0x1f RRA */ Sequence({MicroOp::RRA}), - /* 0x20 JR NZ */ JR(TestNZ), /* 0x21 LD HL, nn */ Sequence(Read16Inc(pc_, index)), + /* 0x20 JR NZ */ JR(TestNZ), /* 0x21 LD HL, nn */ Sequence(Read16Inc(pc_, index)), /* 0x22 LD (nn), HL */ Sequence(Read16Inc(pc_, memptr_), Write16(memptr_, index)), /* 0x23 INC HL; 0x24 INC H; 0x25 DEC H; 0x26 LD H, n */ diff --git a/Storage/Disk/DiskImage/Formats/WOZ.cpp b/Storage/Disk/DiskImage/Formats/WOZ.cpp index f431ec36d..e323b4ae8 100644 --- a/Storage/Disk/DiskImage/Formats/WOZ.cpp +++ b/Storage/Disk/DiskImage/Formats/WOZ.cpp @@ -49,7 +49,7 @@ WOZ::WOZ(const std::string &file_name) : // Test the CRC. const uint32_t computed_crc = CRC::CRC32::crc_of(post_crc_contents_); if(crc != computed_crc) { - throw Error::InvalidFormat; + throw Error::InvalidFormat; } // Retreat to the first byte after the CRC. diff --git a/Storage/Disk/Parsers/FAT.cpp b/Storage/Disk/Parsers/FAT.cpp index 716c694c5..3f53e71f5 100644 --- a/Storage/Disk/Parsers/FAT.cpp +++ b/Storage/Disk/Parsers/FAT.cpp @@ -23,7 +23,7 @@ FAT::Volume::CHS FAT::Volume::chs_for_sector(int sector) const { track / head_count, track % head_count, 1 + (sector % sectors_per_track) - }; + }; } int FAT::Volume::sector_for_cluster(uint16_t cluster) const { diff --git a/Storage/Tape/Formats/CSW.hpp b/Storage/Tape/Formats/CSW.hpp index 180d93740..4e99196cb 100644 --- a/Storage/Tape/Formats/CSW.hpp +++ b/Storage/Tape/Formats/CSW.hpp @@ -44,7 +44,7 @@ public: private: void set_data(std::vector &&data, CompressionType type); - std::unique_ptr format_serialiser() const override; + std::unique_ptr format_serialiser() const override; struct Serialiser: public FormatSerialiser { Serialiser(const std::vector &data, Pulse); diff --git a/Storage/TargetPlatforms.hpp b/Storage/TargetPlatforms.hpp index 42e52eac2..611b677b9 100644 --- a/Storage/TargetPlatforms.hpp +++ b/Storage/TargetPlatforms.hpp @@ -58,7 +58,7 @@ enum Type: IntType { AllDisk = Acorn | Commodore | AmstradCPC | C64 | Oric | MSX | ZXSpectrum | Macintosh | AtariST | DiskII | PCCompatible | FAT12, AllTape = Acorn | AmstradCPC | Commodore8bit | Oric | ZX8081 | MSX | ZXSpectrum, - All = ~IntType(0), + All = ~IntType(0), }; class Distinguisher {