Fix CppCheck duplInheritedMember warning in RsItem

/libretroshare/src/rsitems/rsitem.h:92: warning:
Cppcheck(duplInheritedMember): The class 'RsPeerNetItem' defines member
variable with name 'peerId' also defined in its parent struct 'RsItem'.
/libretroshare/src/rsitems/rsitem.h:92: warning:
Cppcheck(duplInheritedMember): The class 'RsHistoryMsgItem' defines
member variable with name 'peerId' also defined in its parent struct
'RsItem'.
/libretroshare/src/rsitems/rsitem.h:91: warning:
Cppcheck(duplInheritedMember): The class 'RsBanListConfigItem' defines
member variable with name 'type' also defined in its parent struct
'RsItem'.
/libretroshare/src/rsitems/rsitem.h:92: warning:
Cppcheck(duplInheritedMember): The class 'RsBanListConfigItem' defines
member variable with name 'peerId' also defined in its parent struct
'RsItem'.
This commit is contained in:
Phenom 2018-05-07 17:29:11 +02:00
parent 38ac234862
commit f39fd069b5
10 changed files with 74 additions and 72 deletions

View file

@ -48,8 +48,8 @@ void RsBanListItem::serial_process(RsGenericSerializer::SerializeJob j,RsGeneric
void RsBanListConfigItem::serial_process(RsGenericSerializer::SerializeJob j,RsGenericSerializer::SerializeContext& ctx)
{
RsTypeSerializer::serial_process<uint32_t>(j,ctx,type,"type") ;
RsTypeSerializer::serial_process (j,ctx,peerId,"peerId") ;
RsTypeSerializer::serial_process<uint32_t>(j,ctx,banListType,"type") ;
RsTypeSerializer::serial_process (j,ctx,banListPeerId,"peerId") ;
RsTypeSerializer::serial_process<time_t> (j,ctx,update_time,"update_time") ;
RsTypeSerializer::serial_process (j,ctx,banned_peers,"banned_peers") ;
}

View file

@ -60,18 +60,20 @@ class RsBanListItem: public RsItem
class RsBanListConfigItem: public RsItem
{
public:
RsBanListConfigItem()
:RsItem(RS_PKT_VERSION_SERVICE, RS_SERVICE_TYPE_BANLIST, RS_PKT_SUBTYPE_BANLIST_CONFIG_ITEM) {}
RsBanListConfigItem()
: RsItem(RS_PKT_VERSION_SERVICE, RS_SERVICE_TYPE_BANLIST, RS_PKT_SUBTYPE_BANLIST_CONFIG_ITEM)
, banListType(0), update_time(0)
{}
virtual ~RsBanListConfigItem(){}
virtual void clear() { banned_peers.TlvClear() ; }
virtual ~RsBanListConfigItem(){}
virtual void clear() { banned_peers.TlvClear() ; }
void serial_process(RsGenericSerializer::SerializeJob j,RsGenericSerializer::SerializeContext& ctx);
uint32_t type ;
RsPeerId peerId ;
time_t update_time ;
RsTlvBanList banned_peers;
uint32_t banListType ;
RsPeerId banListPeerId ;
time_t update_time ;
RsTlvBanList banned_peers;
};
class RsBanListSerialiser: public RsServiceSerializer

View file

@ -137,9 +137,9 @@ RsItem *RsPeerConfigSerialiser::create_item(uint8_t item_type,uint8_t item_subty
void RsPeerNetItem::clear()
{
peerId.clear();
pgpId.clear();
location.clear();
nodePeerId.clear();
pgpId.clear();
location.clear();
netMode = 0;
vs_disc = 0;
vs_dht = 0;
@ -160,7 +160,7 @@ void RsPeerNetItem::clear()
}
void RsPeerNetItem::serial_process(RsGenericSerializer::SerializeJob j,RsGenericSerializer::SerializeContext& ctx)
{
RsTypeSerializer::serial_process(j,ctx,peerId,"peerId") ;
RsTypeSerializer::serial_process(j,ctx,nodePeerId,"peerId") ;
RsTypeSerializer::serial_process(j,ctx,pgpId,"pgpId") ;
RsTypeSerializer::serial_process(j,ctx,TLV_TYPE_STR_LOCATION,location,"location") ;

View file

@ -84,7 +84,7 @@ public:
virtual void serial_process(RsGenericSerializer::SerializeJob j,RsGenericSerializer::SerializeContext& ctx);
/* networking information */
RsPeerId peerId; /* Mandatory */
RsPeerId nodePeerId; /* Mandatory */
RsPgpId pgpId; /* Mandatory */
std::string location; /* Mandatory */
uint32_t netMode; /* Mandatory */

View file

@ -44,7 +44,7 @@ void RsHistoryMsgItem::serial_process(RsGenericSerializer::SerializeJob j,RsGene
RsTypeSerializer::serial_process<uint16_t>(j,ctx,version,"version") ;
RsTypeSerializer::serial_process (j,ctx,chatPeerId,"chatPeerId") ;
RsTypeSerializer::serial_process<bool> (j,ctx,incoming,"incoming") ;
RsTypeSerializer::serial_process (j,ctx,peerId,"peerId") ;
RsTypeSerializer::serial_process (j,ctx,msgPeerId,"peerId") ;
RsTypeSerializer::serial_process (j,ctx,TLV_TYPE_STR_NAME,peerName,"peerName") ;
RsTypeSerializer::serial_process<uint32_t>(j,ctx,sendTime,"sendTime") ;
RsTypeSerializer::serial_process<uint32_t>(j,ctx,recvTime,"recvTime") ;

View file

@ -46,7 +46,7 @@ public:
RsPeerId chatPeerId; // empty for global chat
bool incoming;
RsPeerId peerId;
RsPeerId msgPeerId;
std::string peerName;
uint32_t sendTime;
uint32_t recvTime;