Fix -Wsign-compare warnings

This commit is contained in:
Léo Lam 2020-11-21 01:05:01 +01:00
parent 4b7f784d1b
commit 82f1e6204d
No known key found for this signature in database
GPG Key ID: 0DF30F9081000741
4 changed files with 8 additions and 5 deletions

View File

@ -99,7 +99,7 @@ u32 HashEctor(const u8* ptr, size_t length)
{
u32 crc = 0;
for (int i = 0; i < length; i++)
for (size_t i = 0; i < length; i++)
{
crc ^= ptr[i];
crc = (crc << 3) | (crc >> 29);

View File

@ -6,7 +6,7 @@
#include "Common/StringUtil.h"
UTF8CodePointCountValidator::UTF8CodePointCountValidator(int max_count, QObject* parent)
UTF8CodePointCountValidator::UTF8CodePointCountValidator(std::size_t max_count, QObject* parent)
: QValidator(parent), m_max_count(max_count)
{
}

View File

@ -4,6 +4,8 @@
#pragma once
#include <cstddef>
#include <QString>
#include <QValidator>
@ -11,9 +13,10 @@ class UTF8CodePointCountValidator : public QValidator
{
Q_OBJECT
public:
explicit UTF8CodePointCountValidator(int max_count, QObject* parent = nullptr);
explicit UTF8CodePointCountValidator(std::size_t max_count, QObject* parent = nullptr);
QValidator::State validate(QString& input, int& pos) const override;
int m_max_count;
private:
std::size_t m_max_count;
};

View File

@ -20,7 +20,7 @@ bool TASCheckBox::GetValue() const
if (checkState() == Qt::PartiallyChecked)
{
const u64 frames_elapsed = Movie::GetCurrentFrame() - m_frame_turbo_started;
return frames_elapsed % m_turbo_total_frames < m_turbo_press_frames;
return static_cast<int>(frames_elapsed % m_turbo_total_frames) < m_turbo_press_frames;
}
return isChecked();