diff options
author | Jose <jose@zeroc.com> | 2019-06-21 22:22:14 +0200 |
---|---|---|
committer | Jose <jose@zeroc.com> | 2019-06-21 22:22:14 +0200 |
commit | d1b7c66fab777fe72e5cf77fd284218e2080b017 (patch) | |
tree | b48615b2d9d2f59195c8a560e07585b9cbb77cb5 /cpp/src/IcePatch2Lib/ClientUtil.cpp | |
parent | Add ice_isFixed - Close #356 (diff) | |
download | ice-d1b7c66fab777fe72e5cf77fd284218e2080b017.tar.bz2 ice-d1b7c66fab777fe72e5cf77fd284218e2080b017.tar.xz ice-d1b7c66fab777fe72e5cf77fd284218e2080b017.zip |
Enable -Wconversion with clang - Close #363
Diffstat (limited to 'cpp/src/IcePatch2Lib/ClientUtil.cpp')
-rw-r--r-- | cpp/src/IcePatch2Lib/ClientUtil.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/cpp/src/IcePatch2Lib/ClientUtil.cpp b/cpp/src/IcePatch2Lib/ClientUtil.cpp index 4e97d3a502e..134fd1c2888 100644 --- a/cpp/src/IcePatch2Lib/ClientUtil.cpp +++ b/cpp/src/IcePatch2Lib/ClientUtil.cpp @@ -341,15 +341,15 @@ PatcherI::prepare() AsyncResultPtr nxtCB; try { - for(int node0 = 0; node0 < 256; ++node0) + for(size_t node0 = 0; node0 < 256; ++node0) { if(tree0.nodes[node0].checksum != checksumSeq[node0]) { if(!curCB) { assert(!nxtCB); - curCB = _useSmallFileAPI ? _serverCompress->begin_getFileInfoSeq(node0) : - _serverCompress->begin_getLargeFileInfoSeq(node0); + curCB = _useSmallFileAPI ? _serverCompress->begin_getFileInfoSeq(static_cast<Int>(node0)) : + _serverCompress->begin_getLargeFileInfoSeq(static_cast<Int>(node0)); } else { @@ -357,7 +357,7 @@ PatcherI::prepare() swap(nxtCB, curCB); } - int node0Nxt = node0; + size_t node0Nxt = node0; do { @@ -367,8 +367,9 @@ PatcherI::prepare() if(node0Nxt < 256) { - nxtCB = _useSmallFileAPI ? _serverCompress->begin_getFileInfoSeq(node0Nxt) : - _serverCompress->begin_getLargeFileInfoSeq(node0Nxt); + nxtCB = _useSmallFileAPI ? + _serverCompress->begin_getFileInfoSeq(static_cast<Int>(node0Nxt)) : + _serverCompress->begin_getLargeFileInfoSeq(static_cast<Int>(node0Nxt)); } LargeFileInfoSeq files; @@ -434,7 +435,7 @@ PatcherI::prepare() FileInfoLess()); } - if(!_feedback->fileListProgress((node0 + 1) * 100 / 256)) + if(!_feedback->fileListProgress(static_cast<Int>(node0 + 1) * 100 / 256)) { return false; } @@ -859,7 +860,7 @@ PatcherI::updateFilesInternal(const LargeFileInfoSeq& files, const DecompressorP // 'bytes' is always returned with size '_chunkSize'. When a file is smaller than '_chunkSize' // or we are reading the last chunk of a file, 'bytes' will be larger than necessary. In this // case we calculate the current position and updated size based on the known file size. - size_t size = (pos + bytes.size()) > static_cast<size_t>(p->size) ? + size_t size = (static_cast<size_t>(pos) + bytes.size()) > static_cast<size_t>(p->size) ? static_cast<size_t>(p->size - pos) : bytes.size(); pos += size; |