silence some annoying warnings

This commit is contained in:
Megamouse 2019-12-26 21:01:48 +01:00
parent 70e26eeb45
commit ef6f565dbd
18 changed files with 80 additions and 70 deletions

View file

@ -222,7 +222,7 @@ struct cf_t<void>
} }
template<typename T> template<typename T>
static constexpr T insert(T value) static constexpr T insert(T /*value*/)
{ {
return 0; return 0;
} }

View file

@ -535,7 +535,7 @@ constexpr u32 to_u8(char c)
} }
// Convert 2-byte string to u16 value like reinterpret_cast does // Convert 2-byte string to u16 value like reinterpret_cast does
constexpr u16 operator""_u16(const char* s, std::size_t length) constexpr u16 operator""_u16(const char* s, std::size_t /*length*/)
{ {
return return
#if IS_LE_MACHINE == 1 #if IS_LE_MACHINE == 1
@ -544,7 +544,7 @@ constexpr u16 operator""_u16(const char* s, std::size_t length)
} }
// Convert 4-byte string to u32 value like reinterpret_cast does // Convert 4-byte string to u32 value like reinterpret_cast does
constexpr u32 operator""_u32(const char* s, std::size_t length) constexpr u32 operator""_u32(const char* s, std::size_t /*length*/)
{ {
return return
#if IS_LE_MACHINE == 1 #if IS_LE_MACHINE == 1
@ -553,7 +553,7 @@ constexpr u32 operator""_u32(const char* s, std::size_t length)
} }
// Convert 8-byte string to u64 value like reinterpret_cast does // Convert 8-byte string to u64 value like reinterpret_cast does
constexpr u64 operator""_u64(const char* s, std::size_t length) constexpr u64 operator""_u64(const char* s, std::size_t /*length*/)
{ {
return return
#if IS_LE_MACHINE == 1 #if IS_LE_MACHINE == 1

View file

@ -82,10 +82,10 @@ struct vdec_frame
}; };
std::unique_ptr<AVFrame, frame_dtor> avf; std::unique_ptr<AVFrame, frame_dtor> avf;
u64 dts; u64 dts{};
u64 pts; u64 pts{};
u64 userdata; u64 userdata{};
u32 frc; u32 frc{};
bool PicItemRecieved = false; bool PicItemRecieved = false;
AVFrame* operator ->() const AVFrame* operator ->() const

View file

@ -1,4 +1,4 @@
#pragma once #pragma once
#include "PPUFunction.h" #include "PPUFunction.h"
#include "PPUCallback.h" #include "PPUCallback.h"
@ -7,13 +7,13 @@
#include "Emu/Memory/vm_var.h" #include "Emu/Memory/vm_var.h"
// Helper function // Helper function
constexpr const char* ppu_select_name(const char* name, u32 id) constexpr const char* ppu_select_name(const char* name, u32 /*id*/)
{ {
return name; return name;
} }
// Helper function // Helper function
constexpr const char* ppu_select_name(const char* name, const char* orig_name) constexpr const char* ppu_select_name(const char* /*name*/, const char* orig_name)
{ {
return orig_name; return orig_name;
} }

View file

