From 51ed0324f6988b8c3e9a6a667223c3d987097c90 Mon Sep 17 00:00:00 2001 From: Phenom Date: Fri, 21 Jul 2017 13:13:48 +0200 Subject: [PATCH] Fix CppCheck ftfilecreator.cc /libretroshare/src/ft/ftfilecreator.cc:86: warning: Cppcheck(unusedVariable): Unused variable: it /libretroshare/src/ft/ftfilecreator.cc:545: warning: Cppcheck(unreadVariable): Variable 'chunks_for_this_peer' is modified but its new value is never used. --- libretroshare/src/ft/ftfilecreator.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libretroshare/src/ft/ftfilecreator.cc b/libretroshare/src/ft/ftfilecreator.cc index ec6d0099f..c47cc1c4c 100644 --- a/libretroshare/src/ft/ftfilecreator.cc +++ b/libretroshare/src/ft/ftfilecreator.cc @@ -83,7 +83,7 @@ bool ftFileCreator::getFileData(const RsPeerId& peer_id,uint64_t offset, uint32_ // try if we have data from an incomplete or not veryfied chunk if(!have_it && allow_unverified) { - std::map::iterator it; + //std::map::iterator it; have_it = true; // this map contains chunks which are currently being downloaded for(std::map::iterator it=mChunks.begin(); it!=mChunks.end(); ++it) @@ -542,6 +542,7 @@ bool ftFileCreator::getMissingChunk(const RsPeerId& peer_id,uint32_t size_hint,u mChunks[chunk.offset] = chunk ; offset = chunk.offset ; + // cppcheck-suppress unreadVariable size = chunk.size ; ++chunks_for_this_peer ; // increase number of chunks for this peer.