1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-23 03:02:53 +01:00

Remove about 100 warnings from rpcs3qt code.

This commit is contained in:
Robbie 2017-08-04 20:27:11 -05:00 committed by Ivan
parent 866b9524b3
commit fa7407cd42
19 changed files with 37 additions and 37 deletions

View File

@ -6,7 +6,7 @@
#include <QDesktopServices> #include <QDesktopServices>
#include <QUrl> #include <QUrl>
inline QString qstr(const std::string& _in) { return QString::fromUtf8(_in.data(), _in.size()); } inline QString qstr(const std::string& _in) { return QString::fromUtf8(_in.data(), static_cast<int>(_in.size())); }
about_dialog::about_dialog(QWidget* parent) : QDialog(parent), ui(new Ui::about_dialog) about_dialog::about_dialog(QWidget* parent) : QDialog(parent), ui(new Ui::about_dialog)
{ {

View File

@ -1,7 +1,7 @@
#include "auto_pause_settings_dialog.h" #include "auto_pause_settings_dialog.h"
inline QString qstr(const std::string& _in) { return QString::fromUtf8(_in.data(), _in.size()); } inline QString qstr(const std::string& _in) { return QString::fromUtf8(_in.data(), static_cast<int>(_in.size())); }
auto_pause_settings_dialog::auto_pause_settings_dialog(QWidget *parent) : QDialog(parent) auto_pause_settings_dialog::auto_pause_settings_dialog(QWidget *parent) : QDialog(parent)
{ {

View File

@ -16,10 +16,10 @@
#include "Emu/RSX/CgBinaryProgram.h" #include "Emu/RSX/CgBinaryProgram.h"
inline QString qstr(const std::string& _in) { return QString::fromUtf8(_in.data(), _in.size()); } inline QString qstr(const std::string& _in) { return QString::fromUtf8(_in.data(), static_cast<int>(_in.size())); }
inline std::string sstr(const QString& _in) { return _in.toUtf8().toStdString(); } inline std::string sstr(const QString& _in) { return _in.toUtf8().toStdString(); }
cg_disasm_window::cg_disasm_window(std::shared_ptr<gui_settings> xSettings, QWidget* parent): QWidget(), xgui_settings(xSettings) cg_disasm_window::cg_disasm_window(std::shared_ptr<gui_settings> xSettings, QWidget* parent): QWidget(parent), xgui_settings(xSettings)
{ {
setWindowTitle(tr("Cg Disasm")); setWindowTitle(tr("Cg Disasm"));
setAttribute(Qt::WA_DeleteOnClose); setAttribute(Qt::WA_DeleteOnClose);
@ -76,7 +76,7 @@ void cg_disasm_window::ShowContextMenu(const QPoint &pos)
ShowDisasm(); ShowDisasm();
}); });
myMenu.exec(QCursor::pos()); myMenu.exec(mapToGlobal(pos));
} }
void cg_disasm_window::ShowDisasm() void cg_disasm_window::ShowDisasm()

View File

