]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
test/rbd: silence compiling warnings
authorKefu Chai <kchai@redhat.com>
Wed, 17 Aug 2016 07:17:35 +0000 (15:17 +0800)
committerKefu Chai <kchai@redhat.com>
Wed, 17 Aug 2016 10:52:23 +0000 (18:52 +0800)
silence warnings like:
```
src/test/librbd/fsx.cc:1589:21: comparison between signed and unsigned
integer expressions [-Wsign-compare]
(offset + size > monitorstart &&
^
```

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/test/librbd/fsx.cc

index 0651d2e61977b5d24b3ffc78c414d908bf891362..6fb5700c6213fb80738d3fe88a1916fc22f7fcc1 100644 (file)
@@ -1586,8 +1586,9 @@ doread(unsigned offset, unsigned size)
                ((progressinterval && testcalls % progressinterval == 0)  ||
                (debug &&
                       (monitorstart == -1 ||
-                       (offset + size > monitorstart &&
-                       (monitorend == -1 || offset <= monitorend))))))
+                       (static_cast<long>(offset + size) > monitorstart &&
+                        (monitorend == -1 ||
+                         static_cast<long>(offset) <= monitorend))))))
                prt("%lu read\t0x%x thru\t0x%x\t(0x%x bytes)\n", testcalls,
                    offset, offset + size - 1, size);
 
@@ -1686,8 +1687,9 @@ dowrite(unsigned offset, unsigned size)
                ((progressinterval && testcalls % progressinterval == 0) ||
                       (debug &&
                       (monitorstart == -1 ||
-                       (offset + size > monitorstart &&
-                        (monitorend == -1 || (long)offset <= monitorend))))))
+                       (static_cast<long>(offset + size) > monitorstart &&
+                        (monitorend == -1 ||
+                         static_cast<long>(offset) <= monitorend))))))
                prt("%lu write\t0x%x thru\t0x%x\t(0x%x bytes)\n", testcalls,
                    offset, offset + size - 1, size);