From e7fa5556b045029f0f2e9cfa1cdfa56fc1e27616 Mon Sep 17 00:00:00 2001 From: Phenom Date: Thu, 14 Feb 2019 20:40:52 +0100 Subject: [PATCH 01/19] Fix warnings for a lot of destructor called on non-final 'xxx' that has virtual functions but non-virtual destructor [-Wdelete-non-virtual-dtor] In file included from /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/ 8.2.1/../../../../include/c++/8.2.1/algorithm:62: In file included from /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/ 8.2.1/../../../../include/c++/8.2.1/bits/stl_algo.h:62: In file included from /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/ 8.2.1/../../../../include/c++/8.2.1/bits/stl_tempbuf.h:60: /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/8.2.1/../../../../include/c++/ 8.2.1/bits/stl_construct.h:98:7: warning: destructor called on non-final 'xxx' that has virtual functions but non-virtual destructor [-Wdelete- non-virtual-dtor] { __pointer->~_Tp(); } ^ /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/8.2.1/../../../../include/c++/ 8.2.1/bits/stl_construct.h:108:11: note: in instantiation of function template specialization 'std::_Destroy' requested here std::_Destroy(std::__addressof(*__first)); ^ /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/8.2.1/../../../../include/c++/ 8.2.1/bits/stl_construct.h:137:2: note: in instantiation of function template specialization 'std::_Destroy_aux::__destroy' requested here __destroy(__first, __last); ^ /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/8.2.1/../../../../include/c++/ 8.2.1/bits/stl_construct.h:206:7: note: in instantiation of function template specialization 'std::_Destroy' requested here _Destroy(__first, __last); ^ /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/8.2.1/../../../../include/c++/ 8.2.1/bits/stl_vector.h:567:7: note: in instantiation of function template specialization 'std::_Destroy' requested here std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish, ^ ../../../trunk/libretroshare/src/retroshare/xxx:*:*: note: in instantiation of member function 'std::vector >::~vector' requested here Something(): ^ /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/8.2.1/../../../../include/c++/ 8.2.1/bits/stl_construct.h:98:19: note: qualify call to silence this warning { __pointer->~_Tp(); } ^ --- libretroshare/src/serialiser/rsserializable.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libretroshare/src/serialiser/rsserializable.h b/libretroshare/src/serialiser/rsserializable.h index 147cce20e..5e115e673 100644 --- a/libretroshare/src/serialiser/rsserializable.h +++ b/libretroshare/src/serialiser/rsserializable.h @@ -37,6 +37,8 @@ struct RsSerializable */ virtual void serial_process(RsGenericSerializer::SerializeJob j, RsGenericSerializer::SerializeContext& ctx) = 0; + + virtual ~RsSerializable() = default; }; /** @def RS_SERIAL_PROCESS(I) From 88068409898877e167156323426137c96938dbee Mon Sep 17 00:00:00 2001 From: Phenom Date: Thu, 14 Feb 2019 21:58:33 +0100 Subject: [PATCH 02/19] Fix Warnings for 'RsGxsChannels::createComment' and 'RsGxsChannels::createVote' hides overloaded virtual function In file included from temp/moc/moc_GxsChannelGroupItem.cpp:9: In file included from temp/moc/../../../../../trunk/retroshare-gui/src/ gui/feeds/GxsChannelGroupItem.h:24: ../../../trunk/libretroshare/src/retroshare/rsgxschannels.h:116:15: warning: 'RsGxsChannels::createComment' hides overloaded virtual function [-Woverloaded-virtual] virtual bool createComment(RsGxsComment& comment) = 0; ^ ../../../trunk/libretroshare/src/retroshare/rsgxscommon.h:172:15: note: hidden overloaded virtual function 'RsGxsCommentService::createComment' declared here: different number of parameters (2 vs 1) virtual bool createComment(uint32_t &token, RsGxsComment &comment) = 0; ^ In file included from temp/moc/moc_GxsChannelGroupItem.cpp:9: In file included from temp/moc/../../../../../trunk/retroshare-gui/src/ gui/feeds/GxsChannelGroupItem.h:24: ../../../trunk/libretroshare/src/retroshare/rsgxschannels.h:132:15: warning: 'RsGxsChannels::createVote' hides overloaded virtual function [-Woverloaded-virtual] virtual bool createVote(RsGxsVote& vote) = 0; ^ ../../../trunk/libretroshare/src/retroshare/rsgxscommon.h:173:15: note: hidden overloaded virtual function 'RsGxsCommentService::createVote' declared here: different number of parameters (2 vs 1) virtual bool createVote(uint32_t &token, RsGxsVote &vote) = 0; ^ In file included from temp/moc/moc_GxsChannelPostItem.cpp:9: In file included from temp/moc/../../../../../trunk/retroshare-gui/src/ gui/feeds/GxsChannelPostItem.h:26: ../../../trunk/libretroshare/src/retroshare/rsgxschannels.h:116:15: warning: 'RsGxsChannels::createComment' hides overloaded virtual function [-Woverloaded-virtual] virtual bool createComment(RsGxsComment& comment) = 0; ^ ../../../trunk/libretroshare/src/retroshare/rsgxscommon.h:172:15: note: hidden overloaded virtual function 'RsGxsCommentService::createComment' declared here: different number of parameters (2 vs 1) virtual bool createComment(uint32_t &token, RsGxsComment &comment) = 0; ^ In file included from temp/moc/moc_GxsChannelPostItem.cpp:9: In file included from temp/moc/../../../../../trunk/retroshare-gui/src/ gui/feeds/GxsChannelPostItem.h:26: ../../../trunk/libretroshare/src/retroshare/rsgxschannels.h:132:15: warning: 'RsGxsChannels::createVote' hides overloaded virtual function [-Woverloaded-virtual] virtual bool createVote(RsGxsVote& vote) = 0; ^ ../../../trunk/libretroshare/src/retroshare/rsgxscommon.h:173:15: note: hidden overloaded virtual function 'RsGxsCommentService::createVote' declared here: different number of parameters (2 vs 1) virtual bool createVote(uint32_t &token, RsGxsVote &vote) = 0; ^ --- libretroshare/src/retroshare/rsgxscommon.h | 4 ++-- libretroshare/src/retroshare/rsposted.h | 4 ++-- libretroshare/src/services/p3gxschannels.cc | 8 ++++---- libretroshare/src/services/p3gxschannels.h | 13 ++++++------- libretroshare/src/services/p3posted.h | 4 ++-- retroshare-gui/src/gui/Posted/PostedListWidget.cpp | 2 +- retroshare-gui/src/gui/gxs/GxsCommentTreeWidget.cpp | 2 +- .../src/gui/gxs/GxsCreateCommentDialog.cpp | 2 +- 8 files changed, 19 insertions(+), 20 deletions(-) diff --git a/libretroshare/src/retroshare/rsgxscommon.h b/libretroshare/src/retroshare/rsgxscommon.h index 77989d170..c8b8ec7a4 100644 --- a/libretroshare/src/retroshare/rsgxscommon.h +++ b/libretroshare/src/retroshare/rsgxscommon.h @@ -169,8 +169,8 @@ struct RsGxsCommentService virtual bool getRelatedComments( uint32_t token, std::vector &comments ) = 0; - virtual bool createComment(uint32_t &token, RsGxsComment &comment) = 0; - virtual bool createVote(uint32_t &token, RsGxsVote &vote) = 0; + virtual bool createNewComment(uint32_t &token, RsGxsComment &comment) = 0; + virtual bool createNewVote(uint32_t &token, RsGxsVote &vote) = 0; virtual bool acknowledgeComment( uint32_t token, diff --git a/libretroshare/src/retroshare/rsposted.h b/libretroshare/src/retroshare/rsposted.h index 60b510d55..55fc1639a 100644 --- a/libretroshare/src/retroshare/rsposted.h +++ b/libretroshare/src/retroshare/rsposted.h @@ -87,8 +87,8 @@ virtual bool getPostData(const uint32_t &token, std::vector &posts /* From RsGxsCommentService */ //virtual bool getCommentData(const uint32_t &token, std::vector &comments) = 0; //virtual bool getRelatedComments(const uint32_t &token, std::vector &comments) = 0; -//virtual bool createComment(uint32_t &token, RsGxsComment &comment) = 0; -//virtual bool createVote(uint32_t &token, RsGxsVote &vote) = 0; +//virtual bool createNewComment(uint32_t &token, RsGxsComment &comment) = 0; +//virtual bool createNewVote(uint32_t &token, RsGxsVote &vote) = 0; ////////////////////////////////////////////////////////////////////////////// virtual void setMessageReadStatus(uint32_t& token, const RsGxsGrpMsgIdPair& msgId, bool read) = 0; diff --git a/libretroshare/src/services/p3gxschannels.cc b/libretroshare/src/services/p3gxschannels.cc index 4289435b0..3f34b6438 100644 --- a/libretroshare/src/services/p3gxschannels.cc +++ b/libretroshare/src/services/p3gxschannels.cc @@ -1089,7 +1089,7 @@ bool p3GxsChannels::createChannel(RsGxsChannelGroup& channel) bool p3GxsChannels::createComment(RsGxsComment& comment) { uint32_t token; - if(!createComment(token, comment)) + if(!createNewComment(token, comment)) { std::cerr << __PRETTY_FUNCTION__ << "Error! Failed creating comment." << std::endl; @@ -1116,7 +1116,7 @@ bool p3GxsChannels::createComment(RsGxsComment& comment) bool p3GxsChannels::createVote(RsGxsVote& vote) { uint32_t token; - if(!createVote(token, vote)) + if(!createNewVote(token, vote)) { std::cerr << __PRETTY_FUNCTION__ << "Error! Failed creating vote." << std::endl; @@ -1795,7 +1795,7 @@ bool p3GxsChannels::generateComment(uint32_t &token, const RsGxsGroupId &grpId, } #endif - createComment(token, msg); + createNewComment(token, msg); return true; } @@ -1846,7 +1846,7 @@ bool p3GxsChannels::generateVote(uint32_t &token, const RsGxsGroupId &grpId, con vote.mVoteType = GXS_VOTE_DOWN; } - createVote(token, vote); + createNewVote(token, vote); return true; } diff --git a/libretroshare/src/services/p3gxschannels.h b/libretroshare/src/services/p3gxschannels.h index 27ab034f0..7ac63f8e7 100644 --- a/libretroshare/src/services/p3gxschannels.h +++ b/libretroshare/src/services/p3gxschannels.h @@ -132,30 +132,29 @@ virtual bool getChannelDownloadDirectory(const RsGxsGroupId &groupId, std::strin const RsGxsGroupId& grpId ) override; /* Comment service - Provide RsGxsCommentService - redirect to p3GxsCommentService */ - virtual bool getCommentData(uint32_t token, std::vector &msgs) + virtual bool getCommentData(uint32_t token, std::vector &msgs) override { return mCommentService->getGxsCommentData(token, msgs); } virtual bool getRelatedComments( uint32_t token, - std::vector &msgs ) + std::vector &msgs ) override { return mCommentService->getGxsRelatedComments(token, msgs); } -virtual bool createComment(uint32_t &token, RsGxsComment &msg) + virtual bool createNewComment(uint32_t &token, RsGxsComment &msg) override { return mCommentService->createGxsComment(token, msg); } -virtual bool createVote(uint32_t &token, RsGxsVote &msg) + virtual bool createNewVote(uint32_t &token, RsGxsVote &msg) override { return mCommentService->createGxsVote(token, msg); } -virtual bool acknowledgeComment(uint32_t token, std::pair& msgId) + virtual bool acknowledgeComment(uint32_t token, std::pair& msgId) override { return acknowledgeMsg(token, msgId); } - -virtual bool acknowledgeVote(uint32_t token, std::pair& msgId) + virtual bool acknowledgeVote(uint32_t token, std::pair& msgId) override { if (mCommentService->acknowledgeVote(token, msgId)) { diff --git a/libretroshare/src/services/p3posted.h b/libretroshare/src/services/p3posted.h index 4a032b49b..402f69298 100644 --- a/libretroshare/src/services/p3posted.h +++ b/libretroshare/src/services/p3posted.h @@ -89,12 +89,12 @@ virtual void setMessageReadStatus(uint32_t& token, const RsGxsGrpMsgIdPair& msgI std::vector &msgs ) { return mCommentService->getGxsRelatedComments(token, msgs); } -virtual bool createComment(uint32_t &token, RsGxsComment &msg) + virtual bool createNewComment(uint32_t &token, RsGxsComment &msg) { return mCommentService->createGxsComment(token, msg); } -virtual bool createVote(uint32_t &token, RsGxsVote &msg) + virtual bool createNewVote(uint32_t &token, RsGxsVote &msg) { return mCommentService->createGxsVote(token, msg); } diff --git a/retroshare-gui/src/gui/Posted/PostedListWidget.cpp b/retroshare-gui/src/gui/Posted/PostedListWidget.cpp index e51bc51b8..f6d230683 100644 --- a/retroshare-gui/src/gui/Posted/PostedListWidget.cpp +++ b/retroshare-gui/src/gui/Posted/PostedListWidget.cpp @@ -262,7 +262,7 @@ void PostedListWidget::submitVote(const RsGxsGrpMsgIdPair &msgId, bool up) std::cerr << "AuthorId : " << vote.mMeta.mAuthorId << std::endl; uint32_t token; - rsPosted->createVote(token, vote); + rsPosted->createNewVote(token, vote); mTokenQueue->queueRequest(token, TOKENREQ_MSGINFO, RS_TOKREQ_ANSTYPE_ACK, mTokenTypeVote); } diff --git a/retroshare-gui/src/gui/gxs/GxsCommentTreeWidget.cpp b/retroshare-gui/src/gui/gxs/GxsCommentTreeWidget.cpp index e5d714860..dc1734556 100644 --- a/retroshare-gui/src/gui/gxs/GxsCommentTreeWidget.cpp +++ b/retroshare-gui/src/gui/gxs/GxsCommentTreeWidget.cpp @@ -271,7 +271,7 @@ void GxsCommentTreeWidget::vote(const RsGxsGroupId &groupId, const RsGxsMessageI std::cerr << "AuthorId : " << vote.mMeta.mAuthorId << std::endl; uint32_t token; - mCommentService->createVote(token, vote); + mCommentService->createNewVote(token, vote); mTokenQueue->queueRequest(token, TOKENREQ_MSGINFO, RS_TOKREQ_ANSTYPE_ACK, COMMENT_VOTE_ACK); } diff --git a/retroshare-gui/src/gui/gxs/GxsCreateCommentDialog.cpp b/retroshare-gui/src/gui/gxs/GxsCreateCommentDialog.cpp index 0181845c1..5158d8981 100644 --- a/retroshare-gui/src/gui/gxs/GxsCreateCommentDialog.cpp +++ b/retroshare-gui/src/gui/gxs/GxsCreateCommentDialog.cpp @@ -105,7 +105,7 @@ void GxsCreateCommentDialog::createComment() }//switch (ui->idChooser->getChosenId(authorId)) uint32_t token; - mCommentService->createComment(token, comment); + mCommentService->createNewComment(token, comment); mTokenQueue->queueRequest(token, TOKENREQ_MSGINFO, RS_TOKREQ_ANSTYPE_ACK, 0); close(); } From 78e8758b9e9cf39486b91a82808d76673cc338c8 Mon Sep 17 00:00:00 2001 From: Phenom Date: Thu, 14 Feb 2019 22:15:53 +0100 Subject: [PATCH 03/19] Fix Warnings for 'p3PhotoService::msgsChanged' hides overloaded virtual function In file included from ../../../trunk/libretroshare/src/rsserver/ rsinit.cc:769: ../../../trunk/libretroshare/src/services/p3photoservice.h:59:10: warning: 'p3PhotoService::msgsChanged' hides overloaded virtual function [-Woverloaded-virtual] void msgsChanged(std::map