]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osdc: warning: comparison between signed and unsigned integer expressions 14729/head
authorJos Collin <jcollin@redhat.com>
Sat, 22 Apr 2017 08:19:20 +0000 (13:49 +0530)
committerJos Collin <jcollin@redhat.com>
Mon, 24 Apr 2017 03:35:28 +0000 (09:05 +0530)
The following warning appears during make. Fixed the review comments too.
[ 28%] Building CXX object src/mds/CMakeFiles/mds.dir/__/osdc/Journaler.cc.o
./src/osdc/Journaler.cc: In member function ‘void Journaler::_do_flush(unsigned int)’:
./src/osdc/Journaler.cc:643:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     if (newlen < len) {
         ~~~~~~~^~~~~

Signed-off-by: Jos Collin <jcollin@redhat.com>
src/osdc/Journaler.cc

index 642b15be43066ddacda6a8c8d9d6a3db42c5ba8d..7c1be262644b71b5b030c4ad131042caa7362781 100644 (file)
@@ -640,7 +640,7 @@ void Journaler::_do_flush(unsigned amount)
       waiting_for_zero = true;
       return;
     }
-    if (newlen < len) {
+    if (static_cast<uint64_t>(newlen) < len) {
       ldout(cct, 10) << "_do_flush wanted to do " << flush_pos << "~" << len
                     << " but hit prezero_pos " << prezero_pos
                     << ", will do " << flush_pos << "~" << newlen << dendl;