From: amitkuma Date: Sun, 6 Aug 2017 17:13:21 +0000 (+0530) Subject: messages: Initialization of members module messages X-Git-Tag: v13.0.0~208^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F16846%2Fhead;p=ceph.git messages: Initialization of members module messages 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 --- diff --git a/src/messages/MMonScrub.h b/src/messages/MMonScrub.h index b66a34d7e1d5..b7424ea07a56 100644 --- a/src/messages/MMonScrub.h +++ b/src/messages/MMonScrub.h @@ -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 key; diff --git a/src/messages/MOSDPGPull.h b/src/messages/MOSDPGPull.h index 281b26f20db4..6a42d22b9b11 100644 --- a/src/messages/MOSDPGPull.h +++ b/src/messages/MOSDPGPull.h @@ -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 { diff --git a/src/messages/MOSDPGPush.h b/src/messages/MOSDPGPush.h index 4f45048412cf..cf62f82f91f7 100644 --- a/src/messages/MOSDPGPush.h +++ b/src/messages/MOSDPGPush.h @@ -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 pushes; private: diff --git a/src/messages/MOSDPGPushReply.h b/src/messages/MOSDPGPushReply.h index c60007c81872..f1f060720e10 100644 --- a/src/messages/MOSDPGPushReply.h +++ b/src/messages/MOSDPGPushReply.h @@ -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 replies; uint64_t cost;