]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
messages: Initialization of members module messages 16846/head
authoramitkuma <amitkuma@redhat.com>
Sun, 6 Aug 2017 17:13:21 +0000 (22:43 +0530)
committeramitkuma <amitkuma@redhat.com>
Sun, 6 Aug 2017 17:13:21 +0000 (22:43 +0530)
Fixes coverity issues:

** 1054864 Uninitialized scalar field
2. uninit_member: Non-static class member op is not initialized
in this constructor nor in any functions that it calls.
CID 1054864 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
4. uninit_member: Non-static class member version is not initialized
in this constructor nor in any functions that it calls.

** 1054865 Uninitialized scalar field
2. uninit_member: Non-static class member map_epoch is not initialized
in this constructor nor in any functions that it calls.
CID 1054865 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
4. uninit_member: Non-static class member min_epoch is not initialized
in this constructor nor in any functions that it calls.

** 1054866 Uninitialized scalar field
2. uninit_member: Non-static class member map_epoch is not initialized
in this constructor nor in any functions that it calls.
CID 1054866 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
4. uninit_member: Non-static class member min_epoch is not initialized
in this constructor nor in any functions that it calls.

** 1054867 Uninitialized scalar field
2. uninit_member: Non-static class member map_epoch is not initialized
in this constructor nor in any functions that it calls.
CID 1054867 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
4. uninit_member: Non-static class member min_epoch is not initialized
in this constructor nor in any functions that it calls.

Signed-off-by: Amit Kumar amitkuma@redhat.com
src/messages/MMonScrub.h
src/messages/MOSDPGPull.h
src/messages/MOSDPGPush.h
src/messages/MOSDPGPushReply.h

index b66a34d7e1d55048918f94f2c8999825dec3d2a1..b7424ea07a56296b12980c3b19c72f494211b3fc 100644 (file)
@@ -35,8 +35,8 @@ public:
     }
   }
 
-  op_type_t op;
-  version_t version;
+  op_type_t op = OP_SCRUB;
+  version_t version = 0;
   ScrubResult result;
   int32_t num_keys;
   pair<string,string> key;
index 281b26f20db4d063f4901555a5337afe470ecd8f..6a42d22b9b115a23148bb3fc7fffe7ae5b97d794 100644 (file)
@@ -26,7 +26,7 @@ class MOSDPGPull : public MOSDFastDispatchOp {
 public:
   pg_shard_t from;
   spg_t pgid;
-  epoch_t map_epoch, min_epoch;
+  epoch_t map_epoch = 0, min_epoch = 0;
   uint64_t cost;
 
   epoch_t get_map_epoch() const override {
index 4f45048412cff464ac1da25df78fd44994e8a23d..cf62f82f91f7527ca83cea45361d75b00ac7fc6f 100644 (file)
@@ -24,7 +24,7 @@ class MOSDPGPush : public MOSDFastDispatchOp {
 public:
   pg_shard_t from;
   spg_t pgid;
-  epoch_t map_epoch, min_epoch;
+  epoch_t map_epoch = 0, min_epoch = 0;
   vector<PushOp> pushes;
 
 private:
index c60007c818721e533a78825f0793ae9973e68438..f1f060720e10f29ecc5a6a5d8d50f90b32e1ac88 100644 (file)
@@ -24,7 +24,7 @@ class MOSDPGPushReply : public MOSDFastDispatchOp {
 public:
   pg_shard_t from;
   spg_t pgid;
-  epoch_t map_epoch, min_epoch;
+  epoch_t map_epoch = 0, min_epoch = 0;
   vector<PushReplyOp> replies;
   uint64_t cost;