From 2f53d58cd92b7a9c164f90018ec7bf5b20a2edb1 Mon Sep 17 00:00:00 2001 From: Megamouse Date: Mon, 15 Apr 2024 08:49:01 +0200 Subject: [PATCH] fix some warnings --- rpcs3/Emu/Cell/Modules/cellGame.cpp | 1 + rpcs3/Emu/Cell/Modules/cellSysutilAvc2.cpp | 4 ++-- rpcs3/Emu/Cell/lv2/sys_rsxaudio.cpp | 2 -- rpcs3/Emu/RSX/NV47/HW/common.cpp | 4 ++-- rpcs3/Emu/RSX/NV47/HW/nv4097.cpp | 4 ++-- rpcs3/Emu/RSX/NV47/HW/nv4097.h | 16 ++++++++-------- rpcs3/Emu/savestate_utils.cpp | 2 +- rpcs3/Emu/system_config.cpp | 2 +- rpcs3/emucore.vcxproj.filters | 6 +++--- 9 files changed, 20 insertions(+), 21 deletions(-) diff --git a/rpcs3/Emu/Cell/Modules/cellGame.cpp b/rpcs3/Emu/Cell/Modules/cellGame.cpp index 0e551dbed5..6ae7ed6ea1 100644 --- a/rpcs3/Emu/Cell/Modules/cellGame.cpp +++ b/rpcs3/Emu/Cell/Modules/cellGame.cpp @@ -210,6 +210,7 @@ void fmt_class_string::format(std::string& out { switch (error) { + STR_CASE(disc_change_manager::eject_state::unknown); STR_CASE(disc_change_manager::eject_state::inserted); STR_CASE(disc_change_manager::eject_state::ejected); STR_CASE(disc_change_manager::eject_state::busy); diff --git a/rpcs3/Emu/Cell/Modules/cellSysutilAvc2.cpp b/rpcs3/Emu/Cell/Modules/cellSysutilAvc2.cpp index d8d38e9545..5e8e59b7a2 100644 --- a/rpcs3/Emu/Cell/Modules/cellSysutilAvc2.cpp +++ b/rpcs3/Emu/Cell/Modules/cellSysutilAvc2.cpp @@ -77,7 +77,7 @@ struct avc2_settings u8 video_stream_sharing = 0; u32 total_video_bitrate = 0; - static bool saveable(bool is_writing) noexcept + static bool saveable(bool /*is_writing*/) noexcept { return GET_SERIALIZATION_VERSION(cellSysutil) != 0; } @@ -698,7 +698,7 @@ error_code cellSysutilAvc2SetSpeakerMuting(u8 muting) return CELL_OK; } -error_code cellSysutilAvc2Load_shared(SceNpMatching2ContextId ctx_id, u32 container, vm::ptr callback_func, vm::ptr user_data, vm::cptr init_param) +error_code cellSysutilAvc2Load_shared(SceNpMatching2ContextId /*ctx_id*/, u32 /*container*/, vm::ptr callback_func, vm::ptr user_data, vm::cptr init_param) { if (!init_param || !init_param->avc_init_param_version || !(init_param->avc_init_param_version == 100 || diff --git a/rpcs3/Emu/Cell/lv2/sys_rsxaudio.cpp b/rpcs3/Emu/Cell/lv2/sys_rsxaudio.cpp index 427c6ecc47..197a9027bb 100644 --- a/rpcs3/Emu/Cell/lv2/sys_rsxaudio.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_rsxaudio.cpp @@ -1731,14 +1731,12 @@ void rsxaudio_backend_thread::backend_init(const rsxaudio_state& ra_state, const const AudioChannelCnt ch_cnt = static_cast(std::min(static_cast(port_cfg.ch_cnt), static_cast(emu_cfg.channels))); f64 cb_frame_len = 0.0; - u32 backend_ch_cnt = 2; audio_channel_layout backend_channel_layout = audio_channel_layout::stereo; if (backend->Open(emu_cfg.audio_device, port_cfg.freq, sample_size, ch_cnt, emu_cfg.channel_layout)) { cb_frame_len = backend->GetCallbackFrameLen(); backend_channel_layout = backend->get_channel_layout(); - backend_ch_cnt = backend->get_channels(); sys_rsxaudio.notice("Opened audio backend (sampling_rate=%d, sample_size=%d, channels=%d, layout=%s)", backend->get_sampling_rate(), backend->get_sample_size(), backend->get_channels(), backend->get_channel_layout()); } else diff --git a/rpcs3/Emu/RSX/NV47/HW/common.cpp b/rpcs3/Emu/RSX/NV47/HW/common.cpp index 79e6742433..478a345b2d 100644 --- a/rpcs3/Emu/RSX/NV47/HW/common.cpp +++ b/rpcs3/Emu/RSX/NV47/HW/common.cpp @@ -30,7 +30,7 @@ namespace rsx REGS(ctx)->register_vertex_info[attrib_index].data[channel_select] = value; } - void push_draw_parameter_change(rsx::context* ctx, rsx::command_barrier_type type, u32 reg, u32 arg) + void push_draw_parameter_change(rsx::context* ctx, rsx::command_barrier_type /*type*/, u32 reg, u32 arg) { if (REGS(ctx)->latch == arg || !RSX(ctx)->in_begin_end || @@ -46,7 +46,7 @@ namespace rsx REGS(ctx)->current_draw_clause.insert_command_barrier(index_base_modifier_barrier, arg); } - u32 get_report_data_impl(rsx::context* ctx, u32 offset) + u32 get_report_data_impl([[maybe_unused]] rsx::context* ctx, u32 offset) { u32 location = 0; blit_engine::context_dma report_dma = REGS(ctx)->context_dma_report(); diff --git a/rpcs3/Emu/RSX/NV47/HW/nv4097.cpp b/rpcs3/Emu/RSX/NV47/HW/nv4097.cpp index 9eac6aedd2..ff1da48157 100644 --- a/rpcs3/Emu/RSX/NV47/HW/nv4097.cpp +++ b/rpcs3/Emu/RSX/NV47/HW/nv4097.cpp @@ -20,7 +20,7 @@ namespace rsx RSX(ctx)->m_graphics_state |= rsx::pipeline_state::fragment_program_ucode_dirty; } - void set_transform_constant::impl(context* ctx, u32 reg, u32 arg) + void set_transform_constant::impl(context* ctx, u32 reg, u32 /*arg*/) { const u32 index = reg - NV4097_SET_TRANSFORM_CONSTANT; const u32 constant_id = index / 4; @@ -77,7 +77,7 @@ namespace rsx RSX(ctx)->fifo_ctrl->skip_methods(rcount - 1); } - void set_transform_program::impl(context* ctx, u32 reg, u32 arg) + void set_transform_program::impl(context* ctx, u32 reg, u32 /*arg*/) { const u32 index = reg - NV4097_SET_TRANSFORM_PROGRAM; diff --git a/rpcs3/Emu/RSX/NV47/HW/nv4097.h b/rpcs3/Emu/RSX/NV47/HW/nv4097.h index fbefa5f85c..4d72acb494 100644 --- a/rpcs3/Emu/RSX/NV47/HW/nv4097.h +++ b/rpcs3/Emu/RSX/NV47/HW/nv4097.h @@ -124,7 +124,7 @@ namespace rsx template struct set_vertex_data4ub_m { - static void impl(context* ctx, u32 reg, u32 arg) + static void impl(context* ctx, u32 /*reg*/, u32 arg) { set_vertex_data_impl(ctx, arg); } @@ -133,7 +133,7 @@ namespace rsx template struct set_vertex_data1f_m { - static void impl(context* ctx, u32 reg, u32 arg) + static void impl(context* ctx, u32 /*reg*/, u32 arg) { set_vertex_data_impl(ctx, arg); } @@ -142,7 +142,7 @@ namespace rsx template struct set_vertex_data2f_m { - static void impl(context* ctx, u32 reg, u32 arg) + static void impl(context* ctx, u32 /*reg*/, u32 arg) { set_vertex_data_impl(ctx, arg); } @@ -151,7 +151,7 @@ namespace rsx template struct set_vertex_data3f_m { - static void impl(context* ctx, u32 reg, u32 arg) + static void impl(context* ctx, u32 /*reg*/, u32 arg) { //Register alignment is only 1, 2, or 4 (Rachet & Clank 2) set_vertex_data_impl(ctx, arg); @@ -161,7 +161,7 @@ namespace rsx template struct set_vertex_data4f_m { - static void impl(context* ctx, u32 reg, u32 arg) + static void impl(context* ctx, u32 /*reg*/, u32 arg) { set_vertex_data_impl(ctx, arg); } @@ -170,7 +170,7 @@ namespace rsx template struct set_vertex_data2s_m { - static void impl(context* ctx, u32 reg, u32 arg) + static void impl(context* ctx, u32 /*reg*/, u32 arg) { set_vertex_data_impl(ctx, arg); } @@ -179,7 +179,7 @@ namespace rsx template struct set_vertex_data4s_m { - static void impl(context* ctx, u32 reg, u32 arg) + static void impl(context* ctx, u32 /*reg*/, u32 arg) { set_vertex_data_impl(ctx, arg); } @@ -188,7 +188,7 @@ namespace rsx template struct set_vertex_data_scaled4s_m { - static void impl(context* ctx, u32 reg, u32 arg) + static void impl(context* ctx, u32 /*reg*/, u32 arg) { set_vertex_data_impl(ctx, arg); } diff --git a/rpcs3/Emu/savestate_utils.cpp b/rpcs3/Emu/savestate_utils.cpp index 0c6170cc78..18d41b6507 100644 --- a/rpcs3/Emu/savestate_utils.cpp +++ b/rpcs3/Emu/savestate_utils.cpp @@ -391,7 +391,7 @@ extern u16 serial_breathe_and_tag(utils::serial& ar, std::string_view name, bool [[noreturn]] void hle_locks_t::lock() { // Unreachable - ensure(false); + fmt::throw_exception("Unreachable"); } bool hle_locks_t::try_lock() diff --git a/rpcs3/Emu/system_config.cpp b/rpcs3/Emu/system_config.cpp index 25aaa23709..b1b1295b81 100644 --- a/rpcs3/Emu/system_config.cpp +++ b/rpcs3/Emu/system_config.cpp @@ -13,6 +13,6 @@ bool cfg_root::node_core::enable_tsx_by_default() std::string cfg_root::node_sys::get_random_system_name() { - std::srand(std::time(nullptr)); + std::srand(static_cast(std::time(nullptr))); return "RPCS3-" + std::to_string(100 + std::rand() % 899); } diff --git a/rpcs3/emucore.vcxproj.filters b/rpcs3/emucore.vcxproj.filters index 2c817b8acf..322fc2dc02 100644 --- a/rpcs3/emucore.vcxproj.filters +++ b/rpcs3/emucore.vcxproj.filters @@ -2172,9 +2172,6 @@ Emu - - Utilities - Emu @@ -2521,6 +2518,9 @@ Emu\GPU\RSX\NV47\FW + + Emu +