From 8a176de6a132b7a91346431817ffb57f8c840d8d Mon Sep 17 00:00:00 2001 From: Nekotekina Date: Tue, 18 Feb 2020 17:09:38 +0300 Subject: [PATCH] Restore -Wenum-compare and fix some [=] warnings --- rpcs3/Emu/Cell/Modules/cellAudio.h | 4 ++-- rpcs3/Emu/Cell/SPURecompiler.cpp | 6 +++--- rpcs3/Input/evdev_joystick_handler.cpp | 2 +- rpcs3/cmake_modules/ConfigureCompiler.cmake | 1 - rpcs3/rpcs3qt/settings_dialog.cpp | 2 +- 5 files changed, 7 insertions(+), 8 deletions(-) diff --git a/rpcs3/Emu/Cell/Modules/cellAudio.h b/rpcs3/Emu/Cell/Modules/cellAudio.h index 118be6218b..70b00e033b 100644 --- a/rpcs3/Emu/Cell/Modules/cellAudio.h +++ b/rpcs3/Emu/Cell/Modules/cellAudio.h @@ -235,7 +235,7 @@ private: std::unique_ptr m_dump; std::unique_ptr buffer[MAX_AUDIO_BUFFERS]; - const float silence_buffer[AUDIO_MAX_CHANNELS_COUNT * AUDIO_BUFFER_SAMPLES] = { 0 }; + const float silence_buffer[u32{AUDIO_MAX_CHANNELS_COUNT} * u32{AUDIO_BUFFER_SAMPLES}] = { 0 }; bool backend_open = false; bool playing = false; @@ -346,7 +346,7 @@ public: struct key_info { - u8 start_period; // Starting event_period + u8 start_period; // Starting event_period u32 flags; // iFlags u64 source; // Event source u64 key; // Key diff --git a/rpcs3/Emu/Cell/SPURecompiler.cpp b/rpcs3/Emu/Cell/SPURecompiler.cpp index 1f183f78c4..0a9018a33d 100644 --- a/rpcs3/Emu/Cell/SPURecompiler.cpp +++ b/rpcs3/Emu/Cell/SPURecompiler.cpp @@ -1307,11 +1307,11 @@ spu_program spu_recompiler_base::analyse(const be_t* ls, u32 entry_point) // Fill register access info if (auto iflags = s_spu_iflag.decode(data)) { - if (iflags & spu_iflag::use_ra) + if (+iflags & +spu_iflag::use_ra) m_use_ra[pos / 4] = op.ra; - if (iflags & spu_iflag::use_rb) + if (+iflags & +spu_iflag::use_rb) m_use_rb[pos / 4] = op.rb; - if (iflags & spu_iflag::use_rc) + if (+iflags & +spu_iflag::use_rc) m_use_rc[pos / 4] = op.rc; } diff --git a/rpcs3/Input/evdev_joystick_handler.cpp b/rpcs3/Input/evdev_joystick_handler.cpp index 5c3b80a4b1..4f4acf5091 100644 --- a/rpcs3/Input/evdev_joystick_handler.cpp +++ b/rpcs3/Input/evdev_joystick_handler.cpp @@ -292,7 +292,7 @@ void evdev_joystick_handler::get_next_button_press(const std::string& padId, con auto data = GetButtonValues(device); - auto find_value = [=](const std::string& name) + auto find_value = [=, this](const std::string& name) { int key = FindKeyCodeByString(rev_axis_list, name, false); bool dir = key >= 0; diff --git a/rpcs3/cmake_modules/ConfigureCompiler.cmake b/rpcs3/cmake_modules/ConfigureCompiler.cmake index 1cfd3682f0..e25071b380 100644 --- a/rpcs3/cmake_modules/ConfigureCompiler.cmake +++ b/rpcs3/cmake_modules/ConfigureCompiler.cmake @@ -37,7 +37,6 @@ else() add_compile_options(-Wno-invalid-offsetof) add_compile_options(-Wno-unused-function) add_compile_options(-Wno-attributes) - add_compile_options(-Wno-enum-compare) add_compile_options(-Wno-comment) add_compile_options(-Wno-sign-compare) diff --git a/rpcs3/rpcs3qt/settings_dialog.cpp b/rpcs3/rpcs3qt/settings_dialog.cpp index 17e2690150..d76c33f046 100644 --- a/rpcs3/rpcs3qt/settings_dialog.cpp +++ b/rpcs3/rpcs3qt/settings_dialog.cpp @@ -1299,7 +1299,7 @@ settings_dialog::settings_dialog(std::shared_ptr guiSettings, std: { const std::string game_title_format = xemu_settings->GetSetting(emu_settings::WindowTitleFormat); - auto get_game_window_title_label = [=](const QString& new_format) + auto get_game_window_title_label = [=, this](const QString& new_format) { rpcs3::title_format_data title_data; title_data.format = sstr(new_format);