From 3b4a4b22921718253f244b62da2c7bc180ab3228 Mon Sep 17 00:00:00 2001 From: amitkuma Date: Sun, 6 Aug 2017 22:43:21 +0530 Subject: [PATCH] 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 --- src/messages/MMonScrub.h | 4 ++-- src/messages/MOSDPGPull.h | 2 +- src/messages/MOSDPGPush.h | 2 +- src/messages/MOSDPGPushReply.h | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/messages/MMonScrub.h b/src/messages/MMonScrub.h index b66a34d7e1d55..b7424ea07a562 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 281b26f20db4d..6a42d22b9b115 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 4f45048412cff..cf62f82f91f75 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 c60007c818721..f1f060720e10f 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; -- 2.39.5