From af91c0877bab5f872c97005c7da5d42d94742c6e Mon Sep 17 00:00:00 2001 From: CryptoManiac Date: Sun, 10 Apr 2016 03:57:22 +0300 Subject: [PATCH] Fix signed/unsigned comparison warnings --- src/main.cpp | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index b5dd38d..25766a4 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2947,7 +2947,7 @@ bool LoadExternalBlockFile(FILE* fileIn, CClientUIInterface& uiInterface) { auto nStart = GetTimeMillis(); vector pchData(10 * (8+MAX_BLOCK_SIZE)); - int nLoaded = 0; + int32_t nLoaded = 0; { LOCK(cs_main); try { @@ -2976,7 +2976,7 @@ bool LoadExternalBlockFile(FILE* fileIn, CClientUIInterface& uiInterface) }; if (nBlockLength > 0) { - if (nBlockLength > pchData.end() - it) + if (nBlockLength > distance(it, pchData.end())) { SeekToNext(); break; // We've reached the end of buffer @@ -2998,13 +2998,13 @@ bool LoadExternalBlockFile(FILE* fileIn, CClientUIInterface& uiInterface) } if (ProcessBlock(NULL, &block)) nLoaded++; - it += (8 + nBlockLength); + advance(it, 8 + nBlockLength); nPos += (8 + nBlockLength); { static int64_t nLastUpdate = 0; if (GetTimeMillis() - nLastUpdate > 1000) { - uiInterface.InitMessage(strprintf(_("%" PRId64 " blocks were read."), nLoaded)); + uiInterface.InitMessage(strprintf(_("%" PRId32 " blocks were read."), nLoaded)); nLastUpdate = GetTimeMillis(); } } -- 1.7.1