]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: silence warning from -Wint-in-bool-context 16744/head
authorJos Collin <jcollin@redhat.com>
Wed, 2 Aug 2017 06:53:28 +0000 (12:23 +0530)
committerJos Collin <jcollin@redhat.com>
Wed, 2 Aug 2017 13:10:10 +0000 (18:40 +0530)
The following warning appears during build:
ceph/src/osd/PGLog.h: In member function ‘void PGLog::IndexedLog::index(pg_log_dup_t&)’:
ceph/src/osd/PGLog.h:29:43: warning: ‘<<’ in boolean context, did you mean ‘<’ ? [-Wint-in-bool-context]
 #define PGLOG_INDEXED_DUPS             (1 << 3)
                                        ~~~^~~~~
ceph/src/osd/PGLog.h:29:43: note: in definition of macro ‘PGLOG_INDEXED_DUPS’
 #define PGLOG_INDEXED_DUPS             (1 << 3)
                                           ^~
ceph/src/osd/PGLog.h: In member function ‘void PGLog::IndexedLog::unindex(const pg_log_dup_t&)’:
ceph/src/osd/PGLog.h:29:43: warning: ‘<<’ in boolean context, did you mean ‘<’ ? [-Wint-in-bool-context]
 #define PGLOG_INDEXED_DUPS             (1 << 3)
                                        ~~~^~~~~
ceph/src/osd/PGLog.h:29:43: note: in definition of macro ‘PGLOG_INDEXED_DUPS’
 #define PGLOG_INDEXED_DUPS             (1 << 3)
                                           ^~
Signed-off-by: Jos Collin <jcollin@redhat.com>
src/osd/PGLog.h

index 19405de25be67aac67edb054f9a7c6d9ecf94f2e..1c1d4e834c554bd9eb1744e63c8c403eef0a52f8 100644 (file)
@@ -476,13 +476,13 @@ public:
     }
 
     void index(pg_log_dup_t& e) {
-      if (PGLOG_INDEXED_DUPS) {
+      if (indexed_data & PGLOG_INDEXED_DUPS) {
        dup_index[e.reqid] = &e;
       }
     }
 
     void unindex(const pg_log_dup_t& e) {
-      if (PGLOG_INDEXED_DUPS) {
+      if (indexed_data & PGLOG_INDEXED_DUPS) {
        auto i = dup_index.find(e.reqid);
        if (i != dup_index.end()) {
          dup_index.erase(i);