diff --git a/src/platform/qt/AssetTile.cpp b/src/platform/qt/AssetTile.cpp index cda468757..437ece086 100644 --- a/src/platform/qt/AssetTile.cpp +++ b/src/platform/qt/AssetTile.cpp @@ -130,8 +130,6 @@ void AssetTile::setFlip(bool h, bool v) { void AssetTile::selectColor(int index) { const color_t* data; mTileCache* tileCache = m_tileCaches[m_index >= m_boundary]; - unsigned bpp = 8 << tileCache->bpp; - int paletteId = m_paletteId; data = mTileCacheGetTile(tileCache, m_index >= m_boundary ? m_index - m_boundary : m_index, m_paletteId); color_t color = data[index]; m_ui.color->setColor(0, color); diff --git a/src/platform/qt/AssetView.cpp b/src/platform/qt/AssetView.cpp index 20dbd1641..04e9ad7c6 100644 --- a/src/platform/qt/AssetView.cpp +++ b/src/platform/qt/AssetView.cpp @@ -144,8 +144,8 @@ QImage AssetView::compositeObj(const ObjInfo& objInfo) { image.setColorTable(palette); uchar* bits = image.bits(); unsigned t = objInfo.tile; - for (int y = 0; y < objInfo.height; ++y) { - for (int x = 0; x < objInfo.width; ++x, ++t) { + for (unsigned y = 0; y < objInfo.height; ++y) { + for (unsigned x = 0; x < objInfo.width; ++x, ++t) { compositeTile(static_cast(mTileCacheGetVRAM(tileCache, t)), bits, objInfo.width * 8, x * 8, y * 8, objInfo.bits); } t += objInfo.stride - objInfo.width; @@ -183,7 +183,6 @@ bool AssetView::lookupObjGBA(int id, struct ObjInfo* info) { unsigned height = GBAVideoObjSizes[shape * 4 + size][1]; unsigned tile = GBAObjAttributesCGetTile(obj->c); unsigned palette = GBAObjAttributesCGetPalette(obj->c); - unsigned tileBase = tile; unsigned paletteSet; unsigned bits; if (GBAObjAttributesAIs256Color(obj->a)) { @@ -237,7 +236,6 @@ bool AssetView::lookupObjGB(int id, struct ObjInfo* info) { const GB* gb = static_cast(m_controller->thread()->core->board); const GBObj* obj = &gb->video.oam.obj[id]; - unsigned width = 8; unsigned height = 8; GBRegisterLCDC lcdc = gb->memory.io[REG_LCDC]; if (GBRegisterLCDCIsObjSize(lcdc)) { diff --git a/src/platform/qt/CheatsModel.cpp b/src/platform/qt/CheatsModel.cpp index 77e608ec8..a04b30b1f 100644 --- a/src/platform/qt/CheatsModel.cpp +++ b/src/platform/qt/CheatsModel.cpp @@ -42,11 +42,10 @@ QVariant CheatsModel::data(const QModelIndex& index, int role) const { } } - if (index.row() >= mCheatSetsSize(&m_device->cheats)) { + if ((size_t) index.row() >= mCheatSetsSize(&m_device->cheats)) { return QVariant(); } - int row = index.row(); const mCheatSet* cheats = *mCheatSetsGetPointer(&m_device->cheats, index.row()); switch (role) { case Qt::DisplayRole: @@ -60,11 +59,10 @@ QVariant CheatsModel::data(const QModelIndex& index, int role) const { } bool CheatsModel::setData(const QModelIndex& index, const QVariant& value, int role) { - if (!index.isValid() || index.parent().isValid() || index.row() > mCheatSetsSize(&m_device->cheats)) { + if (!index.isValid() || index.parent().isValid() || (size_t) index.row() > mCheatSetsSize(&m_device->cheats)) { return false; } - int row = index.row(); mCheatSet* cheats = *mCheatSetsGetPointer(&m_device->cheats, index.row()); switch (role) { case Qt::DisplayRole: @@ -119,7 +117,7 @@ Qt::ItemFlags CheatsModel::flags(const QModelIndex& index) const { return Qt::ItemIsUserCheckable | Qt::ItemIsEditable | Qt::ItemIsEnabled | Qt::ItemIsSelectable; } -int CheatsModel::columnCount(const QModelIndex& parent) const { +int CheatsModel::columnCount(const QModelIndex&) const { return 1; } @@ -141,14 +139,14 @@ mCheatSet* CheatsModel::itemAt(const QModelIndex& index) { if (index.parent().isValid()) { return static_cast(index.internalPointer()); } - if (index.row() >= mCheatSetsSize(&m_device->cheats)) { + if ((size_t) index.row() >= mCheatSetsSize(&m_device->cheats)) { return nullptr; } return *mCheatSetsGetPointer(&m_device->cheats, index.row()); } void CheatsModel::removeAt(const QModelIndex& index) { - if (!index.isValid() || index.parent().isValid() || index.row() >= mCheatSetsSize(&m_device->cheats)) { + if (!index.isValid() || index.parent().isValid() || (size_t) index.row() >= mCheatSetsSize(&m_device->cheats)) { return; } int row = index.row(); diff --git a/src/platform/qt/ColorPicker.cpp b/src/platform/qt/ColorPicker.cpp index 818a25fd4..22328b54a 100644 --- a/src/platform/qt/ColorPicker.cpp +++ b/src/platform/qt/ColorPicker.cpp @@ -46,7 +46,6 @@ bool ColorPicker::eventFilter(QObject* obj, QEvent* event) { if (event->type() != QEvent::MouseButtonRelease) { return false; } - int colorId; if (obj != m_parent) { return false; } diff --git a/src/platform/qt/Display.h b/src/platform/qt/Display.h index e739358c1..5e2d26f6d 100644 --- a/src/platform/qt/Display.h +++ b/src/platform/qt/Display.h @@ -51,7 +51,7 @@ public: virtual bool supportsShaders() const = 0; virtual VideoShader* shaders() = 0; virtual int framebufferHandle() { return -1; } - virtual void setVideoScale(int scale) {} + virtual void setVideoScale(int) {} virtual void setVideoProxy(std::shared_ptr proxy) { m_videoProxy = proxy; } std::shared_ptr videoProxy() { return m_videoProxy; } diff --git a/src/platform/qt/DisplayQt.cpp b/src/platform/qt/DisplayQt.cpp index 764bf88ca..c46ee18e6 100644 --- a/src/platform/qt/DisplayQt.cpp +++ b/src/platform/qt/DisplayQt.cpp @@ -96,6 +96,7 @@ void DisplayQt::paintEvent(QPaintEvent*) { if (isFiltered()) { painter.setRenderHint(QPainter::SmoothPixmapTransform); } + // TODO: Refactor this code out (since it's copied in like 3 places) QSize s = size(); QSize ds = s; if (isAspectRatioLocked()) { diff --git a/src/platform/qt/DisplayQt.h b/src/platform/qt/DisplayQt.h index 5795ccb45..e8623468f 100644 --- a/src/platform/qt/DisplayQt.h +++ b/src/platform/qt/DisplayQt.h @@ -42,8 +42,8 @@ protected: private: bool m_isDrawing = false; - unsigned m_width; - unsigned m_height; + int m_width; + int m_height; QImage m_backing{nullptr}; QImage m_oldBacking{nullptr}; std::shared_ptr m_context = nullptr; diff --git a/src/platform/qt/ShortcutController.h b/src/platform/qt/ShortcutController.h index 3a82f034d..eb24cdc96 100644 --- a/src/platform/qt/ShortcutController.h +++ b/src/platform/qt/ShortcutController.h @@ -30,7 +30,7 @@ public: Action* action() { return m_action; } const Action* action() const { return m_action; } - const int shortcut() const { return m_shortcut; } + int shortcut() const { return m_shortcut; } QString visibleName() const { return m_action ? m_action->visibleName() : QString(); } QString name() const { return m_action ? m_action->name() : QString(); } int button() const { return m_button; } diff --git a/src/platform/qt/ShortcutModel.cpp b/src/platform/qt/ShortcutModel.cpp index 331fa6c37..54fa83fcf 100644 --- a/src/platform/qt/ShortcutModel.cpp +++ b/src/platform/qt/ShortcutModel.cpp @@ -27,7 +27,6 @@ QVariant ShortcutModel::data(const QModelIndex& index, int role) const { if (role != Qt::DisplayRole || !index.isValid()) { return QVariant(); } - int row = index.row(); const Item* item = static_cast(index.internalPointer()); const Shortcut* shortcut = item->shortcut; switch (index.column()) { @@ -101,7 +100,7 @@ QModelIndex ShortcutModel::parent(const QModelIndex& index) const { return createIndex(m_controller->indexIn(parent), 0, pitem); } -int ShortcutModel::columnCount(const QModelIndex& index) const { +int ShortcutModel::columnCount(const QModelIndex&) const { return 3; } @@ -131,7 +130,7 @@ void ShortcutModel::addRowNamed(const QString& name) { endInsertRows(); } -void ShortcutModel::clearMenu(const QString& name) { +void ShortcutModel::clearMenu(const QString&) { // TODO beginResetModel(); endResetModel();