Misc: Warning fixes

This commit is contained in:
Stenzek 2024-01-08 20:45:05 +10:00 committed by Connor McLaughlin
parent 0a0994b19c
commit ef76666e5a
5 changed files with 7 additions and 9 deletions

View File

@ -59,10 +59,7 @@ public:
};
};
inline color_rgba()
{
static_assert(sizeof(*this) == 4, "sizeof(*this) != 4");
}
inline color_rgba() = default;
inline color_rgba(int y)
{
@ -190,6 +187,8 @@ public:
static color_rgba comp_max(const color_rgba& a, const color_rgba& b) { return color_rgba(std::max(a[0], b[0]), std::max(a[1], b[1]), std::max(a[2], b[2]), std::max(a[3], b[3])); }
};
static_assert(sizeof(color_rgba) == 4);
bool unpack_bc7(const void *pBlock, color_rgba *pPixels);
} // namespace bc7decomp

View File

@ -133,7 +133,7 @@ void SavedAddressesModel::addRow(SavedAddress addresstoSave)
bool SavedAddressesModel::removeRows(int row, int count, const QModelIndex& parent)
{
if (row + count > m_savedAddresses.size() || row < 0 || count < 1)
if (row < 0 || count < 1 || static_cast<size_t>(row + count) > m_savedAddresses.size())
return false;
beginRemoveRows(parent, row, row + count - 1);
m_savedAddresses.erase(m_savedAddresses.begin() + row, m_savedAddresses.begin() + row + count);

View File

@ -1407,7 +1407,7 @@ std::optional<bool> QtHost::DownloadFile(QWidget* parent, const QString& title,
progress.SetCancellable(true);
http->CreateRequest(
std::move(url), [parent, data, &download_result, &progress](s32 status_code, const std::string&, std::vector<u8> hdata) {
std::move(url), [parent, data, &download_result](s32 status_code, const std::string&, std::vector<u8> hdata) {
if (status_code == HTTPDownloader::HTTP_STATUS_CANCELLED)
return;

View File

@ -1093,12 +1093,11 @@ void recDIVhelper2(int regd, int regt) // Doesn't sets flags
ClampValues(regd);
}
alignas(16) static FPControlRegister roundmode_nearest, roundmode_neg;
alignas(16) static FPControlRegister roundmode_nearest;
void recDIV_S_xmm(int info)
{
EE::Profiler.EmitOp(eeOpcode::DIV_F);
bool roundmodeFlag = false;
int t0reg = _allocTempXMMreg(XMMT_FPS);
//Console.WriteLn("DIV");

View File

@ -652,7 +652,7 @@ void recDIVhelper2(int regd, int regt) // Doesn't sets flags
ToPS2FPU(regd, false, regt, false);
}
alignas(16) static FPControlRegister roundmode_nearest, roundmode_neg;
alignas(16) static FPControlRegister roundmode_nearest;
void recDIV_S_xmm(int info)
{