From f82ec64d296602b593c6a56f3d6cc53427074362 Mon Sep 17 00:00:00 2001 From: Phenom Date: Fri, 28 Jul 2017 09:38:24 +0200 Subject: [PATCH] Fix CppCheck in rsrttitems.h /libretroshare/src/rsitems/rsrttitems.h:56: warning: Cppcheck(uninitMemberVar): Member variable 'RsRttPingItem::mSeqNo' is not initialized in the constructor. /libretroshare/src/rsitems/rsrttitems.h:56: warning: Cppcheck(uninitMemberVar): Member variable 'RsRttPingItem::mPingTS' is not initialized in the constructor. /libretroshare/src/rsitems/rsrttitems.h:70: warning: Cppcheck(uninitMemberVar): Member variable 'RsRttPongItem::mSeqNo' is not initialized in the constructor. /libretroshare/src/rsitems/rsrttitems.h:70: warning: Cppcheck(uninitMemberVar): Member variable 'RsRttPongItem::mPingTS' is not initialized in the constructor. /libretroshare/src/rsitems/rsrttitems.h:70: warning: Cppcheck(uninitMemberVar): Member variable 'RsRttPongItem::mPongTS' is not initialized in the constructor. /libretroshare/src/rsitems/rsrttitems.h:46: warning: Cppcheck(noExplicitConstructor): Class 'RsRttItem' has a constructor with 1 argument that is not explicit. --- libretroshare/src/rsitems/rsrttitems.h | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/libretroshare/src/rsitems/rsrttitems.h b/libretroshare/src/rsitems/rsrttitems.h index 35cf85bae..90b2e385e 100644 --- a/libretroshare/src/rsitems/rsrttitems.h +++ b/libretroshare/src/rsitems/rsrttitems.h @@ -43,17 +43,20 @@ const uint8_t RS_PKT_SUBTYPE_RTT_PONG = 0x02; class RsRttItem: public RsItem { public: - RsRttItem(uint8_t subtype) : RsItem(RS_PKT_VERSION_SERVICE,RS_SERVICE_TYPE_RTT,subtype) - { setPriorityLevel(QOS_PRIORITY_RS_RTT_PING) ;} // should be refined later. + explicit RsRttItem(uint8_t subtype) : RsItem(RS_PKT_VERSION_SERVICE,RS_SERVICE_TYPE_RTT,subtype) + { setPriorityLevel(QOS_PRIORITY_RS_RTT_PING) ;} // should be refined later. - virtual ~RsRttItem() {}; - virtual void clear() {}; + virtual ~RsRttItem() {} + virtual void clear() {} }; class RsRttPingItem: public RsRttItem { public: - RsRttPingItem() :RsRttItem(RS_PKT_SUBTYPE_RTT_PING) {} + RsRttPingItem() + : RsRttItem(RS_PKT_SUBTYPE_RTT_PING) + , mSeqNo(0), mPingTS(0) + {} virtual ~RsRttPingItem(){} virtual void clear(){} @@ -67,7 +70,10 @@ class RsRttPingItem: public RsRttItem class RsRttPongItem: public RsRttItem { public: - RsRttPongItem() :RsRttItem(RS_PKT_SUBTYPE_RTT_PONG) {} + RsRttPongItem() + : RsRttItem(RS_PKT_SUBTYPE_RTT_PONG) + , mSeqNo(0), mPingTS(0), mPongTS(0) + {} virtual ~RsRttPongItem(){} virtual void clear(){}