diff --git a/Analyser/Dynamic/MultiMachine/Implementation/MultiCRTMachine.cpp b/Analyser/Dynamic/MultiMachine/Implementation/MultiCRTMachine.cpp index ceb651eab..6c1c4c090 100644 --- a/Analyser/Dynamic/MultiMachine/Implementation/MultiCRTMachine.cpp +++ b/Analyser/Dynamic/MultiMachine/Implementation/MultiCRTMachine.cpp @@ -72,7 +72,7 @@ Outputs::Speaker::Speaker *MultiCRTMachine::get_speaker() { } void MultiCRTMachine::run_for(Time::Seconds duration) { - perform_parallel([=](::CRTMachine::Machine *machine) { + perform_parallel([duration](::CRTMachine::Machine *machine) { if(machine->get_confidence() >= 0.01f) machine->run_for(duration); }); @@ -82,7 +82,7 @@ void MultiCRTMachine::run_for(Time::Seconds duration) { void MultiCRTMachine::did_change_machine_order() { if(scan_target_) scan_target_->will_change_owner(); - perform_serial([=](::CRTMachine::Machine *machine) { + perform_serial([](::CRTMachine::Machine *machine) { machine->set_scan_target(nullptr); }); CRTMachine::Machine *const crt_machine = machines_.front()->crt_machine(); diff --git a/Components/6560/6560.cpp b/Components/6560/6560.cpp index d8fce9a90..7daabcabd 100644 --- a/Components/6560/6560.cpp +++ b/Components/6560/6560.cpp @@ -17,13 +17,13 @@ AudioGenerator::AudioGenerator(Concurrency::DeferringAsyncTaskQueue &audio_queue void AudioGenerator::set_volume(uint8_t volume) { - audio_queue_.defer([=]() { - volume_ = static_cast(volume) * range_multiplier_; + audio_queue_.defer([this, volume]() { + volume_ = int16_t(volume) * range_multiplier_; }); } void AudioGenerator::set_control(int channel, uint8_t value) { - audio_queue_.defer([=]() { + audio_queue_.defer([this, channel, value]() { control_registers_[channel] = value; }); } diff --git a/Components/AY38910/AY38910.cpp b/Components/AY38910/AY38910.cpp index c5544b21a..5a220d7de 100644 --- a/Components/AY38910/AY38910.cpp +++ b/Components/AY38910/AY38910.cpp @@ -210,8 +210,7 @@ void AY38910::set_register_value(uint8_t value) { // If this is a register that affects audio output, enqueue a mutation onto the // audio generation thread. if(selected_register_ < 14) { - const int selected_register = selected_register_; - task_queue_.defer([=] () { + task_queue_.defer([this, selected_register = selected_register_, value] () { // Perform any register-specific mutation to output generation. uint8_t masked_value = value; switch(selected_register) { diff --git a/Components/AudioToggle/AudioToggle.cpp b/Components/AudioToggle/AudioToggle.cpp index fc4f60fb4..5000beacc 100644 --- a/Components/AudioToggle/AudioToggle.cpp +++ b/Components/AudioToggle/AudioToggle.cpp @@ -28,7 +28,7 @@ void Toggle::skip_samples(const std::size_t number_of_samples) {} void Toggle::set_output(bool enabled) { if(is_enabled_ == enabled) return; is_enabled_ = enabled; - audio_queue_.defer([=] { + audio_queue_.defer([this, enabled] { level_ = enabled ? volume_ : 0; }); } diff --git a/Components/KonamiSCC/KonamiSCC.cpp b/Components/KonamiSCC/KonamiSCC.cpp index 79f82a459..9d2fb6ddf 100644 --- a/Components/KonamiSCC/KonamiSCC.cpp +++ b/Components/KonamiSCC/KonamiSCC.cpp @@ -55,7 +55,7 @@ void SCC::write(uint16_t address, uint8_t value) { address &= 0xff; if(address < 0x80) ram_[address] = value; - task_queue_.defer([=] { + task_queue_.defer([this, address, value] { // Check for a write into waveform memory. if(address < 0x80) { waves_[address >> 5].samples[address & 0x1f] = value; diff --git a/Machines/Apple/AppleII/Video.cpp b/Machines/Apple/AppleII/Video.cpp index 373987834..a5b0b38b2 100644 --- a/Machines/Apple/AppleII/Video.cpp +++ b/Machines/Apple/AppleII/Video.cpp @@ -60,7 +60,7 @@ void VideoBase::set_display_type(Outputs::Display::DisplayType display_type) { */ void VideoBase::set_alternative_character_set(bool alternative_character_set) { set_alternative_character_set_ = alternative_character_set; - deferrer_.defer(Cycles(2), [=] { + deferrer_.defer(Cycles(2), [this, alternative_character_set] { alternative_character_set_ = alternative_character_set; if(alternative_character_set) { character_zones[1].address_mask = 0xff; @@ -78,7 +78,7 @@ bool VideoBase::get_alternative_character_set() { void VideoBase::set_80_columns(bool columns_80) { set_columns_80_ = columns_80; - deferrer_.defer(Cycles(2), [=] { + deferrer_.defer(Cycles(2), [this, columns_80] { columns_80_ = columns_80; }); } @@ -105,7 +105,7 @@ bool VideoBase::get_page2() { void VideoBase::set_text(bool text) { set_text_ = text; - deferrer_.defer(Cycles(2), [=] { + deferrer_.defer(Cycles(2), [this, text] { text_ = text; }); } @@ -116,7 +116,7 @@ bool VideoBase::get_text() { void VideoBase::set_mixed(bool mixed) { set_mixed_ = mixed; - deferrer_.defer(Cycles(2), [=] { + deferrer_.defer(Cycles(2), [this, mixed] { mixed_ = mixed; }); } @@ -127,7 +127,7 @@ bool VideoBase::get_mixed() { void VideoBase::set_high_resolution(bool high_resolution) { set_high_resolution_ = high_resolution; - deferrer_.defer(Cycles(2), [=] { + deferrer_.defer(Cycles(2), [this, high_resolution] { high_resolution_ = high_resolution; }); } @@ -138,7 +138,7 @@ bool VideoBase::get_high_resolution() { void VideoBase::set_annunciator_3(bool annunciator_3) { set_annunciator_3_ = annunciator_3; - deferrer_.defer(Cycles(2), [=] { + deferrer_.defer(Cycles(2), [this, annunciator_3] { annunciator_3_ = annunciator_3; high_resolution_mask_ = annunciator_3_ ? 0x7f : 0xff; }); diff --git a/Machines/Apple/AppleII/Video.hpp b/Machines/Apple/AppleII/Video.hpp index ec61d5da0..e227bc656 100644 --- a/Machines/Apple/AppleII/Video.hpp +++ b/Machines/Apple/AppleII/Video.hpp @@ -262,7 +262,7 @@ template class Video: public VideoBase { public: /// Constructs an instance of the video feed; a CRT is also created. Video(BusHandler &bus_handler) : - VideoBase(is_iie, [=] (Cycles cycles) { advance(cycles); }), + VideoBase(is_iie, [this] (Cycles cycles) { advance(cycles); }), bus_handler_(bus_handler) {} /*! diff --git a/Machines/Apple/Macintosh/Audio.cpp b/Machines/Apple/Macintosh/Audio.cpp index 3946553fc..0ac016213 100644 --- a/Machines/Apple/Macintosh/Audio.cpp +++ b/Machines/Apple/Macintosh/Audio.cpp @@ -35,7 +35,7 @@ void Audio::set_volume(int volume) { posted_volume_ = volume; // Post the volume change as a deferred event. - task_queue_.defer([=] () { + task_queue_.defer([this, volume] () { volume_ = volume; set_volume_multiplier(); }); @@ -47,7 +47,7 @@ void Audio::set_enabled(bool on) { posted_enable_mask_ = int(on); // Post the enabled mask change as a deferred event. - task_queue_.defer([=] () { + task_queue_.defer([this, on] () { enabled_mask_ = int(on); set_volume_multiplier(); }); diff --git a/Machines/Atari/2600/TIASound.cpp b/Machines/Atari/2600/TIASound.cpp index bc41148eb..463c19d93 100644 --- a/Machines/Atari/2600/TIASound.cpp +++ b/Machines/Atari/2600/TIASound.cpp @@ -18,21 +18,21 @@ Atari2600::TIASound::TIASound(Concurrency::DeferringAsyncTaskQueue &audio_queue) {} void Atari2600::TIASound::set_volume(int channel, uint8_t volume) { - audio_queue_.defer([=]() { - volume_[channel] = volume & 0xf; + audio_queue_.defer([target = &volume_[channel], volume]() { + *target = volume & 0xf; }); } void Atari2600::TIASound::set_divider(int channel, uint8_t divider) { - audio_queue_.defer([=]() { + audio_queue_.defer([this, channel, divider]() { divider_[channel] = divider & 0x1f; divider_counter_[channel] = 0; }); } void Atari2600::TIASound::set_control(int channel, uint8_t control) { - audio_queue_.defer([=]() { - control_[channel] = control & 0xf; + audio_queue_.defer([target = &control_[channel], control]() { + *target = control & 0xf; }); } diff --git a/Machines/Atari/ST/Video.cpp b/Machines/Atari/ST/Video.cpp index 030c8a41e..134f5ed87 100644 --- a/Machines/Atari/ST/Video.cpp +++ b/Machines/Atari/ST/Video.cpp @@ -485,7 +485,7 @@ void Video::write(int address, uint16_t value) { // Sync mode and pixel mode. case 0x05: // Writes to sync mode have a one-cycle delay in effect. - deferrer_.defer(HalfCycles(2), [=] { + deferrer_.defer(HalfCycles(2), [this, value] { sync_mode_ = value; update_output_mode(); }); diff --git a/Machines/Electron/SoundGenerator.cpp b/Machines/Electron/SoundGenerator.cpp index bfede4a77..8e19e5283 100644 --- a/Machines/Electron/SoundGenerator.cpp +++ b/Machines/Electron/SoundGenerator.cpp @@ -36,13 +36,13 @@ void SoundGenerator::skip_samples(std::size_t number_of_samples) { } void SoundGenerator::set_divider(uint8_t divider) { - audio_queue_.defer([=]() { + audio_queue_.defer([this, divider]() { divider_ = divider * 32 / clock_rate_divider; }); } void SoundGenerator::set_is_enabled(bool is_enabled) { - audio_queue_.defer([=]() { + audio_queue_.defer([this, is_enabled]() { is_enabled_ = is_enabled; counter_ = 0; }); diff --git a/OSBindings/Mac/Clock SignalTests/68000ComparativeTests.mm b/OSBindings/Mac/Clock SignalTests/68000ComparativeTests.mm index 38aa41718..7448ec658 100644 --- a/OSBindings/Mac/Clock SignalTests/68000ComparativeTests.mm +++ b/OSBindings/Mac/Clock SignalTests/68000ComparativeTests.mm @@ -149,7 +149,7 @@ } // Run the thing. - const auto comparitor = [=] { + const auto comparitor = [] { // Test the end state. NSDictionary *const finalState = test[@"final state"]; const auto state = test68000->processor.get_state();