Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,7 @@ if test "x$enable_werror" = "xyes"; then
AX_CHECK_COMPILE_FLAG([-Werror=date-time],[ERROR_CXXFLAGS="$ERROR_CXXFLAGS -Werror=date-time"],,[[$CXXFLAG_WERROR]])
AX_CHECK_COMPILE_FLAG([-Werror=return-type],[ERROR_CXXFLAGS="$ERROR_CXXFLAGS -Werror=return-type"],,[[$CXXFLAG_WERROR]])
AX_CHECK_COMPILE_FLAG([-Werror=conditional-uninitialized],[ERROR_CXXFLAGS="$ERROR_CXXFLAGS -Werror=conditional-uninitialized"],,[[$CXXFLAG_WERROR]])
AX_CHECK_COMPILE_FLAG([-Werror=sign-compare],[ERROR_CXXFLAGS="$ERROR_CXXFLAGS -Werror=sign-compare"],,[[$CXXFLAG_WERROR]])
dnl -Wsuggest-override is broken with GCC before 9.2
dnl https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78010
AX_CHECK_COMPILE_FLAG([-Werror=suggest-override],[ERROR_CXXFLAGS="$ERROR_CXXFLAGS -Werror=suggest-override"],,[[$CXXFLAG_WERROR]],
Expand All @@ -423,6 +424,7 @@ if test "x$CXXFLAGS_overridden" = "xno"; then
AX_CHECK_COMPILE_FLAG([-Wunused-variable],[WARN_CXXFLAGS="$WARN_CXXFLAGS -Wunused-variable"],,[[$CXXFLAG_WERROR]])
AX_CHECK_COMPILE_FLAG([-Wdate-time],[WARN_CXXFLAGS="$WARN_CXXFLAGS -Wdate-time"],,[[$CXXFLAG_WERROR]])
AX_CHECK_COMPILE_FLAG([-Wconditional-uninitialized],[WARN_CXXFLAGS="$WARN_CXXFLAGS -Wconditional-uninitialized"],,[[$CXXFLAG_WERROR]])
AX_CHECK_COMPILE_FLAG([-Wsign-compare],[WARN_CXXFLAGS="$WARN_CXXFLAGS -Wsign-compare"],,[[$CXXFLAG_WERROR]])
AX_CHECK_COMPILE_FLAG([-Wsuggest-override],[WARN_CXXFLAGS="$WARN_CXXFLAGS -Wsuggest-override"],,[[$CXXFLAG_WERROR]],
[AC_LANG_SOURCE([[struct A { virtual void f(); }; struct B : A { void f() final; };]])])

Expand Down
4 changes: 2 additions & 2 deletions depends/packages/bls-dash.mk
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package=bls-dash
$(package)_version=1.1.0
$(package)_version=1.2.0
$(package)_download_path=https://github.com/dashpay/bls-signatures/archive
$(package)_download_file=$($(package)_version).tar.gz
$(package)_file_name=$(package)-$($(package)_download_file)
$(package)_build_subdir=build
$(package)_sha256_hash=276c8573104e5f18bb5b9fd3ffd49585dda5ba5f6de2de74759dda8ca5a9deac
$(package)_sha256_hash=94e49f3eaa29bc1f354cd569c00f4f4314d1c8ab4758527c248b67da9686135a
$(package)_dependencies=gmp cmake
$(package)_patches=gcc_alignment_cast.patch
$(package)_darwin_triplet=x86_64-apple-darwin19
Expand Down
4 changes: 2 additions & 2 deletions src/bls/bls_worker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,13 @@ void CBLSWorker::Stop()
workerPool.stop(true);
}