@ -276,12 +276,12 @@ struct ppu_gpr_cast_impl<vm::_ref_base<T, AT>, void>
template <> template <>
struct ppu_gpr_cast_impl<vm::null_t, void> struct ppu_gpr_cast_impl<vm::null_t, void>
{ {
static inline u64 to(const vm::null_t& value) static inline u64 to(const vm::null_t& /*value*/)
{ {
return 0; return 0;
} }
static inline vm::null_t from(const u64 reg) static inline vm::null_t from(const u64 /*reg*/)
{ {
return vm::null; return vm::null;
} }

View file

@ -1,4 +1,4 @@
#pragma once #pragma once
#include "PPCDisAsm.h" #include "PPCDisAsm.h"
#include "SPUOpcodes.h" #include "SPUOpcodes.h"
@ -163,7 +163,7 @@ public:
{ {
op.rb ? UNK(op) : DisAsm("stop", op.opcode & 0x3fff); op.rb ? UNK(op) : DisAsm("stop", op.opcode & 0x3fff);
} }
void LNOP(spu_opcode_t op) void LNOP(spu_opcode_t /*op*/)
{ {
DisAsm("lnop"); DisAsm("lnop");
} }
@ -171,7 +171,7 @@ public:
{ {
DisAsm(op.c ? "syncc" : "sync"); DisAsm(op.c ? "syncc" : "sync");
} }
void DSYNC(spu_opcode_t op) void DSYNC(spu_opcode_t /*op*/)
{ {
DisAsm("dsync"); DisAsm("dsync");
} }

View file

@ -149,7 +149,7 @@ namespace vm
template<> template<>
struct cast_impl<u32> struct cast_impl<u32>
{ {
static vm::addr_t cast(u32 addr, const char* loc) static vm::addr_t cast(u32 addr, const char* /*loc*/)
{ {
return static_cast<vm::addr_t>(addr); return static_cast<vm::addr_t>(addr);
} }
@ -163,7 +163,7 @@ namespace vm
template<> template<>
struct cast_impl<u64> struct cast_impl<u64>
{ {
static vm::addr_t cast(u64 addr, const char* loc) static vm::addr_t cast(u64 addr, const char* /*loc*/)
{ {
return static_cast<vm::addr_t>(static_cast<u32>(addr)); return static_cast<vm::addr_t>(static_cast<u32>(addr));
} }

View file

@ -1,4 +1,4 @@
#pragma once #pragma once
#include <sstream> #include <sstream>
#include "Emu/Memory/vm.h" #include "Emu/Memory/vm.h"
#include "Emu/RSX/GL/GLVertexProgram.h" #include "Emu/RSX/GL/GLVertexProgram.h"
@ -232,7 +232,7 @@ public:
return name; return name;
} }
std::string GetCgParamRes(u32 offset) const std::string GetCgParamRes(u32 /*offset*/) const
{ {
// LOG_WARNING(GENERAL, "GetCgParamRes offset 0x%x", offset); // LOG_WARNING(GENERAL, "GetCgParamRes offset 0x%x", offset);
// TODO // TODO

View file

@ -45,7 +45,7 @@ protected:
} }
// Grow the buffer to hold at least size bytes // Grow the buffer to hold at least size bytes
virtual bool grow(size_t size) virtual bool grow(size_t /*size*/)
{ {
// Stub // Stub
return false; return false;

View file

@ -144,7 +144,7 @@ namespace gl
} }
} }
void dma_transfer(gl::command_context& cmd, gl::texture* src, const areai& /*src_area*/, const utils::address_range& /*valid_range*/, u32 pitch) void dma_transfer(gl::command_context& /*cmd*/, gl::texture* src, const areai& /*src_area*/, const utils::address_range& /*valid_range*/, u32 pitch)
{ {
init_buffer(src); init_buffer(src);
@ -760,7 +760,7 @@ namespace gl
return result; return result;
} }
gl::texture_view* generate_2d_mipmaps_from_images(gl::command_context& cmd, u32 gcm_format, u16 width, u16 height, const std::vector<copy_region_descriptor>& sections_to_copy, gl::texture_view* generate_2d_mipmaps_from_images(gl::command_context& cmd, u32 /*gcm_format*/, u16 width, u16 height, const std::vector<copy_region_descriptor>& sections_to_copy,
const rsx::texture_channel_remap_t& remap_vector) override const rsx::texture_channel_remap_t& remap_vector) override
{ {
const auto _template = sections_to_copy.front().src; const auto _template = sections_to_copy.front().src;
@ -873,7 +873,7 @@ namespace gl
return &cached; return &cached;
} }
cached_texture_section* create_nul_section(gl::command_context& cmd, const utils::address_range& rsx_range, bool memory_load) override cached_texture_section* create_nul_section(gl::command_context& /*cmd*/, const utils::address_range& rsx_range, bool /*memory_load*/) override
{ {
auto& cached = *find_cached_texture(rsx_range, RSX_GCM_FORMAT_IGNORED, true, false); auto& cached = *find_cached_texture(rsx_range, RSX_GCM_FORMAT_IGNORED, true, false);
ASSERT(!cached.is_locked()); ASSERT(!cached.is_locked());

View file

@ -278,7 +278,7 @@ namespace rsx
m_force_repaint = true; m_force_repaint = true;
} }
void perf_metrics_overlay::set_font_size(u32 font_size) void perf_metrics_overlay::set_font_size(u16 font_size)
{ {
if (m_font_size == font_size) if (m_font_size == font_size)
return; return;

View file

@ -32,7 +32,7 @@ namespace rsx
u32 m_update_interval{}; // in ms u32 m_update_interval{}; // in ms
u32 m_frames{}; u32 m_frames{};
std::string m_font{}; std::string m_font{};
u32 m_font_size{}; u16 m_font_size{};
u32 m_margin_x{}; // horizontal distance to the screen border relative to the screen_quadrant in px u32 m_margin_x{}; // horizontal distance to the screen border relative to the screen_quadrant in px
u32 m_margin_y{}; // vertical distance to the screen border relative to the screen_quadrant in px u32 m_margin_y{}; // vertical distance to the screen border relative to the screen_quadrant in px
f32 m_opacity{}; // 0..1 f32 m_opacity{}; // 0..1
@ -68,7 +68,7 @@ namespace rsx
void set_position(screen_quadrant quadrant); void set_position(screen_quadrant quadrant);
void set_update_interval(u32 update_interval); void set_update_interval(u32 update_interval);
void set_font(std::string font); void set_font(std::string font);
void set_font_size(u32 font_size); void set_font_size(u16 font_size);
void set_margins(u32 margin_x, u32 margin_y, bool center_x, bool center_y); void set_margins(u32 margin_x, u32 margin_y, bool center_x, bool center_y);
void set_opacity(f32 opacity); void set_opacity(f32 opacity);
void set_body_colors(std::string color, std::string background); void set_body_colors(std::string color, std::string background);

View file

@ -1025,7 +1025,7 @@ namespace vk
return result; return result;
} }
vk::image_view* generate_2d_mipmaps_from_images(vk::command_buffer& cmd, u32 gcm_format, u16 width, u16 height, vk::image_view* generate_2d_mipmaps_from_images(vk::command_buffer& cmd, u32 /*gcm_format*/, u16 width, u16 height,
const std::vector<copy_region_descriptor>& sections_to_copy, const rsx::texture_channel_remap_t& remap_vector) override const std::vector<copy_region_descriptor>& sections_to_copy, const rsx::texture_channel_remap_t& remap_vector) override
{ {
const auto _template = sections_to_copy.front().src; const auto _template = sections_to_copy.front().src;

View file

@ -251,7 +251,7 @@ int main(int argc, char** argv)
{ {
#ifdef _WIN32 #ifdef _WIN32
if (AttachConsole(ATTACH_PARENT_PROCESS) || AllocConsole()) if (AttachConsole(ATTACH_PARENT_PROCESS) || AllocConsole())
const auto con_out = freopen("CONOUT$", "w", stdout); [[maybe_unused]] const auto con_out = freopen("CONOUT$", "w", stdout);
#endif #endif
for (const auto& style : QStyleFactory::keys()) for (const auto& style : QStyleFactory::keys())
std::cout << "\n" << style.toStdString(); std::cout << "\n" << style.toStdString();

View file

@ -127,7 +127,7 @@ cheat_engine::cheat_engine()
} }
catch (YAML::Exception& e) catch (YAML::Exception& e)
{ {
log_cheat.error("Error parsing %s", cheats_filename); log_cheat.error("Error parsing %s\n%s", cheats_filename, e.what());
} }
} }
@ -223,7 +223,8 @@ bool cheat_engine::resolve_script(u32& final_offset, const u32 offset, const std
operand_sub operand_sub
}; };
auto do_operation = [](const operand op, u32& param1, const u32 param2) -> u32 { auto do_operation = [](const operand op, u32& param1, const u32 param2) -> u32
{
switch (op) switch (op)
{ {
case operand_equal: return param1 = param2; case operand_equal: return param1 = param2;
@ -526,8 +527,12 @@ cheat_manager_dialog::cheat_manager_dialog(QWidget* parent)
setLayout(main_layout); setLayout(main_layout);
// Edit/Manage UI // Edit/Manage UI
connect(tbl_cheats, &QTableWidget::itemClicked, [=](QTableWidgetItem* item) { connect(tbl_cheats, &QTableWidget::itemClicked, [=](QTableWidgetItem* item)
int row = tbl_cheats->currentRow(); {
if (!item)
return;
const int row = item->row();
if (row == -1) if (row == -1)
return; return;
@ -590,7 +595,8 @@ cheat_manager_dialog::cheat_manager_dialog(QWidget* parent)
} }
}); });
connect(tbl_cheats, &QTableWidget::cellChanged, [=](int row, int column) { connect(tbl_cheats, &QTableWidget::cellChanged, [=](int row, int column)
{
if (column != 1 && column != 4) if (column != 1 && column != 4)
{ {
log_cheat.fatal("A column other than description and script was edited"); log_cheat.fatal("A column other than description and script was edited");
@ -614,7 +620,8 @@ cheat_manager_dialog::cheat_manager_dialog(QWidget* parent)
g_cheat.save(); g_cheat.save();
}); });
connect(tbl_cheats, &QTableWidget::customContextMenuRequested, [=](const QPoint& loc) { connect(tbl_cheats, &QTableWidget::customContextMenuRequested, [=](const QPoint& loc)
{
QPoint globalPos = tbl_cheats->mapToGlobal(loc); QPoint globalPos = tbl_cheats->mapToGlobal(loc);
QMenu* menu = new QMenu(); QMenu* menu = new QMenu();
QAction* delete_cheats = new QAction(tr("Delete"), menu); QAction* delete_cheats = new QAction(tr("Delete"), menu);
@ -622,7 +629,8 @@ cheat_manager_dialog::cheat_manager_dialog(QWidget* parent)
QAction* export_cheats = new QAction(tr("Export Cheats")); QAction* export_cheats = new QAction(tr("Export Cheats"));
QAction* reverse_cheat = new QAction(tr("Reverse-Lookup Cheat")); QAction* reverse_cheat = new QAction(tr("Reverse-Lookup Cheat"));
connect(delete_cheats, &QAction::triggered, [=]() { connect(delete_cheats, &QAction::triggered, [=]()
{
const auto selected = tbl_cheats->selectedItems(); const auto selected = tbl_cheats->selectedItems();
std::set<int> rows; std::set<int> rows;
@ -641,13 +649,15 @@ cheat_manager_dialog::cheat_manager_dialog(QWidget* parent)
update_cheat_list(); update_cheat_list();
}); });
connect(import_cheats, &QAction::triggered, [=]() { connect(import_cheats, &QAction::triggered, [=]()
{
QClipboard* clipboard = QGuiApplication::clipboard(); QClipboard* clipboard = QGuiApplication::clipboard();
g_cheat.import_cheats_from_str(clipboard->text().toStdString()); g_cheat.import_cheats_from_str(clipboard->text().toStdString());
update_cheat_list(); update_cheat_list();
}); });
connect(export_cheats, &QAction::triggered, [=]() { connect(export_cheats, &QAction::triggered, [=]()
{
const auto selected = tbl_cheats->selectedItems(); const auto selected = tbl_cheats->selectedItems();
std::set<int> rows; std::set<int> rows;
@ -671,12 +681,13 @@ cheat_manager_dialog::cheat_manager_dialog(QWidget* parent)
clipboard->setText(QString::fromStdString(export_string)); clipboard->setText(QString::fromStdString(export_string));
}); });
connect(reverse_cheat, &QAction::triggered, [=]() { connect(reverse_cheat, &QAction::triggered, [=]()
{
QTableWidgetItem* item = tbl_cheats->item(tbl_cheats->currentRow(), 3); QTableWidgetItem* item = tbl_cheats->item(tbl_cheats->currentRow(), 3);
if (item) if (item)
{ {
u32 offset = item->data(Qt::UserRole).toUInt(); const u32 offset = item->data(Qt::UserRole).toUInt();
u32 result = cheat_engine::reverse_lookup(offset, 32, 12); const u32 result = cheat_engine::reverse_lookup(offset, 32, 12);
log_cheat.fatal("Result is 0x%x", result); log_cheat.fatal("Result is 0x%x", result);
} }
@ -691,8 +702,9 @@ cheat_manager_dialog::cheat_manager_dialog(QWidget* parent)
menu->exec(globalPos); menu->exec(globalPos);
}); });
connect(btn_apply, &QPushButton::clicked, [=](int action) { connect(btn_apply, &QPushButton::clicked, [=](bool /*checked*/)
int row = tbl_cheats->currentRow(); {
const int row = tbl_cheats->currentRow();
cheat_info* cheat = g_cheat.get(tbl_cheats->item(row, 0)->text().toStdString(), tbl_cheats->item(row, 3)->data(Qt::UserRole).toUInt()); cheat_info* cheat = g_cheat.get(tbl_cheats->item(row, 0)->text().toStdString(), tbl_cheats->item(row, 3)->data(Qt::UserRole).toUInt());
if (!cheat) if (!cheat)
@ -746,14 +758,16 @@ cheat_manager_dialog::cheat_manager_dialog(QWidget* parent)
}); });
// Search UI // Search UI
connect(btn_new_search, &QPushButton::clicked, [=](int action) { connect(btn_new_search, &QPushButton::clicked, [=](bool /*checked*/)
{
offsets_found.clear(); offsets_found.clear();
do_the_search(); do_the_search();
}); });
connect(btn_filter_results, &QPushButton::clicked, [=](int action) { do_the_search(); }); connect(btn_filter_results, &QPushButton::clicked, [=](bool /*checked*/) { do_the_search(); });
connect(lst_search, &QListWidget::customContextMenuRequested, [=](const QPoint& loc) { connect(lst_search, &QListWidget::customContextMenuRequested, [=](const QPoint& loc)
{
QPoint globalPos = lst_search->mapToGlobal(loc); QPoint globalPos = lst_search->mapToGlobal(loc);
QListWidgetItem* item = lst_search->item(lst_search->currentRow()); QListWidgetItem* item = lst_search->item(lst_search->currentRow());
if (!item) if (!item)
@ -763,11 +777,12 @@ cheat_manager_dialog::cheat_manager_dialog(QWidget* parent)
QAction* add_to_cheat_list = new QAction(tr("Add to cheat list"), menu); QAction* add_to_cheat_list = new QAction(tr("Add to cheat list"), menu);
u32 offset = offsets_found[lst_search->currentRow()]; const u32 offset = offsets_found[lst_search->currentRow()];
cheat_type type = static_cast<cheat_type>(cbx_cheat_search_type->currentIndex()); const cheat_type type = static_cast<cheat_type>(cbx_cheat_search_type->currentIndex());
std::string name = Emu.GetTitle(); const std::string name = Emu.GetTitle();
connect(add_to_cheat_list, &QAction::triggered, [=]() { connect(add_to_cheat_list, &QAction::triggered, [=]()
{
if (g_cheat.exist(name, offset)) if (g_cheat.exist(name, offset))
{ {
if (QMessageBox::question(this, tr("Cheat already exist"), tr("Do you want to overwrite the existing cheat?"), QMessageBox::Ok | QMessageBox::Cancel) != QMessageBox::Ok) if (QMessageBox::question(this, tr("Cheat already exist"), tr("Do you want to overwrite the existing cheat?"), QMessageBox::Ok | QMessageBox::Cancel) != QMessageBox::Ok)
@ -881,7 +896,6 @@ std::pair<bool, bool> cheat_manager_dialog::convert_and_set(u32 offset)
void cheat_manager_dialog::do_the_search() void cheat_manager_dialog::do_the_search()
{ {
bool res_conv = false; bool res_conv = false;
QString qstr_to_search = edt_cheat_search_value->text();
// TODO: better way to do this? // TODO: better way to do this?
switch (static_cast<cheat_type>(cbx_cheat_search_type->currentIndex())) switch (static_cast<cheat_type>(cbx_cheat_search_type->currentIndex()))
@ -913,11 +927,11 @@ void cheat_manager_dialog::do_the_search()
void cheat_manager_dialog::update_cheat_list() void cheat_manager_dialog::update_cheat_list()
{ {
u32 num_rows = 0; size_t num_rows = 0;
for (const auto& name : g_cheat.cheats) for (const auto& name : g_cheat.cheats)
num_rows += g_cheat.cheats[name.first].size(); num_rows += g_cheat.cheats[name.first].size();
tbl_cheats->setRowCount(num_rows); tbl_cheats->setRowCount(::narrow<int>(num_rows));
u32 row = 0; u32 row = 0;
{ {

View file

@ -27,8 +27,8 @@ struct cheat_info
{ {
std::string game; std::string game;
std::string description; std::string description;
cheat_type type; cheat_type type = cheat_type::max;
u32 offset; u32 offset{};
std::string red_script; std::string red_script;
bool from_str(const std::string& cheat_line); bool from_str(const std::string& cheat_line);

View file

@ -1,4 +1,4 @@
#include "stdafx.h" #include "stdafx.h"
#include "Emu/Memory/vm.h" #include "Emu/Memory/vm.h"
#include "Emu/System.h" #include "Emu/System.h"
@ -278,7 +278,7 @@ void kernel_explorer::Update()
lv2_types.emplace_back(l_addTreeChild(root, "SPU Threads")); lv2_types.emplace_back(l_addTreeChild(root, "SPU Threads"));
idm::select<named_thread<spu_thread>>([&](u32 id, spu_thread& spu) idm::select<named_thread<spu_thread>>([&](u32 /*id*/, spu_thread& spu)
{ {
lv2_types.back().count++; lv2_types.back().count++;
l_addTreeChild(lv2_types.back().node, qstr(fmt::format("SPU Thread: ID = 0x%08x '%s'", spu.lv2_id, spu.spu_name.get()))); l_addTreeChild(lv2_types.back().node, qstr(fmt::format("SPU Thread: ID = 0x%08x '%s'", spu.lv2_id, spu.spu_name.get())));

View file

@ -1,4 +1,4 @@

#include "rsx_debugger.h" #include "rsx_debugger.h"
#include "qt_utils.h" #include "qt_utils.h"
@ -369,18 +369,15 @@ void Buffer::ShowWindowed()
if (!render) if (!render)
return; return;
const auto buffers = render->display_buffers;
// TODO: Is there any better way to choose the color buffers // TODO: Is there any better way to choose the color buffers
#define SHOW_BUFFER(id) \ //if (0 <= m_id && m_id < 4)
{ \ //{
u32 addr = rsx::constants::local_mem_base + buffers[id].offset; \ // const auto buffers = render->display_buffers;
if (vm::check_addr(addr) && buffers[id].width && buffers[id].height) \ // u32 addr = rsx::constants::local_mem_base + buffers[m_id].offset;
memory_viewer_panel::ShowImage(this, addr, 3, buffers[id].width, buffers[id].height, true); \ // if (vm::check_addr(addr) && buffers[m_id].width && buffers[m_id].height)
return; \ // memory_viewer_panel::ShowImage(this, addr, 3, buffers[m_id].width, buffers[m_id].height, true);
} \ // return;
//}
//if (0 <= m_id && m_id < 4) SHOW_BUFFER(m_id);
gui::utils::show_windowed_image(m_image, title()); gui::utils::show_windowed_image(m_image, title());
@ -394,7 +391,6 @@ void Buffer::ShowWindowed()
render->textures[m_cur_texture].width(), render->textures[m_cur_texture].width(),
render->textures[m_cur_texture].height(), false);*/ render->textures[m_cur_texture].height(), false);*/
} }
#undef SHOW_BUFFER
return; return;
} }