Fix some warnings

This commit is contained in:
Megamouse 2026-04-30 17:08:01 +02:00
parent 66d2bc3dd5
commit a8dd053593
14 changed files with 13 additions and 24 deletions

View file

@ -253,10 +253,6 @@ bool try_to_float(f64* out, std::string_view value, f64 min, f64 max, std::strin
bool try_to_string(std::string* out, f64 value, std::string_view name)
{
#ifdef __APPLE__
if (out) *out = std::to_string(value);
return true;
#else
std::array<char, 32> str{};
if (auto [ptr, ec] = std::to_chars(str.data(), str.data() + str.size(), value, std::chars_format::fixed); ec == std::errc())
@ -269,7 +265,6 @@ bool try_to_string(std::string* out, f64 value, std::string_view name)
if (out) cfg_log.error("cfg::try_to_string('%s'): could not convert value '%f' to string. error='%s'", name, value, std::make_error_code(ec).message());
return false;
}
#endif
}
bool cfg::try_to_enum_value(u64* out, decltype(&fmt_class_string<int>::format) func, std::string_view value, std::string_view name)

View file

@ -1112,15 +1112,13 @@ bool fs::is_symlink(const std::string& path)
return true;
}
bool fs::is_optical_raw_device(const std::string& path)
bool fs::is_optical_raw_device([[maybe_unused]] const std::string& path)
{
#ifdef _WIN32
if (path.starts_with("\\\\.\\"))
{
return true;
}
return false;
#endif
return false;
}

View file

@ -74,7 +74,7 @@ enum
};
#endif
inline int futex(volatile void* uaddr, int futex_op, uint val, const timespec* timeout = nullptr, uint mask = 0)
inline int futex(volatile void* uaddr, int futex_op, uint val, const timespec* timeout = nullptr, [[maybe_unused]] uint mask = 0)
{
#ifdef __linux__
return syscall(SYS_futex, uaddr, futex_op, static_cast<int>(val), timeout, nullptr, static_cast<int>(mask));

View file

@ -6625,7 +6625,7 @@ spu_program spu_recompiler_base::analyse(const be_t<u32>* ls, u32 entry_point, s
bool found_loop_dictator = false;
bool found_loop_argument_for_dictator = false;
u32 null_regs_found = 0;
//u32 null_regs_found = 0;
for (u32 i = 0; i < reg->regs.size() && reduced_loop->active; i++)
{
@ -6730,7 +6730,7 @@ spu_program spu_recompiler_base::analyse(const be_t<u32>* ls, u32 entry_point, s
// break;
// }
null_regs_found++;
//null_regs_found++;
continue;
}

View file

@ -1101,7 +1101,7 @@ lv2_file::open_raw_result_t lv2_file::open_raw(const std::string& local_path, s3
return {.error = {}, .file = std::move(file)};
}
lv2_file::open_result_t lv2_file::open(std::string_view vpath, s32 flags, s32 mode, const void* arg, u64 size)
lv2_file::open_result_t lv2_file::open(std::string_view vpath, s32 flags, s32 /*mode*/, const void* arg, u64 size)
{
if (vpath.empty())
{

View file

@ -26,7 +26,7 @@ namespace rsx
{
namespace overlays
{
static std::vector<vertex> generate_unit_quadrant(int num_patch_points, const float offset[2], const float scale[2])
[[maybe_unused]] static std::vector<vertex> generate_unit_quadrant(int num_patch_points, const float offset[2], const float scale[2])
{
ensure(num_patch_points >= 3);
std::vector<vertex> result(num_patch_points + 1);

View file

@ -170,7 +170,6 @@ void CgBinaryDisasm::BuildShaderBody(bool include_glsl)
return;
}
u32 unused;
std::vector<u32> be_data;
// Swap bytes. FP decompiler expects input in BE
@ -190,6 +189,7 @@ void CgBinaryDisasm::BuildShaderBody(bool include_glsl)
rsx_prog.data = reinterpret_cast<u8*>(be_data.data()) + metadata.program_start_offset;
for (u32 i = 0; i < 16; ++i) rsx_prog.texture_state.set_dimension(rsx::texture_dimension_extended::texture_dimension_2d, i);
#ifndef WITHOUT_OPENGL
u32 unused = 0;
GLFragmentDecompilerThread(m_glsl_shader, param_array, rsx_prog, unused).Task();
#endif
}

View file

@ -228,7 +228,6 @@ pad_preview_values mm_joystick_handler::get_preview_values(const std::unordered_
const auto get_key_value = [this, &data](const std::string& str) -> u16
{
bool pressed{};
u16 value{};
// The DS3 Button is considered pressed if any configured button combination is pressed
@ -256,7 +255,6 @@ pad_preview_values mm_joystick_handler::get_preview_values(const std::unordered_
if (combo_pressed)
{
value = std::max(value, combo_val);
pressed = value > 0;
}
}

View file

@ -266,9 +266,10 @@ iso_type_status iso_file_decryption::retrieve_key(iso_archive& archive, std::str
for (const auto& magic : dec_magics)
{
if (node = archive.retrieve(magic.first))
if (iso_fs_node* _node = archive.retrieve(magic.first))
{
magic_value = magic.second;
node = _node;
break;
}
}

View file

@ -11,7 +11,7 @@
LOG_CHANNEL(iso_log, "ISO");
iso_integrity_status iso_file_validation::check_integrity(const std::string& path, const std::string& hash, std::string* game_name)
iso_integrity_status iso_file_validation::check_integrity(const std::string& hash, std::string* game_name)
{
//
// Check for Redump db

View file

@ -29,7 +29,7 @@ private:
iso_hash_status m_status = iso_hash_status::INITIALIZED;
public:
static iso_integrity_status check_integrity(const std::string& path, const std::string& hash, std::string* game_name = nullptr);
static iso_integrity_status check_integrity(const std::string& hash, std::string* game_name = nullptr);
const std::string& get_path() const { return m_path; }
u64 get_size() const { return m_size; }

View file

@ -393,7 +393,7 @@ void game_list_actions::ShowGameIntegrityDialog(const game_info& game)
{
text = "Integrity check completed!\n\n";
switch (m_iso_validator->check_integrity(m_iso_validator->get_path(), hash, &game_name))
switch (m_iso_validator->check_integrity(hash, &game_name))
{
case iso_integrity_status::NO_MATCH:
text += tr("Game check NOT PASSED\n\nNo match found on DB or game corrupted:\n - Hash: %0")

View file

@ -613,7 +613,7 @@ void game_list_context_menu::show_single_selection_context_menu(const game_info&
// That is to highlight a Redump ISO from a non Redump ISO
if (iso_type != iso_type_status::NOT_ISO)
{
const iso_integrity_status iso_integrity = iso_file_validation::check_integrity(current_game.path, "");
const iso_integrity_status iso_integrity = iso_file_validation::check_integrity("");
QAction* check_integrity = addAction(tr("&Check ISO Integrity"));

View file

@ -31,9 +31,6 @@ static std::vector<const AVCodec*> get_video_codecs(const AVOutputFormat* fmt)
void* opaque = nullptr;
while (const AVCodec* codec = av_codec_iterate(&opaque))
{
if (!codec->pix_fmts)
continue;
if (codec->capabilities & AV_CODEC_CAP_EXPERIMENTAL)
continue;