bool CBLSWorker::GenerateContributions(int quorumThreshold, const BLSIdVector& ids, BLSVerificationVectorPtr& vvecRet, BLSSecretKeyVector& skSharesRet)
bool CBLSWorker::GenerateContributions(uint32_t quorumThreshold, const BLSIdVector& ids, BLSVerificationVectorPtr& vvecRet, BLSSecretKeyVector& skSharesRet)
{
auto svec = BLSSecretKeyVector((size_t)quorumThreshold);
vvecRet = std::make_shared<BLSVerificationVector>((size_t)quorumThreshold);
skSharesRet.resize(ids.size());

for (int i = 0; i < quorumThreshold; i++) {
for (uint32_t i = 0; i < quorumThreshold; i++) {
svec[i].MakeNewKey();
}
size_t batchSize = 8;
Expand Down
2 changes: 1 addition & 1 deletion src/bls/bls_worker.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class CBLSWorker
void Start();
void Stop();

bool GenerateContributions(int threshold, const BLSIdVector& ids, BLSVerificationVectorPtr& vvecRet, BLSSecretKeyVector& skSharesRet);
bool GenerateContributions(uint32_t threshold, const BLSIdVector& ids, BLSVerificationVectorPtr& vvecRet, BLSSecretKeyVector& skSharesRet);

// The following functions are all used to aggregate verification (public key) vectors
// Inputs are in the following form:
Expand Down
6 changes: 3 additions & 3 deletions src/coinjoin/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1010,8 +1010,8 @@ CDeterministicMNCPtr CCoinJoinClientManager::GetRandomNotUsedMasternode()
{
auto mnList = deterministicMNManager->GetListAtChainTip();

size_t nCountEnabled = mnList.GetValidMNsCount();
size_t nCountNotExcluded = nCountEnabled - vecMasternodesUsed.size();
int nCountEnabled = mnList.GetValidMNsCount();
int nCountNotExcluded = nCountEnabled - vecMasternodesUsed.size();

LogPrint(BCLog::COINJOIN, "CCoinJoinClientManager::%s -- %d enabled masternodes, %d masternodes to choose from\n", __func__, nCountEnabled, nCountNotExcluded);
if (nCountNotExcluded < 1) {
Expand Down Expand Up @@ -1340,7 +1340,7 @@ bool CCoinJoinClientSession::PrepareDenominate(int nMinRounds, int nMaxRounds, s

// NOTE: No need to randomize order of inputs because they were
// initially shuffled in CWallet::SelectTxDSInsByDenomination already.
int nSteps{0};
uint64_t nSteps{0};
vecPSInOutPairsRet.clear();

// Try to add up to COINJOIN_ENTRY_MAX_SIZE of every needed denomination
Expand Down
2 changes: 1 addition & 1 deletion src/coinjoin/coinjoin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ bool CCoinJoinBroadcastTx::IsValidStructure() const
if (tx->vin.size() != tx->vout.size()) {
return false;
}
if (tx->vin.size() < CCoinJoin::GetMinPoolParticipants()) {
if (tx->vin.size() < static_cast<size_t>(CCoinJoin::GetMinPoolParticipants())) {
return false;
}
if (tx->vin.size() > CCoinJoin::GetMaxPoolParticipants() * COINJOIN_ENTRY_MAX_SIZE) {
Expand Down
2 changes: 1 addition & 1 deletion src/coinjoin/coinjoin.h
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ class CCoinJoinBaseSession
int GetState() const { return nState; }
std::string GetStateString() const;

int GetEntriesCount() const { LOCK(cs_coinjoin); return vecEntries.size(); }
size_t GetEntriesCount() const { LOCK(cs_coinjoin); return vecEntries.size(); }
};

// base class
Expand Down
10 changes: 5 additions & 5 deletions src/coinjoin/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ void CCoinJoinServer::CheckPool(CConnman& connman)
// Check for Time Out
// If we timed out while accepting entries, then if we have more than minimum, create final tx
if (nState == POOL_STATE_ACCEPTING_ENTRIES && CCoinJoinServer::HasTimedOut()
&& GetEntriesCount() >= CCoinJoin::GetMinPoolParticipants()) {
&& GetEntriesCount() >= static_cast<size_t>(CCoinJoin::GetMinPoolParticipants())) {
// Punish misbehaving participants
ChargeFees(connman);
// Try to complete this session ignoring the misbehaving ones
Expand All @@ -307,7 +307,7 @@ void CCoinJoinServer::CreateFinalTransaction(CConnman& connman)
CMutableTransaction txNew;

// make our new transaction
for (int i = 0; i < GetEntriesCount(); i++) {
for (size_t i = 0; i < GetEntriesCount(); i++) {
for (const auto& txout : vecEntries[i].vecTxOut) {
txNew.vout.push_back(txout);
}
Expand Down Expand Up @@ -432,10 +432,10 @@ void CCoinJoinServer::ChargeFees(CConnman& connman) const
if (vecOffendersCollaterals.empty()) return;

//mostly offending? Charge sometimes
if ((int)vecOffendersCollaterals.size() >= vecSessionCollaterals.size() - 1 && GetRandInt(100) > 33) return;
if (vecOffendersCollaterals.size() >= vecSessionCollaterals.size() - 1 && GetRandInt(100) > 33) return;

//everyone is an offender? That's not right
if ((int)vecOffendersCollaterals.size() >= vecSessionCollaterals.size()) return;
if (vecOffendersCollaterals.size() >= vecSessionCollaterals.size()) return;

//charge one of the offenders randomly
Shuffle(vecOffendersCollaterals.begin(), vecOffendersCollaterals.end(), FastRandomContext());
Expand Down Expand Up @@ -667,7 +667,7 @@ bool CCoinJoinServer::AddScriptSig(const CTxIn& txinNew)
LogPrint(BCLog::COINJOIN, "CCoinJoinServer::AddScriptSig -- adding to finalMutableTransaction, scriptSig=%s\n", ScriptToAsmStr(txinNew.scriptSig).substr(0, 24));
}
}
for (int i = 0; i < GetEntriesCount(); i++) {
for (size_t i = 0; i < GetEntriesCount(); i++) {
if (vecEntries[i].AddScriptSig(txinNew)) {
LogPrint(BCLog::COINJOIN, "CCoinJoinServer::AddScriptSig -- adding to entries, scriptSig=%s\n", ScriptToAsmStr(txinNew.scriptSig).substr(0, 24));
return true;
Expand Down
4 changes: 2 additions & 2 deletions src/evo/cbtx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,15 +215,15 @@ bool CalcCbTxMerkleRootQuorums(const CBlock& block, const CBlockIndex* pindexPre
auto qcHash = ::SerializeHash(qc.commitment);
const auto& llmq_params = llmq::GetLLMQParams(qc.commitment.llmqType);
auto& v = qcHashes[llmq_params.type];
if (v.size() == llmq_params.signingActiveQuorumCount) {
if (v.size() == static_cast<size_t>(llmq_params.signingActiveQuorumCount)) {
// we pop the last entry, which is actually the oldest quorum as GetMinedAndActiveCommitmentsUntilBlock
// returned quorums in reversed order. This pop and later push can only work ONCE, but we rely on the
// fact that a block can only contain a single commitment for one LLMQ type
v.pop_back();
}
v.emplace_back(qcHash);
hashCount++;
if (v.size() > llmq_params.signingActiveQuorumCount) {
if (v.size() > static_cast<size_t>(llmq_params.signingActiveQuorumCount)) {
return state.DoS(100, false, REJECT_INVALID, "excess-quorums-calc-cbtx-quorummerkleroot");
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/evo/deterministicmns.h
Original file line number Diff line number Diff line change
Expand Up @@ -370,9 +370,9 @@ class CDeterministicMNList
return mnMap.size();
}

size_t GetValidMNsCount() const
int GetValidMNsCount() const
{
size_t count = 0;
int count = 0;
for (const auto& p : mnMap) {
if (IsMNValid(p.second)) {
count++;
Expand Down
2 changes: 1 addition & 1 deletion src/governance/governance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -970,7 +970,7 @@ int CGovernanceManager::RequestGovernanceObjectVotes(const std::vector<CNode*>&
int nMaxObjRequestsPerNode = 1;
size_t nProjectedVotes = 2000;
if (Params().NetworkIDString() != CBaseChainParams::MAIN) {
nMaxObjRequestsPerNode = std::max(1, int(nProjectedVotes / std::max(1, (int)deterministicMNManager->GetListAtChainTip().GetValidMNsCount())));
nMaxObjRequestsPerNode = std::max(1, int(nProjectedVotes / std::max(1, deterministicMNManager->GetListAtChainTip().GetValidMNsCount())));
}

{
Expand Down
2 changes: 1 addition & 1 deletion src/governance/object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,7 @@ void CGovernanceObject::UpdateSentinelVariables()
{
// CALCULATE MINIMUM SUPPORT LEVELS REQUIRED

int nMnCount = (int)deterministicMNManager->GetListAtChainTip().GetValidMNsCount();
int nMnCount = deterministicMNManager->GetListAtChainTip().GetValidMNsCount();
if (nMnCount == 0) return;

// CALCULATE THE MINIMUM VOTE COUNT REQUIRED FOR FULL SIGNAL
Expand Down
2 changes: 1 addition & 1 deletion src/llmq/blockprocessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ std::vector<const CBlockIndex*> CQuorumBlockProcessor::GetMinedCommitmentsUntilB
}

uint32_t nMinedHeight = std::numeric_limits<uint32_t>::max() - be32toh(std::get<2>(curKey));
if (nMinedHeight > pindex->nHeight) {
if (nMinedHeight > static_cast<uint32_t>(pindex->nHeight)) {
break;
}

Expand Down
8 changes: 4 additions & 4 deletions src/llmq/commitment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ bool CFinalCommitment::Verify(const CBlockIndex* pQuorumBaseBlockIndex, bool che
}

auto members = CLLMQUtils::GetAllQuorumMembers(llmq_params, pQuorumBaseBlockIndex);
for (size_t i = members.size(); i < llmq_params.size; i++) {
for (size_t i = members.size(); i < static_cast<size_t>(llmq_params.size); i++) {
if (validMembers[i]) {
LogPrintfFinalCommitment("invalid validMembers bitset. bit %d should not be set\n", i);
return false;
Expand Down Expand Up @@ -122,11 +122,11 @@ bool CFinalCommitment::VerifyNull() const

bool CFinalCommitment::VerifySizes(const Consensus::LLMQParams& params) const
{
if (signers.size() != params.size) {
if (signers.size() != static_cast<size_t>(params.size)) {
LogPrintfFinalCommitment("invalid signers.size=%d\n", signers.size());
return false;
}
if (validMembers.size() != params.size) {
if (validMembers.size() != static_cast<size_t>(params.size)) {
LogPrintfFinalCommitment("invalid signers.size=%d\n", signers.size());
return false;
}
Expand All @@ -144,7 +144,7 @@ bool CheckLLMQCommitment(const CTransaction& tx, const CBlockIndex* pindexPrev,
return state.DoS(100, false, REJECT_INVALID, "bad-qc-version");
}

if (qcTx.nHeight != pindexPrev->nHeight + 1) {
if (qcTx.nHeight != static_cast<uint32_t>(pindexPrev->nHeight + 1)) {
return state.DoS(100, false, REJECT_INVALID, "bad-qc-height");
}

Expand Down
10 changes: 5 additions & 5 deletions src/llmq/dkgsession.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ bool CDKGSession::Init(const CBlockIndex* _pQuorumBaseBlockIndex, const std::vec

CDKGLogger logger(*this, __func__);

if (mns.size() < params.minSize) {
if (mns.size() < static_cast<size_t>(params.minSize)) {
logger.Batch("not enough members (%d < %d), aborting init", mns.size(), params.minSize);
return false;
}
Expand Down Expand Up @@ -235,7 +235,7 @@ bool CDKGSession::PreVerifyMessage(const CDKGContribution& qc, bool& retBan) con
retBan = true;
return false;
}
if (qc.vvec->size() != params.threshold) {
if (qc.vvec->size() != static_cast<size_t>(params.threshold)) {
logger.Batch("invalid verification vector length");
retBan = true;
return false;
Expand Down Expand Up @@ -655,7 +655,7 @@ void CDKGSession::VerifyAndJustify(CDKGPendingMessages& pendingMessages)
if (m->bad) {
continue;
}
if (m->badMemberVotes.size() >= params.dkgBadVotesThreshold) {
if (m->badMemberVotes.size() >= static_cast<size_t>(params.dkgBadVotesThreshold)) {
logger.Batch("%s marked as bad as %d other members voted for this", m->dmn->proTxHash.ToString(), m->badMemberVotes.size());
MarkBadMember(m->idx);
continue;
Expand Down Expand Up @@ -1082,7 +1082,7 @@ bool CDKGSession::PreVerifyMessage(const CDKGPrematureCommitment& qc, bool& retB
return false;
}

for (size_t i = members.size(); i < params.size; i++) {
for (auto i = static_cast<int>(members.size()); i < params.size; i++) {
if (qc.validMembers[i]) {
retBan = true;
logger.Batch("invalid validMembers bitset. bit %d should not be set", i);
Expand Down Expand Up @@ -1221,7 +1221,7 @@ std::vector<CFinalCommitment> CDKGSession::FinalizeCommitments()
std::vector<CFinalCommitment> finalCommitments;
for (const auto& p : commitmentsMap) {
auto& cvec = p.second;
if (cvec.size() < params.minSize) {
if (cvec.size() < static_cast<size_t>(params.minSize)) {
// commitment was signed by a minority
continue;
}
Expand Down
4 changes: 2 additions & 2 deletions src/llmq/instantsend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ std::unordered_map<uint256, CInstantSendLockPtr, StaticSaltedHasher> CInstantSen
if (!it->GetKey(curKey) || std::get<0>(curKey) != DB_MINED_BY_HEIGHT_AND_HASH) {
break;
}
uint32_t nHeight = std::numeric_limits<uint32_t>::max() - be32toh(std::get<1>(curKey));
int32_t nHeight = std::numeric_limits<int32_t>::max() - be32toh(std::get<1>(curKey));
if (nHeight > nUntilHeight) {
break;
}
Expand Down Expand Up @@ -236,7 +236,7 @@ void CInstantSendDb::RemoveArchivedInstantSendLocks(int nUntilHeight)
if (!it->GetKey(curKey) || std::get<0>(curKey) != DB_ARCHIVED_BY_HEIGHT_AND_HASH) {
break;
}
uint32_t nHeight = std::numeric_limits<uint32_t>::max() - be32toh(std::get<1>(curKey));
int32_t nHeight = std::numeric_limits<int32_t>::max() - be32toh(std::get<1>(curKey));
if (nHeight > nUntilHeight) {
break;
}
Expand Down
2 changes: 1 addition & 1 deletion src/llmq/quorums.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,7 @@ void CQuorumManager::ProcessMessage(CNode* pFrom, const std::string& strCommand,
// Check if request has ENCRYPTED_CONTRIBUTIONS data
if (request.GetDataMask() & CQuorumDataRequest::ENCRYPTED_CONTRIBUTIONS) {

if (WITH_LOCK(pQuorum->cs, return pQuorum->quorumVvec->size() != pQuorum->params.threshold)) {
if (WITH_LOCK(pQuorum->cs, return pQuorum->quorumVvec->size() != static_cast<size_t>(pQuorum->params.threshold))) {
errorHandler("No valid quorum verification vector available", 0); // Don't bump score because we asked for it
return;
}
Expand Down
10 changes: 5 additions & 5 deletions src/llmq/signing_shares.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ bool CSigSharesManager::ProcessMessageSigSesAnn(const CNode* pfrom, const CSigSe

bool CSigSharesManager::VerifySigSharesInv(Consensus::LLMQType llmqType, const CSigSharesInv& inv)
{
return inv.inv.size() == GetLLMQParams(llmqType).size;
return inv.inv.size() == static_cast<size_t>(GetLLMQParams(llmqType).size);
}

bool CSigSharesManager::ProcessMessageSigSharesInv(const CNode* pfrom, const CSigSharesInv& inv)
Expand Down Expand Up @@ -748,7 +748,7 @@ void CSigSharesManager::ProcessSigShare(const CSigShare& sigShare, const CConnma
}

size_t sigShareCount = sigShares.CountForSignHash(sigShare.GetSignHash());
if (sigShareCount >= quorum->params.threshold) {
if (sigShareCount >= static_cast<size_t>(quorum->params.threshold)) {
canTryRecovery = true;
}
}
Expand Down Expand Up @@ -777,14 +777,14 @@ void CSigSharesManager::TryRecoverSig(const CQuorumCPtr& quorum, const uint256&

sigSharesForRecovery.reserve((size_t) quorum->params.threshold);
idsForRecovery.reserve((size_t) quorum->params.threshold);
for (auto it = sigSharesForSignHash->begin(); it != sigSharesForSignHash->end() && sigSharesForRecovery.size() < quorum->params.threshold; ++it) {
for (auto it = sigSharesForSignHash->begin(); it != sigSharesForSignHash->end() && sigSharesForRecovery.size() < static_cast<size_t>(quorum->params.threshold); ++it) {
auto& sigShare = it->second;
sigSharesForRecovery.emplace_back(sigShare.sigShare.Get());
idsForRecovery.emplace_back(quorum->members[sigShare.quorumMember]->proTxHash);
}

// check if we can recover the final signature
if (sigSharesForRecovery.size() < quorum->params.threshold) {
if (sigSharesForRecovery.size() < static_cast<size_t>(quorum->params.threshold)) {
return;
}
}
Expand Down Expand Up @@ -822,7 +822,7 @@ void CSigSharesManager::TryRecoverSig(const CQuorumCPtr& quorum, const uint256&

CDeterministicMNCPtr CSigSharesManager::SelectMemberForRecovery(const CQuorumCPtr& quorum, const uint256 &id, int attempt)
{
assert(attempt < quorum->members.size());
assert(static_cast<size_t>(attempt) < quorum->members.size());

std::vector<std::pair<uint256, CDeterministicMNCPtr>> v;
v.reserve(quorum->members.size());
Expand Down
2 changes: 1 addition & 1 deletion src/masternode/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ void CMasternodeUtils::ProcessMasternodeConnections(CConnman& connman)
#endif // ENABLE_WALLET

// Don't disconnect masternode connections when we have less then the desired amount of outbound nodes
int nonMasternodeCount = 0;
size_t nonMasternodeCount = 0;
connman.ForEachNode(CConnman::AllNodes, [&](CNode* pnode) {
if (!pnode->fInbound && !pnode->fFeeler && !pnode->m_manual_connection && !pnode->m_masternode_connection && !pnode->m_masternode_probe_connection) {
nonMasternodeCount++;
Expand Down
2 changes: 1 addition & 1 deletion src/prevector.h
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ class prevector {
// We know that internally the iterators are pointing to continues memory, so we can directly use the pointers here
// This avoids internal use of std::copy and operator++ on the iterators and instead allows efficient memcpy/memmove
if (std::is_trivially_constructible<T>::value) {
auto s = e - b;
size_t s = e - b;
if (v.size() != s) {
v.resize(s);
}
Expand Down
4 changes: 2 additions & 2 deletions src/qt/guiutil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1624,7 +1624,7 @@ std::vector<QFont::Weight> getSupportedWeights()
return mapSupportedWeights[fontFamily];
}

QFont::Weight supportedWeightFromIndex(int nIndex)
QFont::Weight supportedWeightFromIndex(size_t nIndex)
{
auto vecWeights = getSupportedWeights();
assert(vecWeights.size() > nIndex);
Expand All @@ -1634,7 +1634,7 @@ QFont::Weight supportedWeightFromIndex(int nIndex)
int supportedWeightToIndex(QFont::Weight weight)
{
auto vecWeights = getSupportedWeights();
for (int index = 0; index < vecWeights.size(); ++index) {
for (size_t index = 0; index < vecWeights.size(); ++index) {
if (weight == vecWeights[index]) {
return index;
}
Expand Down
2 changes: 1 addition & 1 deletion src/qt/guiutil.h
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ namespace GUIUtil
/** Return supported weights for the current font family */
std::vector<QFont::Weight> getSupportedWeights();
/** Convert an index to a weight in the supported weights vector */
QFont::Weight supportedWeightFromIndex(int nIndex);
QFont::Weight supportedWeightFromIndex(size_t nIndex);
/** Convert a weight to an index in the supported weights vector */
int supportedWeightToIndex(QFont::Weight weight);
/** Check if a weight is supported by the current font family */
Expand Down
Loading