@ -5,7 +5,7 @@
#include <QFontDatabase> #include <QFontDatabase>
#include <QCompleter> #include <QCompleter>
inline QString qstr(const std::string& _in) { return QString::fromUtf8(_in.data(), _in.size()); } inline QString qstr(const std::string& _in) { return QString::fromUtf8(_in.data(), static_cast<int>(_in.size())); }
extern bool user_asked_for_frame_capture; extern bool user_asked_for_frame_capture;
debugger_frame::debugger_frame(std::shared_ptr<gui_settings> settings, QWidget *parent) debugger_frame::debugger_frame(std::shared_ptr<gui_settings> settings, QWidget *parent)
@ -20,7 +20,6 @@ debugger_frame::debugger_frame(std::shared_ptr<gui_settings> settings, QWidget *
body = new QWidget(this); body = new QWidget(this);
mono = QFontDatabase::systemFont(QFontDatabase::FixedFont); mono = QFontDatabase::systemFont(QFontDatabase::FixedFont);
mono.setPointSize(pSize); mono.setPointSize(pSize);
QFontMetrics* fontMetrics = new QFontMetrics(mono);
QVBoxLayout* vbox_p_main = new QVBoxLayout(); QVBoxLayout* vbox_p_main = new QVBoxLayout();
QHBoxLayout* hbox_b_main = new QHBoxLayout(); QHBoxLayout* hbox_b_main = new QHBoxLayout();
@ -370,7 +369,6 @@ void debugger_frame::Show_Val()
if (cpu) if (cpu)
{ {
unsigned long pc = cpu ? GetPc() : 0x0; unsigned long pc = cpu ? GetPc() : 0x0;
bool ok;
addr->setText("Address: " + QString("%1").arg(pc, 8, 16, QChar('0'))); // set address input line to 8 digits addr->setText("Address: " + QString("%1").arg(pc, 8, 16, QChar('0'))); // set address input line to 8 digits
p_pc->setPlaceholderText(QString("%1").arg(pc, 8, 16, QChar('0'))); p_pc->setPlaceholderText(QString("%1").arg(pc, 8, 16, QChar('0')));
} }
@ -618,6 +616,8 @@ void debugger_list::wheelEvent(QWheelEvent* event)
void debugger_list::resizeEvent(QResizeEvent* event) void debugger_list::resizeEvent(QResizeEvent* event)
{ {
Q_UNUSED(event);
if (count() < 1 || visualItemRect(item(0)).height() < 1) if (count() < 1 || visualItemRect(item(0)).height() < 1)
{ {
return; return;

View File

@ -11,7 +11,7 @@
#include <QObject> #include <QObject>
#include <QComboBox> #include <QComboBox>
inline QString qstr(const std::string& _in) { return QString::fromUtf8(_in.data(), _in.size()); } inline QString qstr(const std::string& _in) { return QString::fromUtf8(_in.data(), static_cast<int>(_in.size())); }
struct Render_Creator struct Render_Creator
{ {

View File

@ -991,7 +991,7 @@ void game_list_frame::PopulateGameGrid(uint maxCols, const QSize& image_size, co
if (c != 0) if (c != 0)
{ // if left over games exist -- if empty entries exist { // if left over games exist -- if empty entries exist
for (int col = c; col < maxCols; ++col) for (uint col = c; col < maxCols; ++col)
{ {
QTableWidgetItem* emptyItem = new QTableWidgetItem(); QTableWidgetItem* emptyItem = new QTableWidgetItem();
emptyItem->setFlags(Qt::NoItemFlags); emptyItem->setFlags(Qt::NoItemFlags);

View File

@ -50,5 +50,7 @@ void game_list_grid_delegate::paint(QPainter * painter, const QStyleOptionViewIt
QSize game_list_grid_delegate::sizeHint(const QStyleOptionViewItem & option, const QModelIndex & index) const QSize game_list_grid_delegate::sizeHint(const QStyleOptionViewItem & option, const QModelIndex & index) const
{ {
Q_UNUSED(option);
Q_UNUSED(index);
return m_size; return m_size;
} }

View File

@ -8,7 +8,7 @@
#include <QTimer> #include <QTimer>
#include <QThread> #include <QThread>
inline QString qstr(const std::string& _in) { return QString::fromUtf8(_in.data(), _in.size()); } inline QString qstr(const std::string& _in) { return QString::fromUtf8(_in.data(), static_cast<int>(_in.size())); }
gs_frame::gs_frame(const QString& title, int w, int h, QIcon appIcon, bool disableMouse) gs_frame::gs_frame(const QString& title, int w, int h, QIcon appIcon, bool disableMouse)
: QWindow(), m_windowTitle(title), m_disable_mouse(disableMouse) : QWindow(), m_windowTitle(title), m_disable_mouse(disableMouse)

View File

@ -9,7 +9,7 @@
#include <QColor> #include <QColor>
#include <QBitmap> #include <QBitmap>
typedef struct GUI_SAVE struct GUI_SAVE
{ {
QString key; QString key;
QString name; QString name;

View File

@ -2,7 +2,7 @@
#include "instruction_editor_dialog.h" #include "instruction_editor_dialog.h"
#include <QFontDatabase> #include <QFontDatabase>
inline QString qstr(const std::string& _in) { return QString::fromUtf8(_in.data(), _in.size()); } inline QString qstr(const std::string& _in) { return QString::fromUtf8(_in.data(), static_cast<int>(_in.size())); }
instruction_editor_dialog::instruction_editor_dialog(QWidget *parent, u32 _pc, const std::shared_ptr<cpu_thread>& _cpu, CPUDisAsm* _disasm) instruction_editor_dialog::instruction_editor_dialog(QWidget *parent, u32 _pc, const std::shared_ptr<cpu_thread>& _cpu, CPUDisAsm* _disasm)
: QDialog(parent) : QDialog(parent)
@ -84,7 +84,8 @@ instruction_editor_dialog::instruction_editor_dialog(QWidget *parent, u32 _pc, c
void instruction_editor_dialog::updatePreview() void instruction_editor_dialog::updatePreview()
{ {
bool ok; bool ok;
ulong opcode = t2_instr->text().toULong(&ok, 16); //ulong opcode = t2_instr->text().toULong(&ok, 16);
if (ok) if (ok)
{ {
if (g_system == system_type::psv) if (g_system == system_type::psv)

View File

@ -60,7 +60,7 @@ kernel_explorer::kernel_explorer(QWidget* parent) : QDialog(parent)
Update(); Update();
}; };
inline QString qstr(const std::string& _in) { return QString::fromUtf8(_in.data(), _in.size()); } inline QString qstr(const std::string& _in) { return QString::fromUtf8(_in.data(), static_cast<int>(_in.size())); }
void kernel_explorer::Update() void kernel_explorer::Update()
{ {
@ -144,7 +144,7 @@ void kernel_explorer::Update()
{ {
case SYS_MEM_OBJECT: case SYS_MEM_OBJECT:
{ {
auto& mem = static_cast<lv2_memory&>(obj); // auto& mem = static_cast<lv2_memory&>(obj);
l_addTreeChild(node, qstr(fmt::format("Memory: ID = 0x%08x", id))); l_addTreeChild(node, qstr(fmt::format("Memory: ID = 0x%08x", id)));
break; break;
} }
@ -171,13 +171,13 @@ void kernel_explorer::Update()
} }
case SYS_INTR_TAG_OBJECT: case SYS_INTR_TAG_OBJECT:
{ {
auto& tag = static_cast<lv2_int_tag&>(obj); // auto& tag = static_cast<lv2_int_tag&>(obj);
l_addTreeChild(node, qstr(fmt::format("Intr Tag: ID = 0x%08x", id))); l_addTreeChild(node, qstr(fmt::format("Intr Tag: ID = 0x%08x", id)));
break; break;
} }
case SYS_INTR_SERVICE_HANDLE_OBJECT: case SYS_INTR_SERVICE_HANDLE_OBJECT:
{ {
auto& serv = static_cast<lv2_int_serv&>(obj); // auto& serv = static_cast<lv2_int_serv&>(obj);
l_addTreeChild(node, qstr(fmt::format("Intr Svc: ID = 0x%08x", id))); l_addTreeChild(node, qstr(fmt::format("Intr Svc: ID = 0x%08x", id)));
break; break;
} }
@ -223,7 +223,7 @@ void kernel_explorer::Update()
} }
case SYS_TIMER_OBJECT: case SYS_TIMER_OBJECT:
{ {
auto& timer = static_cast<lv2_timer&>(obj); // auto& timer = static_cast<lv2_timer&>(obj);
l_addTreeChild(node, qstr(fmt::format("Timer: ID = 0x%08x", id))); l_addTreeChild(node, qstr(fmt::format("Timer: ID = 0x%08x", id)));
break; break;
} }

View File

@ -8,7 +8,7 @@
#include <QActionGroup> #include <QActionGroup>
#include <QScrollBar> #include <QScrollBar>
inline QString qstr(const std::string& _in) { return QString::fromUtf8(_in.data(), _in.size()); } inline QString qstr(const std::string& _in) { return QString::fromUtf8(_in.data(), static_cast<int>(_in.size())); }
struct gui_listener : logs::listener struct gui_listener : logs::listener
{ {

View File

@ -615,7 +615,6 @@ void main_window::DecryptSPRXLibraries()
if (elf_file && elf_file.size() >= 4 && elf_file.read<u32>() == "SCE\0"_u32) if (elf_file && elf_file.size() >= 4 && elf_file.read<u32>() == "SCE\0"_u32)
{ {
const std::size_t prx_ext_pos = prx_path.find_last_of('.'); const std::size_t prx_ext_pos = prx_path.find_last_of('.');
const std::string& prx_ext = fmt::to_upper(prx_path.substr(prx_ext_pos != -1 ? prx_ext_pos : prx_path.size()));
const std::string& prx_name = prx_path.substr(prx_dir.size()); const std::string& prx_name = prx_path.substr(prx_dir.size());
elf_file = decrypt_self(std::move(elf_file)); elf_file = decrypt_self(std::move(elf_file));
@ -1203,8 +1202,6 @@ void main_window::CreateConnects()
}); });
connect (gameListFrame, &game_list_frame::RequestIconSizeActSet, [=](const int& idx) connect (gameListFrame, &game_list_frame::RequestIconSizeActSet, [=](const int& idx)
{ {
int index = GUI::gl_max_slider_pos / 4;
if (idx < GUI::get_Index((GUI::gl_icon_size_small + GUI::gl_icon_size_min) / 2)) ui->setIconSizeTinyAct->setChecked(true); if (idx < GUI::get_Index((GUI::gl_icon_size_small + GUI::gl_icon_size_min) / 2)) ui->setIconSizeTinyAct->setChecked(true);
else if (idx < GUI::get_Index((GUI::gl_icon_size_medium + GUI::gl_icon_size_small) / 2)) ui->setIconSizeSmallAct->setChecked(true); else if (idx < GUI::get_Index((GUI::gl_icon_size_medium + GUI::gl_icon_size_small) / 2)) ui->setIconSizeSmallAct->setChecked(true);
else if (idx < GUI::get_Index((GUI::gl_icon_size_max + GUI::gl_icon_size_medium) / 2)) ui->setIconSizeMediumAct->setChecked(true); else if (idx < GUI::get_Index((GUI::gl_icon_size_max + GUI::gl_icon_size_medium) / 2)) ui->setIconSizeMediumAct->setChecked(true);

View File

@ -3,7 +3,7 @@
#include "memory_viewer_panel.h" #include "memory_viewer_panel.h"
inline QString qstr(const std::string& _in) { return QString::fromUtf8(_in.data(), _in.size()); } inline QString qstr(const std::string& _in) { return QString::fromUtf8(_in.data(), static_cast<int>(_in.size())); }
memory_viewer_panel::memory_viewer_panel(QWidget* parent) memory_viewer_panel::memory_viewer_panel(QWidget* parent)
: QDialog(parent) : QDialog(parent)
@ -219,7 +219,6 @@ memory_viewer_panel::memory_viewer_panel(QWidget* parent)
connect(b_fprev, &QAbstractButton::clicked, [=]() { m_addr -= m_rowcount * m_colcount; ShowMemory(); }); connect(b_fprev, &QAbstractButton::clicked, [=]() { m_addr -= m_rowcount * m_colcount; ShowMemory(); });
connect(b_fnext, &QAbstractButton::clicked, [=]() { m_addr += m_rowcount * m_colcount; ShowMemory(); }); connect(b_fnext, &QAbstractButton::clicked, [=]() { m_addr += m_rowcount * m_colcount; ShowMemory(); });
connect(b_img, &QAbstractButton::clicked, [=]() { connect(b_img, &QAbstractButton::clicked, [=]() {
u32 addr = m_addr;
int mode = cbox_img_mode->currentIndex(); int mode = cbox_img_mode->currentIndex();
int sizex = sb_img_size_x->value(); int sizex = sb_img_size_x->value();
int sizey = sb_img_size_y->value(); int sizey = sb_img_size_y->value();
@ -301,7 +300,6 @@ void memory_viewer_panel::ShowMemory()
void memory_viewer_panel::ShowImage(QWidget* parent, u32 addr, int mode, u32 width, u32 height, bool flipv) void memory_viewer_panel::ShowImage(QWidget* parent, u32 addr, int mode, u32 width, u32 height, bool flipv)
{ {
QImage::Format format;
unsigned char* originalBuffer = (unsigned char*)vm::base(addr); unsigned char* originalBuffer = (unsigned char*)vm::base(addr);
unsigned char* convertedBuffer = (unsigned char*)malloc(width * height * 4); unsigned char* convertedBuffer = (unsigned char*)malloc(width * height * 4);
switch(mode) switch(mode)

View File

@ -1,7 +1,7 @@
#include "register_editor_dialog.h" #include "register_editor_dialog.h"
inline QString qstr(const std::string& _in) { return QString::fromUtf8(_in.data(), _in.size()); } inline QString qstr(const std::string& _in) { return QString::fromUtf8(_in.data(), static_cast<int>(_in.size())); }
inline std::string sstr(const QString& _in) { return _in.toUtf8().toStdString(); } inline std::string sstr(const QString& _in) { return _in.toUtf8().toStdString(); }
inline std::string sstr(const QVariant& _in) { return sstr(_in.toString()); } inline std::string sstr(const QVariant& _in) { return sstr(_in.toString()); }

View File

@ -7,14 +7,15 @@ enum GCMEnumTypes
CELL_GCM_PRIMITIVE_ENUM, CELL_GCM_PRIMITIVE_ENUM,
}; };
inline QString qstr(const std::string& _in) { return QString::fromUtf8(_in.data(), _in.size()); } inline QString qstr(const std::string& _in) { return QString::fromUtf8(_in.data(), static_cast<int>(_in.size())); }
rsx_debugger::rsx_debugger(QWidget* parent) rsx_debugger::rsx_debugger(QWidget* parent)
: QDialog(parent) : QDialog(parent)
, m_item_count(37) , m_item_count(37)
, m_addr(0x0) , m_addr(0x0)
, m_cur_texture(0) , m_cur_texture(0)
, exit(false) , exit(false)
, palette_bg()
{ {
setWindowTitle(tr("RSX Debugger")); setWindowTitle(tr("RSX Debugger"));
setAttribute(Qt::WA_DeleteOnClose); setAttribute(Qt::WA_DeleteOnClose);
@ -24,8 +25,8 @@ rsx_debugger::rsx_debugger(QWidget* parent)
mono = QFontDatabase::systemFont(QFontDatabase::FixedFont); mono = QFontDatabase::systemFont(QFontDatabase::FixedFont);
mono.setPointSize(pSize); mono.setPointSize(pSize);
fontMetrics = new QFontMetrics(mono); fontMetrics = new QFontMetrics(mono);
palette_bg = new QPalette();
palette_bg->setColor(backgroundRole(), QColor(240, 240, 240)); palette_bg.setColor(backgroundRole(), QColor(240, 240, 240));
QHBoxLayout* hbox_panel = new QHBoxLayout(); QHBoxLayout* hbox_panel = new QHBoxLayout();
//Tools //Tools
@ -377,9 +378,9 @@ namespace
if (img.isNull()) return; if (img.isNull()) return;
//QString title = qstr(fmt::format("Raw Image @ 0x%x", addr)); //QString title = qstr(fmt::format("Raw Image @ 0x%x", addr));
QLabel* canvas = new QLabel(); QLabel* canvas = new QLabel();
QPalette* pal_bg = new QPalette(); QPalette pal_bg;
pal_bg->setColor(canvas->backgroundRole(), QColor(240, 240, 240)); pal_bg.setColor(canvas->backgroundRole(), QColor(240, 240, 240));
canvas->setPalette(*pal_bg); //This fix the ugly background color under Windows canvas->setPalette(pal_bg); //This fix the ugly background color under Windows
canvas->setPixmap(QPixmap::fromImage(img)); canvas->setPixmap(QPixmap::fromImage(img));
canvas->setFixedSize(img.size()); canvas->setFixedSize(img.size());
canvas->show(); canvas->show();
@ -411,7 +412,7 @@ void Buffer::mouseDoubleClickEvent(QMouseEvent* event)
return; return;
} }
const auto buffers = render->display_buffers; 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) \ #define SHOW_BUFFER(id) \

View File

@ -60,7 +60,7 @@ class rsx_debugger : public QDialog
u32 pSize; u32 pSize;
QLineEdit* t_addr; QLineEdit* t_addr;
QPalette* palette_bg; QPalette palette_bg;
QFont mono; QFont mono;
QFontMetrics* fontMetrics; QFontMetrics* fontMetrics;

View File

@ -66,6 +66,7 @@ save_data_list_dialog::save_data_list_dialog(const std::vector<SaveDataEntry>& e
connect(m_list, &QTableWidget::currentCellChanged, this, [&](int cr, int cc, int pr, int pc) { connect(m_list, &QTableWidget::currentCellChanged, this, [&](int cr, int cc, int pr, int pc) {
m_selectedEntry = cr; m_selectedEntry = cr;
UpdateSelectionLabel(); UpdateSelectionLabel();
Q_UNUSED(cr); Q_UNUSED(pr); Q_UNUSED(pc);
}); });
// TODO: Unstub functions inside of this context menu so it makes sense to show this menu // TODO: Unstub functions inside of this context menu so it makes sense to show this menu

View File

@ -6,6 +6,6 @@
class table_item_delegate : public QItemDelegate class table_item_delegate : public QItemDelegate
{ {
public: public:
explicit table_item_delegate(QObject *parent = 0) {} explicit table_item_delegate(QObject *parent = 0) : QItemDelegate(parent) {}
virtual void drawFocus(QPainter * /*painter*/, const QStyleOptionViewItem & /*option*/, const QRect & /*rect*/) const {} virtual void drawFocus(QPainter * /*painter*/, const QStyleOptionViewItem & /*option*/, const QRect & /*rect*/) const {}
}; };