From cbc264f5a3f9f90afdd83831691e63291244a69f Mon Sep 17 00:00:00 2001 From: Phenom Date: Wed, 15 Mar 2017 18:53:30 +0100 Subject: [PATCH 01/32] Fix clang warning:Implicit conversion from enumeration warning: implicit conversion from enumeration type 'ops_s2k_usage_t' to different enumeration type 'ops_symmetric_algorithm_t' [-Wenum- conversion] C.secret_key.algorithm=C.secret_key.s2k_usage; ~~~~~~~~~~~~~~^~~~~~~~~ --- openpgpsdk/src/openpgpsdk/packet-parse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openpgpsdk/src/openpgpsdk/packet-parse.c b/openpgpsdk/src/openpgpsdk/packet-parse.c index b80cf4ef8..a4596a55c 100644 --- a/openpgpsdk/src/openpgpsdk/packet-parse.c +++ b/openpgpsdk/src/openpgpsdk/packet-parse.c @@ -2394,7 +2394,7 @@ static int parse_secret_key(ops_region_t *region,ops_parse_info_t *pinfo) else if(C.secret_key.s2k_usage != OPS_S2KU_NONE) { // this is V3 style, looks just like a V4 simple hash - C.secret_key.algorithm=C.secret_key.s2k_usage; + C.secret_key.algorithm=(ops_symmetric_algorithm_t)C.secret_key.s2k_usage; C.secret_key.s2k_usage=OPS_S2KU_ENCRYPTED; C.secret_key.s2k_specifier=OPS_S2KS_SIMPLE; C.secret_key.hash_algorithm=OPS_HASH_MD5; From da4b168a04ddeb797e2db9f47cf9707da01aa63c Mon Sep 17 00:00:00 2001 From: Phenom Date: Wed, 15 Mar 2017 18:55:24 +0100 Subject: [PATCH 02/32] Fix Clang warnings: mFns is not used warning: private field 'mFns' is not used [-Wunused-private-field] bdDhtFunctions *mFns; ^ --- libbitdht/src/udp/udpbitdht.cc | 2 +- libbitdht/src/udp/udpbitdht.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libbitdht/src/udp/udpbitdht.cc b/libbitdht/src/udp/udpbitdht.cc index 5410d50e0..39c13e182 100644 --- a/libbitdht/src/udp/udpbitdht.cc +++ b/libbitdht/src/udp/udpbitdht.cc @@ -58,7 +58,7 @@ /*************************************/ UdpBitDht::UdpBitDht(UdpPublisher *pub, bdNodeId *id, std::string appVersion, std::string bootstrapfile, const std::string& filteredipfile, bdDhtFunctions *fns) - :UdpSubReceiver(pub), dhtMtx(true), mFns(fns) + :UdpSubReceiver(pub), dhtMtx(true)//, mFns(fns) { std::string usedVersion; diff --git a/libbitdht/src/udp/udpbitdht.h b/libbitdht/src/udp/udpbitdht.h index 36946877e..f1e167abf 100644 --- a/libbitdht/src/udp/udpbitdht.h +++ b/libbitdht/src/udp/udpbitdht.h @@ -119,7 +119,7 @@ void clearDataTransferred(); bdMutex dhtMtx; /* for all class data (below) */ bdNodeManager *mBitDhtManager; - bdDhtFunctions *mFns; + //bdDhtFunctions *mFns; uint32_t mReadBytes; From 105840ab982cb8442f111c49fcba0776abcfd249 Mon Sep 17 00:00:00 2001 From: Phenom Date: Wed, 15 Mar 2017 19:03:39 +0100 Subject: [PATCH 03/32] Fix Clang Warning: Overloaded vf hide warning: 'pqiConnectCbDummy::peerConnectRequest' hides overloaded virtual function [-Woverloaded-virtual] virtual void peerConnectRequest(const RsPeerId& id, ^ --- libretroshare/src/pqi/pqimonitor.cc | 12 +++++++++--- libretroshare/src/pqi/pqimonitor.h | 5 +++-- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/libretroshare/src/pqi/pqimonitor.cc b/libretroshare/src/pqi/pqimonitor.cc index 03894a66d..fac7a50f9 100644 --- a/libretroshare/src/pqi/pqimonitor.cc +++ b/libretroshare/src/pqi/pqimonitor.cc @@ -61,14 +61,20 @@ void pqiConnectCbDummy::peerStatus(const RsPeerId& id, const pqiIpAddrSet &ad std::cerr << out << std::endl; } -void pqiConnectCbDummy::peerConnectRequest(const RsPeerId& id, - const struct sockaddr_storage &raddr, uint32_t source) +void pqiConnectCbDummy::peerConnectRequest(const RsPeerId &id, const sockaddr_storage &raddr + , const sockaddr_storage &proxyaddr, const sockaddr_storage &srcaddr + , uint32_t source, uint32_t flags, uint32_t delay, uint32_t bandwidth) { std::cerr << "pqiConnectCbDummy::peerConnectRequest()"; std::cerr << " id: " << id; std::cerr << " raddr: " << sockaddr_storage_tostring(raddr); + std::cerr << " proxyaddr: " << sockaddr_storage_tostring(proxyaddr); + std::cerr << " srcaddr: " << sockaddr_storage_tostring(srcaddr); std::cerr << " source: " << source; - std::cerr << std::endl; + std::cerr << " flags: " << flags; + std::cerr << " delay: " << delay; + std::cerr << " bandwidth: " << bandwidth; + std::cerr << std::endl; } void pqiMonitor::disconnectPeer(const RsPeerId &/*peer*/) diff --git a/libretroshare/src/pqi/pqimonitor.h b/libretroshare/src/pqi/pqimonitor.h index 34d998e75..94e9bdf05 100644 --- a/libretroshare/src/pqi/pqimonitor.h +++ b/libretroshare/src/pqi/pqimonitor.h @@ -179,8 +179,9 @@ virtual ~pqiConnectCbDummy(); virtual void peerStatus(const RsPeerId& id, const pqiIpAddrSet &addrs, uint32_t type, uint32_t mode, uint32_t source); -virtual void peerConnectRequest(const RsPeerId& id, - const struct sockaddr_storage &raddr, uint32_t source); + virtual void peerConnectRequest(const RsPeerId& id, const struct sockaddr_storage &raddr, + const struct sockaddr_storage &proxyaddr, const struct sockaddr_storage &srcaddr, + uint32_t source, uint32_t flags, uint32_t delay, uint32_t bandwidth); //virtual void stunStatus(std::string id, const struct sockaddr_storage &raddr, uint32_t type, uint32_t flags); }; From cf963c0c7359697c9874df64e4b86ff3671ed54f Mon Sep 17 00:00:00 2001 From: Phenom Date: Wed, 15 Mar 2017 20:41:39 +0100 Subject: [PATCH 04/32] Fix Clang warnings: struct declared as class warning: 'RsMsgMetaData' defined as a struct here but previously declared as a class [-Wmismatched-tags] struct RsMsgMetaData ^ --- libretroshare/src/gxs/rsgxsdata.h | 24 +++++++++---------- .../src/retroshare/rsgxsifacetypes.h | 2 +- libretroshare/src/retroshare/rsgxsservice.h | 2 +- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/libretroshare/src/gxs/rsgxsdata.h b/libretroshare/src/gxs/rsgxsdata.h index 21fbe1445..2b2e9f14d 100644 --- a/libretroshare/src/gxs/rsgxsdata.h +++ b/libretroshare/src/gxs/rsgxsdata.h @@ -34,8 +34,8 @@ #include "serialiser/rstlvkeys.h" #include "serialiser/rsgxsitems.h" -class RsGroupMetaData; -class RsMsgMetaData; +struct RsGroupMetaData; +struct RsMsgMetaData; static const uint32_t RS_GXS_GRP_META_DATA_VERSION_ID_0001 = 0x0000 ; // change this, and keep old values if the content changes static const uint32_t RS_GXS_GRP_META_DATA_VERSION_ID_0002 = 0xaf01 ; // current API @@ -56,22 +56,22 @@ public: void clear(); void operator =(const RsGroupMetaData& rMeta); - //Sort data in same order than serialiser and deserializer + //Sort data in same order than serialiser and deserializer RsGxsGroupId mGroupId; RsGxsGroupId mOrigGrpId; - RsGxsGroupId mParentGrpId; + RsGxsGroupId mParentGrpId; std::string mGroupName; uint32_t mGroupFlags; // GXS_SERV::FLAG_PRIVACY_RESTRICTED | GXS_SERV::FLAG_PRIVACY_PRIVATE | GXS_SERV::FLAG_PRIVACY_PUBLIC uint32_t mPublishTs; - uint32_t mCircleType; - uint32_t mAuthenFlags; + uint32_t mCircleType; + uint32_t mAuthenFlags; RsGxsId mAuthorId; - std::string mServiceString; + std::string mServiceString; RsGxsCircleId mCircleId; RsTlvKeySignatureSet signSet; RsTlvSecurityKeySet keys; - uint32_t mSignFlags; + uint32_t mSignFlags; // BELOW HERE IS LOCAL DATA, THAT IS NOT FROM MSG. @@ -103,9 +103,9 @@ public: void clear(); void operator =(const RsMsgMetaData& rMeta); - static int refcount; - - //Sort data in same order than serialiser and deserializer + static int refcount; + + //Sort data in same order than serialiser and deserializer RsGxsGroupId mGroupId; RsGxsMessageId mMsgId; RsGxsMessageId mThreadId; @@ -121,7 +121,7 @@ public: // BELOW HERE IS LOCAL DATA, THAT IS NOT FROM MSG. // normally READ / UNREAD flags. LOCAL Data. - std::string mServiceString; + std::string mServiceString; uint32_t mMsgStatus; uint32_t mMsgSize; time_t mChildTs; diff --git a/libretroshare/src/retroshare/rsgxsifacetypes.h b/libretroshare/src/retroshare/rsgxsifacetypes.h index 6fd907898..1bc17b5e0 100644 --- a/libretroshare/src/retroshare/rsgxsifacetypes.h +++ b/libretroshare/src/retroshare/rsgxsifacetypes.h @@ -25,7 +25,7 @@ typedef std::pair RsGxsGrpMsgIdPair; typedef std::map > MsgRelatedIdResult; typedef std::map > GxsMsgReq; -class RsMsgMetaData; +struct RsMsgMetaData; typedef std::map > MsgMetaResult; diff --git a/libretroshare/src/retroshare/rsgxsservice.h b/libretroshare/src/retroshare/rsgxsservice.h index 8f26e5262..6afed31c6 100644 --- a/libretroshare/src/retroshare/rsgxsservice.h +++ b/libretroshare/src/retroshare/rsgxsservice.h @@ -5,7 +5,7 @@ #include "retroshare/rsgxsifacetypes.h" #include "retroshare/rstokenservice.h" -class RsMsgMetaData ; +struct RsMsgMetaData ; typedef std::map > GxsMsgMetaMap; typedef std::map > GxsMsgRelatedMetaMap; From 6fecac5f7beee4c66cd45f3c0f77c7e7fe8bca63 Mon Sep 17 00:00:00 2001 From: Phenom Date: Thu, 16 Mar 2017 17:50:25 +0100 Subject: [PATCH 05/32] Fix Clang warnings: Overloaded vf hide warning: 'pqiconnect::connect_parameter' hides overloaded virtual function [-Woverloaded-virtual] virtual bool connect_parameter(uint32_t type, std::string value) { return ni->connect_parameter(type, value);} ^ --- libretroshare/src/pqi/pqiperson.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libretroshare/src/pqi/pqiperson.h b/libretroshare/src/pqi/pqiperson.h index f3ff940e1..afd2213d5 100644 --- a/libretroshare/src/pqi/pqiperson.h +++ b/libretroshare/src/pqi/pqiperson.h @@ -29,6 +29,7 @@ #define MRK_PQI_PERSON_HEADER +#include #include "pqi/pqi.h" #include "util/rsnet.h" @@ -66,7 +67,7 @@ public: virtual int reset() { pqistreamer::reset(); return ni->reset(); } virtual int disconnect() { return reset() ; } virtual bool connect_parameter(uint32_t type, uint32_t value) { return ni->connect_parameter(type, value);} - virtual bool connect_parameter(uint32_t type, std::string value) { return ni->connect_parameter(type, value);} + virtual bool connect_parameter(uint32_t type, const std::string &value) { return ni->connect_parameter(type, value);} virtual bool connect_additional_address(uint32_t type, const struct sockaddr_storage &addr) { return ni->connect_additional_address(type, addr); } virtual int getConnectAddress(struct sockaddr_storage &raddr){ return ni->getConnectAddress(raddr); } From 5bc6558567fba0f9f5f30d64d0e72ace1187dd07 Mon Sep 17 00:00:00 2001 From: Phenom Date: Thu, 16 Mar 2017 18:28:48 +0100 Subject: [PATCH 06/32] Fix Clang warnings: explicitly assigning value to itself /home/phenom/GIT/RetroShare/trunk/libretroshare/src/util/radix64.h:96: warning: explicitly assigning value of variable of type 'int' to itself [-Wself-assign] idx = idx; ~~~ ^ ~~~ --- libretroshare/src/util/radix64.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libretroshare/src/util/radix64.h b/libretroshare/src/util/radix64.h index dc7f8528c..9ee80f2dd 100644 --- a/libretroshare/src/util/radix64.h +++ b/libretroshare/src/util/radix64.h @@ -93,9 +93,9 @@ again: idx = (idx + 1) % 4; } - idx = idx; + //idx = idx; - return buf; + return buf ; } /**************** From 65321501e48787930da7cde70b92496f1f2d084b Mon Sep 17 00:00:00 2001 From: Phenom Date: Thu, 16 Mar 2017 21:04:38 +0100 Subject: [PATCH 07/32] Fix Clang warnings: Overloaded vf hide in p3dhtmgr warning: 'p3DhtMgr::findPeer' hides overloaded virtual function [- Woverloaded-virtual] virtual bool findPeer(std::string id); warning: 'p3DhtMgr::dropPeer' hides overloaded virtual function [- Woverloaded-virtual] virtual bool dropPeer(std::string id); warning: 'p3DhtMgr::getPeerStatus' hides overloaded virtual function [- Woverloaded-virtual] virtual bool getPeerStatus(std::string id, --- libretroshare/src/pqi/p3dhtmgr.cc | 46 +++++++++++++++---------------- libretroshare/src/pqi/p3dhtmgr.h | 24 ++++++++-------- 2 files changed, 34 insertions(+), 36 deletions(-) diff --git a/libretroshare/src/pqi/p3dhtmgr.cc b/libretroshare/src/pqi/p3dhtmgr.cc index a93577581..c1d929c94 100644 --- a/libretroshare/src/pqi/p3dhtmgr.cc +++ b/libretroshare/src/pqi/p3dhtmgr.cc @@ -92,7 +92,7 @@ dhtPeerEntry::dhtPeerEntry() return; } -p3DhtMgr::p3DhtMgr(std::string id, pqiConnectCb *cb) +p3DhtMgr::p3DhtMgr(RsPeerId id, pqiConnectCb *cb) :pqiNetAssistConnect(id, cb), dhtMtx("p3DhtMgr"), mStunRequired(true) { /* setup own entry */ @@ -237,13 +237,13 @@ bool p3DhtMgr::setExternalInterface( /* add / remove peers */ -bool p3DhtMgr::findPeer(std::string id) +bool p3DhtMgr::findPeer(const RsPeerId& id) { RsStackMutex stack(dhtMtx); /***** LOCK MUTEX *****/ mDhtModifications = true; - std::map::iterator it; + std::map::iterator it; it = peers.find(id); if (it != peers.end()) { @@ -281,14 +281,14 @@ bool p3DhtMgr::findPeer(std::string id) return true; } -bool p3DhtMgr::dropPeer(std::string id) +bool p3DhtMgr::dropPeer(const RsPeerId& id) { RsStackMutex stack(dhtMtx); /***** LOCK MUTEX *****/ mDhtModifications = true; /* once we are connected ... don't worry about them anymore */ - std::map::iterator it; + std::map::iterator it; it = peers.find(id); if (it == peers.end()) { @@ -302,14 +302,14 @@ bool p3DhtMgr::dropPeer(std::string id) } /* post DHT key saying we should connect */ -bool p3DhtMgr::notifyPeer(std::string id) +bool p3DhtMgr::notifyPeer(const RsPeerId& id) { RsStackMutex stack(dhtMtx); /***** LOCK MUTEX *****/ #ifdef DHT_DEBUG - std::cerr << "p3DhtMgr::notifyPeer() " << id << std::endl; + std::cerr << "p3DhtMgr::notifyPeer() " << id.toStdString() << std::endl; #endif - std::map::iterator it; + std::map::iterator it; it = peers.find(id); if (it == peers.end()) { @@ -333,7 +333,7 @@ bool p3DhtMgr::notifyPeer(std::string id) #ifdef DHT_LOGS { /* Log */ - rslog(RSL_WARNING, p3dhtzone, "p3DhtMgr::notifyPeer() Id: " + id + " TO SOON - DROPPING"); + rslog(RSL_WARNING, p3dhtzone, "p3DhtMgr::notifyPeer() Id: " + id.toStdString() + " TO SOON - DROPPING"); } #endif @@ -352,7 +352,7 @@ bool p3DhtMgr::notifyPeer(std::string id) #ifdef DHT_LOGS { /* Log */ - rslog(RSL_WARNING, p3dhtzone, "p3DhtMgr::notifyPeer() Id: " + id + " PEER NOT FOUND - Trigger Search"); + rslog(RSL_WARNING, p3dhtzone, "p3DhtMgr::notifyPeer() Id: " + id.toStdString() + " PEER NOT FOUND - Trigger Search"); } #endif it->second.lastTS = 0; @@ -364,14 +364,14 @@ bool p3DhtMgr::notifyPeer(std::string id) } /* extract current peer status */ -bool p3DhtMgr::getPeerStatus(std::string id, - struct sockaddr_in &laddr, - struct sockaddr_in &raddr, +bool p3DhtMgr::getPeerStatus(const RsPeerId &id, + struct sockaddr_in &laddr, + struct sockaddr_in &raddr, uint32_t &type, uint32_t &state) { RsStackMutex stack(dhtMtx); /* LOCK MUTEX */ - std::map::iterator it; + std::map::iterator it; it = peers.find(id); /* ignore OFF peers */ @@ -776,7 +776,7 @@ int p3DhtMgr::checkPeerDHTKeys() dhtMtx.lock(); /* LOCK MUTEX */ /* iterate through and find min time and suitable candidate */ - std::map::iterator it,pit; + std::map::iterator it,pit; time_t now = time(NULL); uint32_t period = 0; uint32_t repeatPeriod = 6000; @@ -802,7 +802,7 @@ int p3DhtMgr::checkPeerDHTKeys() period = DHT_CHECK_PERIOD; } #ifdef DHT_DEBUG - std::cerr << "p3DhtMgr::checkPeerDHTKeys() Peer: " << it->second.id; + std::cerr << "p3DhtMgr::checkPeerDHTKeys() Peer: " << it->second.id.toStdString(); std::cerr << " Period: " << period; std::cerr << " Delta: " << delta; std::cerr << std::endl; @@ -865,7 +865,7 @@ int p3DhtMgr::checkNotifyDHT() RsStackMutex stack(dhtMtx); /***** LOCK MUTEX *****/ /* iterate through and find min time and suitable candidate */ - std::map::iterator it; + std::map::iterator it; time_t now = time(NULL); int repeatPeriod = DHT_DEFAULT_PERIOD; @@ -1015,7 +1015,7 @@ int p3DhtMgr::checkStunState() if (mDhtState == DHT_STATE_CHECK_PEERS) { /* check that they have all be searched for */ - std::map::iterator it; + std::map::iterator it; for(it = peers.begin(); it != peers.end(); it++) { if (it->second.state == DHT_PEER_INIT) @@ -1287,7 +1287,7 @@ int p3DhtMgr::status(std::ostream &out) out << "OWN DETAILS END----------------------------------------" << std::endl; /* now peers states */ - std::map::iterator it; + std::map::iterator it; out << "PEER DETAILS ------------------------------------------" << std::endl; for(it = peers.begin(); it != peers.end(); it++) { @@ -1622,15 +1622,13 @@ bool p3DhtMgr::dhtResultNotify(std::string idhash) std::cerr << "p3DhtMgr::dhtResultNotify() from idhash: "; std::cerr << RsUtil::BinToHex(idhash) << std::endl; #endif - std::map::iterator it; + std::map::iterator it; time_t now = time(NULL); /* if notify - we must match on the second hash */ for(it = peers.begin(); (it != peers.end()) && ((it->second).hash2 != idhash); it++) ; /* update data */ - std::string peerid; - /* ignore OFF peers */ if ((it != peers.end()) && (it->second.state != DHT_PEER_OFF)) { @@ -1677,7 +1675,7 @@ bool p3DhtMgr::dhtResultSearch(std::string idhash, std::cerr << "p3DhtMgr::dhtResultSearch() for idhash: "; std::cerr << RsUtil::BinToHex(idhash) << std::endl; #endif - std::map::iterator it; + std::map::iterator it; bool doCb = false; bool doStun = false; uint32_t stunFlags = 0; @@ -1780,7 +1778,7 @@ bool p3DhtMgr::dhtResultSearch(std::string idhash, void printDhtPeerEntry(dhtPeerEntry *ent, std::ostream &out) { - out << "DhtEntry: ID: " << ent->id; + out << "DhtEntry: ID: " << ent->id.toStdString(); out << " State: " << ent->state; out << " lastTS: " << ent->lastTS; out << " notifyPending: " << ent->notifyPending; diff --git a/libretroshare/src/pqi/p3dhtmgr.h b/libretroshare/src/pqi/p3dhtmgr.h index f08c2bc96..86d6b5424 100644 --- a/libretroshare/src/pqi/p3dhtmgr.h +++ b/libretroshare/src/pqi/p3dhtmgr.h @@ -78,7 +78,7 @@ class dhtPeerEntry public: dhtPeerEntry(); - std::string id; + RsPeerId id; uint32_t state; time_t lastTS; @@ -97,7 +97,7 @@ class p3DhtMgr: public pqiNetAssistConnect, public RsThread /* */ public: - p3DhtMgr(std::string id, pqiConnectCb *cb); + p3DhtMgr(RsPeerId id, pqiConnectCb *cb); /********** External DHT Interface ************************ * These Functions are the external interface @@ -121,15 +121,15 @@ virtual bool setExternalInterface(struct sockaddr_in laddr, struct sockaddr_in raddr, uint32_t type); /* add / remove peers */ -virtual bool findPeer(std::string id); -virtual bool dropPeer(std::string id); +virtual bool findPeer(const RsPeerId& id); +virtual bool dropPeer(const RsPeerId& id); /* post DHT key saying we should connect (callback when done) */ -virtual bool notifyPeer(std::string id); +virtual bool notifyPeer(const RsPeerId& id); /* extract current peer status */ -virtual bool getPeerStatus(std::string id, - struct sockaddr_in &laddr, struct sockaddr_in &raddr, +virtual bool getPeerStatus(const RsPeerId& id, + struct sockaddr_in &laddr, struct sockaddr_in &raddr, uint32_t &type, uint32_t &mode); /* stun */ @@ -154,17 +154,17 @@ virtual bool dhtResultBootstrap(std::string idhash); protected: /* can block briefly (called only from thread) */ -virtual bool dhtPublish(std::string id, +virtual bool dhtPublish(std::string idhash, struct sockaddr_in &laddr, struct sockaddr_in &raddr, uint32_t type, std::string sign); -virtual bool dhtNotify(std::string peerid, std::string ownId, +virtual bool dhtNotify(std::string idhash, std::string ownIdHash, std::string sign); -virtual bool dhtSearch(std::string id, uint32_t mode); +virtual bool dhtSearch(std::string idhash, uint32_t mode); -virtual bool dhtBootstrap(std::string storehash, std::string ownIdHash, +virtual bool dhtBootstrap(std::string idhash, std::string ownIdHash, std::string sign); /* to publish bootstrap */ @@ -232,7 +232,7 @@ std::string randomBootstrapId(); dhtPeerEntry ownEntry; time_t ownNotifyTS; - std::map peers; + std::map peers; std::list stunIds; bool mStunRequired; From dc533b1346ce1f7fa4f8137ee8133fc65cb285e9 Mon Sep 17 00:00:00 2001 From: Phenom Date: Thu, 16 Mar 2017 22:01:22 +0100 Subject: [PATCH 08/32] Fix Clang warnings: private field not used warning: private field 'lastGroupId' is not used [-Wunused-private- field] uint32_t lastGroupId; warning: private field 'waittimes' is not used [-Wunused-private-field] int waittimes; warning: private field 'listen_checktime' is not used [-Wunused-private- field] long listen_checktime; --- libretroshare/src/pqi/p3peermgr.h | 2 +- libretroshare/src/pqi/pqiperson.cc | 2 +- libretroshare/src/pqi/pqiperson.h | 2 +- libretroshare/src/pqi/pqissludp.cc | 2 +- libretroshare/src/pqi/pqissludp.h | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/libretroshare/src/pqi/p3peermgr.h b/libretroshare/src/pqi/p3peermgr.h index ee581b275..f0a9a44cb 100644 --- a/libretroshare/src/pqi/p3peermgr.h +++ b/libretroshare/src/pqi/p3peermgr.h @@ -397,7 +397,7 @@ private: std::map mReportedOwnAddresses ; std::map groupList; - uint32_t lastGroupId; + //uint32_t lastGroupId; std::list saveCleanupList; /* TEMPORARY LIST WHEN SAVING */ diff --git a/libretroshare/src/pqi/pqiperson.cc b/libretroshare/src/pqi/pqiperson.cc index cade0c39e..e7d1cf18b 100644 --- a/libretroshare/src/pqi/pqiperson.cc +++ b/libretroshare/src/pqi/pqiperson.cc @@ -40,7 +40,7 @@ static struct RsLog::logInfo pqipersonzoneInfo = {RsLog::Default, "pqiperson"}; pqiperson::pqiperson(const RsPeerId& id, pqipersongrp *pg) : PQInterface(id), mNotifyMtx("pqiperson-notify"), mPersonMtx("pqiperson"), - active(false), activepqi(NULL), inConnectAttempt(false), waittimes(0), + active(false), activepqi(NULL), inConnectAttempt(false),// waittimes(0), pqipg(pg) {} // TODO: must check id! pqiperson::~pqiperson() diff --git a/libretroshare/src/pqi/pqiperson.h b/libretroshare/src/pqi/pqiperson.h index afd2213d5..69faec48c 100644 --- a/libretroshare/src/pqi/pqiperson.h +++ b/libretroshare/src/pqi/pqiperson.h @@ -172,7 +172,7 @@ private: bool active; pqiconnect *activepqi; bool inConnectAttempt; - int waittimes; + //int waittimes; time_t lastHeartbeatReceived; // use to track connection failure pqipersongrp *pqipg; /* parent for callback */ }; diff --git a/libretroshare/src/pqi/pqissludp.cc b/libretroshare/src/pqi/pqissludp.cc index 9519e2af3..29bd228c9 100644 --- a/libretroshare/src/pqi/pqissludp.cc +++ b/libretroshare/src/pqi/pqissludp.cc @@ -53,7 +53,7 @@ static const uint32_t PQI_SSLUDP_DEF_CONN_PERIOD = 300; /* 5 minutes? */ /********** PQI SSL UDP STUFF **************************************/ pqissludp::pqissludp(PQInterface *parent, p3LinkMgr *lm) : - pqissl(NULL, parent, lm), tou_bio(NULL), listen_checktime(0), + pqissl(NULL, parent, lm), tou_bio(NULL),// listen_checktime(0), mConnectPeriod(PQI_SSLUDP_DEF_CONN_PERIOD), mConnectFlags(0), mConnectBandwidth(0) { diff --git a/libretroshare/src/pqi/pqissludp.h b/libretroshare/src/pqi/pqissludp.h index 848717bbd..195e9e604 100644 --- a/libretroshare/src/pqi/pqissludp.h +++ b/libretroshare/src/pqi/pqissludp.h @@ -95,7 +95,7 @@ private: BIO *tou_bio; // specific to ssludp. - long listen_checktime; + //long listen_checktime; uint32_t mConnectPeriod; uint32_t mConnectFlags; From 22043094b5d269a92db3816468b2312f98e7e374 Mon Sep 17 00:00:00 2001 From: Phenom Date: Thu, 16 Mar 2017 22:11:33 +0100 Subject: [PATCH 09/32] Fix Clang warnings: extraneous parentheses warning: equality comparison with extraneous parentheses [-Wparentheses- equality] else if ((err == ECONNREFUSED)) ~~~~^~~~~~~~~~~~~~~ --- libretroshare/src/pqi/pqissl.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libretroshare/src/pqi/pqissl.cc b/libretroshare/src/pqi/pqissl.cc index b7709bb82..bcc49cbbc 100644 --- a/libretroshare/src/pqi/pqissl.cc +++ b/libretroshare/src/pqi/pqissl.cc @@ -1009,7 +1009,7 @@ int pqissl::Basic_Connection_Complete() return -1; } - else if ((err == ECONNREFUSED)) + else if (err == ECONNREFUSED) { rslog(RSL_WARNING, pqisslzone, "pqissl::Basic_Connection_Complete() ECONNREFUSED: cert: " + PeerId().toStdString()); From 872f42bcefe4b6fc6c0b84d04b4484dff177b549 Mon Sep 17 00:00:00 2001 From: Phenom Date: Thu, 16 Mar 2017 22:55:18 +0100 Subject: [PATCH 10/32] Fix Clang warnings: Overloaded vf hide in pluginmanager warning: 'RsPluginManager::loadConfiguration' hides overloaded virtual function [-Woverloaded-virtual] virtual void loadConfiguration() ; --- libretroshare/src/plugins/pluginmanager.cc | 7 ++++++- libretroshare/src/plugins/pluginmanager.h | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/libretroshare/src/plugins/pluginmanager.cc b/libretroshare/src/plugins/pluginmanager.cc index 431b6c2f8..259004300 100644 --- a/libretroshare/src/plugins/pluginmanager.cc +++ b/libretroshare/src/plugins/pluginmanager.cc @@ -51,9 +51,14 @@ RsPluginManager::RsPluginManager(const RsFileHash &hash) _allow_all_plugins = false ; } +bool RsPluginManager::loadConfiguration(RsFileHash &loadHash) +{ + return p3Config::loadConfiguration(loadHash); +} + void RsPluginManager::loadConfiguration() { - RsFileHash dummyHash ; + RsFileHash dummyHash; p3Config::loadConfiguration(dummyHash); } diff --git a/libretroshare/src/plugins/pluginmanager.h b/libretroshare/src/plugins/pluginmanager.h index 5f2a8c3b7..27a74f870 100644 --- a/libretroshare/src/plugins/pluginmanager.h +++ b/libretroshare/src/plugins/pluginmanager.h @@ -74,6 +74,7 @@ class RsPluginManager: public RsPluginHandler, public p3Config // -------------------- Own members -------------------------// // virtual void addConfigurations(p3ConfigMgr *cfgMgr) ; + virtual bool loadConfiguration(RsFileHash &loadHash) ; virtual void loadConfiguration() ; /*! From 039908b2c634d1a8c9355b5bb2574de8812b83e2 Mon Sep 17 00:00:00 2001 From: Phenom Date: Thu, 16 Mar 2017 22:58:06 +0100 Subject: [PATCH 11/32] Fix Clang warnings: private field not used warning: private field 'mNetMgr' is not used [-Wunused-private-field] p3NetMgr *mNetMgr; --- libretroshare/src/services/p3banlist.cc | 4 ++-- libretroshare/src/services/p3banlist.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libretroshare/src/services/p3banlist.cc b/libretroshare/src/services/p3banlist.cc index 157cc23f8..65d56987b 100644 --- a/libretroshare/src/services/p3banlist.cc +++ b/libretroshare/src/services/p3banlist.cc @@ -66,8 +66,8 @@ */ RsBanList *rsBanList = NULL ; -p3BanList::p3BanList(p3ServiceControl *sc, p3NetMgr *nm) - :p3Service(), mBanMtx("p3BanList"), mServiceCtrl(sc), mNetMgr(nm) +p3BanList::p3BanList(p3ServiceControl *sc, p3NetMgr */*nm*/) + :p3Service(), mBanMtx("p3BanList"), mServiceCtrl(sc)//, mNetMgr(nm) { addSerialType(new RsBanListSerialiser()); diff --git a/libretroshare/src/services/p3banlist.h b/libretroshare/src/services/p3banlist.h index 87bb7104a..86456d6ae 100644 --- a/libretroshare/src/services/p3banlist.h +++ b/libretroshare/src/services/p3banlist.h @@ -148,7 +148,7 @@ private: std::map mWhiteListedRanges; p3ServiceControl *mServiceCtrl; - p3NetMgr *mNetMgr; + //p3NetMgr *mNetMgr; time_t mLastDhtInfoRequest ; bool mIPFilteringEnabled ; From e83104ee0fc520cc9115be3fa1bd335130cb5630 Mon Sep 17 00:00:00 2001 From: Phenom Date: Sat, 18 Mar 2017 10:19:31 +0100 Subject: [PATCH 12/32] Fix Clang warnings: Add author and date to #warning --- libretroshare/src/gxs/rsgxsnetservice.cc | 4 ++-- libretroshare/src/gxs/rsgxsnetutils.cc | 2 +- libretroshare/src/pqi/sslfns.cc | 2 +- libretroshare/src/services/p3gxsreputation.cc | 2 +- libretroshare/src/services/p3idservice.cc | 2 +- retroshare-gui/src/gui/Identity/IdDialog.cpp | 2 +- retroshare-gui/src/gui/RetroShareLink.h | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/libretroshare/src/gxs/rsgxsnetservice.cc b/libretroshare/src/gxs/rsgxsnetservice.cc index 259d01135..3811ddd0c 100644 --- a/libretroshare/src/gxs/rsgxsnetservice.cc +++ b/libretroshare/src/gxs/rsgxsnetservice.cc @@ -1972,7 +1972,7 @@ void RsGxsNetService::updateServerSyncTS() #endif // I keep the creation, but the data is not used yet. -#warning disabled this, but do we need it? +#warning csoler 2016-12-12: Disabled this, but do we need it? // RsGxsServerMsgUpdate& msui(mServerMsgUpdateMap[grpId]) ; // (cyril) I'm removing this, because the msgUpdateTS is updated when new messages are received by calling locked_stampMsgServerUpdateTS(). @@ -3000,7 +3000,7 @@ void RsGxsNetService::locked_genReqGrpTransaction(NxsTransaction* tr) } // FIXTESTS global variable rsReputations not available in unittests! -#warning Update the code below to correctly send/recv dependign on reputation +#warning csoler 2016-12-23: Update the code below to correctly send/recv dependign on reputation if(!grpSyncItem->authorId.isNull() && mReputations->overallReputationLevel(grpSyncItem->authorId) == RsReputations::REPUTATION_LOCALLY_NEGATIVE) { #ifdef NXS_NET_DEBUG_0 diff --git a/libretroshare/src/gxs/rsgxsnetutils.cc b/libretroshare/src/gxs/rsgxsnetutils.cc index 4d54ce117..7454ba58a 100644 --- a/libretroshare/src/gxs/rsgxsnetutils.cc +++ b/libretroshare/src/gxs/rsgxsnetutils.cc @@ -45,7 +45,7 @@ bool AuthorPending::getAuthorRep(GixsReputation& rep, const RsGxsId& authorId, c rep.id = authorId ; rep.reputation_level = mRep->overallReputationLevel(authorId); -#warning can it happen that reputations do not have the info yet? +#warning csoler 2017-01-10: Can it happen that reputations do not have the info yet? return true ; #ifdef TO_BE_REMOVED { diff --git a/libretroshare/src/pqi/sslfns.cc b/libretroshare/src/pqi/sslfns.cc index 7cf742956..ba5a9e6a3 100644 --- a/libretroshare/src/pqi/sslfns.cc +++ b/libretroshare/src/pqi/sslfns.cc @@ -627,7 +627,7 @@ bool getX509id(X509 *x509, RsPeerId& xid) * more randomness */ -#warning this is cryptographically horrible. We should do a hash of the public key here!!! +#warning csoler 2017-02-19: This is cryptographically horrible. We should do a hash of the public key here!!! xid = RsPeerId(&signdata[signlen - CERTSIGNLEN]) ; diff --git a/libretroshare/src/services/p3gxsreputation.cc b/libretroshare/src/services/p3gxsreputation.cc index 45fd95898..c60f54f0c 100644 --- a/libretroshare/src/services/p3gxsreputation.cc +++ b/libretroshare/src/services/p3gxsreputation.cc @@ -1035,7 +1035,7 @@ bool p3GxsReputation::setOwnOpinion(const RsGxsId& gxsid, const RsReputations::O if (rit == mReputations.end()) { -#warning we should set the owner node id here. +#warning csoler 2017-01-05: We should set the owner node id here. mReputations[gxsid] = Reputation(gxsid); rit = mReputations.find(gxsid); } diff --git a/libretroshare/src/services/p3idservice.cc b/libretroshare/src/services/p3idservice.cc index dcc45af65..78abe7d2b 100644 --- a/libretroshare/src/services/p3idservice.cc +++ b/libretroshare/src/services/p3idservice.cc @@ -788,7 +788,7 @@ bool p3IdService::createIdentity(uint32_t& token, RsIdentityParameters ¶ms) if (params.isPgpLinked) { -#warning Backward compatibility issue to fix here in v0.7.0 +#warning csoler 2017-02-07: Backward compatibility issue to fix here in v0.7.0 // This is a hack, because a bad decision led to having RSGXSID_GROUPFLAG_REALID be equal to GXS_SERV::FLAG_PRIVACY_PRIVATE. // In order to keep backward compatibility, we'll also add the new value diff --git a/retroshare-gui/src/gui/Identity/IdDialog.cpp b/retroshare-gui/src/gui/Identity/IdDialog.cpp index 96b943d15..1cf93055b 100644 --- a/retroshare-gui/src/gui/Identity/IdDialog.cpp +++ b/retroshare-gui/src/gui/Identity/IdDialog.cpp @@ -1993,7 +1993,7 @@ QString IdDialog::createUsageString(const RsIdentityUsage& u) const return tr("Membership verification in circle %1.").arg(QString::fromStdString(u.mGrpId.toStdString())); } -#warning TODO! Add the different strings and translations here. +#warning TODO! csoler 2017-01-03: Add the different strings and translations here. default: return QString("Undone yet"); } diff --git a/retroshare-gui/src/gui/RetroShareLink.h b/retroshare-gui/src/gui/RetroShareLink.h index b272f3416..241d56740 100644 --- a/retroshare-gui/src/gui/RetroShareLink.h +++ b/retroshare-gui/src/gui/RetroShareLink.h @@ -77,7 +77,7 @@ class RetroShareLink RetroShareLink(const QUrl& url); RetroShareLink(const QString& url); -#warning these methods should be static and return a created link +#warning csoler 2017-01-04: These methods should be static and return a created link bool createFile(const QString& name, uint64_t size, const QString& hash); bool createExtraFile(const QString& name, uint64_t size, const QString& hash, const QString& ssl_id); bool createPerson(const RsPgpId &id); From 4ac3b3f5bfd2d156e3c16fbc1d29f3c8d013d8ea Mon Sep 17 00:00:00 2001 From: Phenom Date: Sat, 18 Mar 2017 10:20:57 +0100 Subject: [PATCH 13/32] Fix Clang warnings: implicit conversion of NULL to bool warning: implicit conversion of NULL constant to 'bool' [-Wnull- conversion] return NULL ; ~~~~~~ ^~~~ false --- libretroshare/src/gxstunnel/p3gxstunnel.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libretroshare/src/gxstunnel/p3gxstunnel.cc b/libretroshare/src/gxstunnel/p3gxstunnel.cc index 3ad4198a9..871a5cd49 100644 --- a/libretroshare/src/gxstunnel/p3gxstunnel.cc +++ b/libretroshare/src/gxstunnel/p3gxstunnel.cc @@ -1193,7 +1193,7 @@ bool p3GxsTunnelService::locked_sendClearTunnelData(RsGxsTunnelDHPublicKeyItem * if(gitem->data_bytes == NULL) { delete gitem ; - return NULL ; + return false ; } // by convention, we use a IV of 0 for unencrypted data. memset(gitem->data_bytes,0,8) ; From 32eeb957b247f72603fcb98f5f52cf2e58e89fc7 Mon Sep 17 00:00:00 2001 From: Phenom Date: Sat, 18 Mar 2017 10:25:23 +0100 Subject: [PATCH 14/32] Fix Clang warnings: unused private field warning: private field 'mAutoBanIdentitiesLimit' is not used [-Wunused- private-field] float mAutoBanIdentitiesLimit ; warning: private field 'mFiles' is not used [-Wunused-private-field] RsFiles* mFiles; --- libresapi/src/api/FileSearchHandler.cpp | 4 ++-- libresapi/src/api/FileSearchHandler.h | 2 +- libretroshare/src/services/p3gxsreputation.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libresapi/src/api/FileSearchHandler.cpp b/libresapi/src/api/FileSearchHandler.cpp index 2b56317ad..c159ad913 100644 --- a/libresapi/src/api/FileSearchHandler.cpp +++ b/libresapi/src/api/FileSearchHandler.cpp @@ -10,8 +10,8 @@ namespace resource_api { -FileSearchHandler::FileSearchHandler(StateTokenServer *sts, RsNotify *notify, RsTurtle *turtle, RsFiles *files): - mStateTokenServer(sts), mNotify(notify), mTurtle(turtle), mFiles(files), +FileSearchHandler::FileSearchHandler(StateTokenServer *sts, RsNotify *notify, RsTurtle *turtle, RsFiles */*files*/): + mStateTokenServer(sts), mNotify(notify), mTurtle(turtle),// mFiles(files), mMtx("FileSearchHandler") { mNotify->registerNotifyClient(this); diff --git a/libresapi/src/api/FileSearchHandler.h b/libresapi/src/api/FileSearchHandler.h index 1cab730a4..a049c2207 100644 --- a/libresapi/src/api/FileSearchHandler.h +++ b/libresapi/src/api/FileSearchHandler.h @@ -24,7 +24,7 @@ private: StateTokenServer* mStateTokenServer; RsNotify* mNotify; RsTurtle* mTurtle; - RsFiles* mFiles; + //RsFiles* mFiles; class Search{ public: diff --git a/libretroshare/src/services/p3gxsreputation.h b/libretroshare/src/services/p3gxsreputation.h index baabdaa43..890092237 100644 --- a/libretroshare/src/services/p3gxsreputation.h +++ b/libretroshare/src/services/p3gxsreputation.h @@ -174,7 +174,7 @@ private: time_t mLastIdentityFlagsUpdate ; bool mReputationsUpdated; - float mAutoBanIdentitiesLimit ; + //float mAutoBanIdentitiesLimit ; bool mAutoSetPositiveOptionToContacts; p3LinkMgr *mLinkMgr; From de4f6c06dd951f5b6f18005cbb06cd3e892e1920 Mon Sep 17 00:00:00 2001 From: Phenom Date: Sat, 18 Mar 2017 10:42:38 +0100 Subject: [PATCH 15/32] Fix Clang warnings: Z-order assignment to spacer warning: Z-order assignment: 'verticalSpacer_2' is not a valid widget. --- retroshare-gui/src/gui/Identity/IdDialog.ui | 36 ++++++++++----------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/retroshare-gui/src/gui/Identity/IdDialog.ui b/retroshare-gui/src/gui/Identity/IdDialog.ui index 016ff28e1..1c52802ef 100644 --- a/retroshare-gui/src/gui/Identity/IdDialog.ui +++ b/retroshare-gui/src/gui/Identity/IdDialog.ui @@ -287,7 +287,7 @@ 692 - + @@ -296,12 +296,12 @@ QFrame::Raised - + 12 - + @@ -397,7 +397,7 @@ QFrame::Box - + 6 @@ -514,7 +514,7 @@ border-image: url(:/images/closepressed.png) Identity info - + @@ -526,7 +526,7 @@ border-image: url(:/images/closepressed.png) - + Your opinion: @@ -540,7 +540,7 @@ border-image: url(:/images/closepressed.png) - + Qt::Horizontal @@ -728,7 +728,7 @@ p, li { white-space: pre-wrap; } - + @@ -774,12 +774,12 @@ p, li { white-space: pre-wrap; } - + 6 - + 34 @@ -813,14 +813,14 @@ p, li { white-space: pre-wrap; } - + Qt::Vertical - + 34 @@ -856,7 +856,7 @@ p, li { white-space: pre-wrap; } - + Qt::Vertical @@ -874,11 +874,11 @@ p, li { white-space: pre-wrap; } - + Usage statistics - + @@ -886,7 +886,7 @@ p, li { white-space: pre-wrap; } - + Qt::Vertical @@ -900,10 +900,8 @@ p, li { white-space: pre-wrap; } detailsGroupBox - detailsGroupBox - groupBox + usageStatisticsGBox headerFramePerson - verticalSpacer_2 From e0225efef35068800241d02ff4cee25c1a9e8a9e Mon Sep 17 00:00:00 2001 From: Phenom Date: Sat, 18 Mar 2017 11:19:42 +0100 Subject: [PATCH 16/32] Fix Clang warnings: 'ChatLobbyDialog::init' hides overloaded virtual function warning: 'ChatLobbyDialog::init' hides overloaded virtual function [- Woverloaded-virtual] virtual void init(); ^ /retroshare-gui/src/gui/chat/ChatDialog.h:87: hidden overloaded virtual function 'ChatDialog::init' declared here: different number of parameters (2 vs 0) virtual void init(ChatId id, const QString &title); ^ --- retroshare-gui/src/gui/chat/ChatLobbyDialog.cpp | 5 +++++ retroshare-gui/src/gui/chat/ChatLobbyDialog.h | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/retroshare-gui/src/gui/chat/ChatLobbyDialog.cpp b/retroshare-gui/src/gui/chat/ChatLobbyDialog.cpp index 4056156bb..c5dec3a67 100644 --- a/retroshare-gui/src/gui/chat/ChatLobbyDialog.cpp +++ b/retroshare-gui/src/gui/chat/ChatLobbyDialog.cpp @@ -304,6 +304,11 @@ void ChatLobbyDialog::showInPeopleTab() idDialog->navigate(nickname); } +void ChatLobbyDialog::init(ChatId /*id*/, const QString &/*title*/) +{ + init(); +} + void ChatLobbyDialog::init() { ChatLobbyInfo linfo ; diff --git a/retroshare-gui/src/gui/chat/ChatLobbyDialog.h b/retroshare-gui/src/gui/chat/ChatLobbyDialog.h index 40fb44014..2dd66a554 100644 --- a/retroshare-gui/src/gui/chat/ChatLobbyDialog.h +++ b/retroshare-gui/src/gui/chat/ChatLobbyDialog.h @@ -71,7 +71,8 @@ protected: virtual ~ChatLobbyDialog(); void processSettings(bool load); - virtual void init(); + virtual void init(ChatId id, const QString &title); + void init(); virtual bool canClose(); virtual void addChatMsg(const ChatMessage &msg); From 13c8f7d342418c2f52943238fc630ba89aa6f601 Mon Sep 17 00:00:00 2001 From: Phenom Date: Sat, 18 Mar 2017 11:28:29 +0100 Subject: [PATCH 17/32] Fix Clang warnings: Infinite recursion warning: all paths through this function will call itself [-Winfinite- recursion] { ^ --- retroshare-gui/src/gui/MainWindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/retroshare-gui/src/gui/MainWindow.cpp b/retroshare-gui/src/gui/MainWindow.cpp index 4fecfa620..8e8534345 100644 --- a/retroshare-gui/src/gui/MainWindow.cpp +++ b/retroshare-gui/src/gui/MainWindow.cpp @@ -1207,7 +1207,7 @@ void MainWindow::showHelpDialog(const QString &topic) void MainWindow::retranslateUi() { - retranslateUi(); + //retranslateUi(); foreach (MainPage *page, ui->stackPages->pages()) { page->retranslateUi(); } From 9319caffc77dfcf4427baacc86349d71b520a26c Mon Sep 17 00:00:00 2001 From: Phenom Date: Sat, 18 Mar 2017 11:32:56 +0100 Subject: [PATCH 18/32] Fix Clang warnings: 'Node::advance' hides overloaded virtual function warning: 'Node::advance' hides overloaded virtual function [- Woverloaded-virtual] bool advance(); ^ /usr/include/qt4/QtGui/qgraphicsitem.h:323: hidden overloaded virtual function 'QGraphicsItem::advance' declared here: different number of parameters (1 vs 0) virtual void advance(int phase); ^ --- retroshare-gui/src/gui/elastic/graphwidget.cpp | 2 +- retroshare-gui/src/gui/elastic/node.cpp | 2 +- retroshare-gui/src/gui/elastic/node.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/retroshare-gui/src/gui/elastic/graphwidget.cpp b/retroshare-gui/src/gui/elastic/graphwidget.cpp index bb1f9ffb8..a2c69c80d 100644 --- a/retroshare-gui/src/gui/elastic/graphwidget.cpp +++ b/retroshare-gui/src/gui/elastic/graphwidget.cpp @@ -362,7 +362,7 @@ void GraphWidget::timerEvent(QTimerEvent *event) bool itemsMoved = false; foreach (Node *node, _nodes) - if(node->advance()) + if(node->progress()) itemsMoved = true; if (!itemsMoved) { diff --git a/retroshare-gui/src/gui/elastic/node.cpp b/retroshare-gui/src/gui/elastic/node.cpp index bc33151df..6a3020b21 100644 --- a/retroshare-gui/src/gui/elastic/node.cpp +++ b/retroshare-gui/src/gui/elastic/node.cpp @@ -215,7 +215,7 @@ void Node::calculateForces(const double *map,int width,int height,int W,int H,fl newPos.setY(qMin(qMax(newPos.y(), sceneRect.top()) , sceneRect.bottom())); } -bool Node::advance() +bool Node::progress() { if(_type == GraphWidget::ELASTIC_NODE_TYPE_OWN) return false; diff --git a/retroshare-gui/src/gui/elastic/node.h b/retroshare-gui/src/gui/elastic/node.h index 13c717b0b..e43fa3521 100644 --- a/retroshare-gui/src/gui/elastic/node.h +++ b/retroshare-gui/src/gui/elastic/node.h @@ -77,7 +77,7 @@ public: std::string descString() const { return _desc_string ; } void calculateForces(const double *data,int width,int height,int W,int H,float x,float y,float speedf); - bool advance(); + bool progress(); QRectF boundingRect() const; QPainterPath shape() const; From eea49d96bfb58914ef031d7139571c1cc6f36d80 Mon Sep 17 00:00:00 2001 From: Phenom Date: Sat, 18 Mar 2017 11:56:11 +0100 Subject: [PATCH 19/32] Fix Clang warnings: change ChatDialog::init definition warning: 'PopupChatDialog::init' hides overloaded virtual function [- Woverloaded-virtual] virtual void init(const ChatId &chat_id, const QString &title); ^ /retroshare-gui/src/gui/chat/ChatDialog.h:87: hidden overloaded virtual function 'ChatDialog::init' declared here: type mismatch at 1st parameter ('ChatId' vs 'const ChatId &') virtual void init(ChatId id, const QString &title); ^ --- retroshare-gui/src/gui/chat/ChatDialog.cpp | 4 ++-- retroshare-gui/src/gui/chat/ChatDialog.h | 2 +- retroshare-gui/src/gui/chat/ChatLobbyDialog.cpp | 7 +------ retroshare-gui/src/gui/chat/ChatLobbyDialog.h | 3 +-- retroshare-gui/src/gui/chat/PopupChatDialog.h | 2 +- 5 files changed, 6 insertions(+), 12 deletions(-) diff --git a/retroshare-gui/src/gui/chat/ChatDialog.cpp b/retroshare-gui/src/gui/chat/ChatDialog.cpp index 2ab8b8e90..2a52ccf35 100644 --- a/retroshare-gui/src/gui/chat/ChatDialog.cpp +++ b/retroshare-gui/src/gui/chat/ChatDialog.cpp @@ -63,7 +63,7 @@ void ChatDialog::closeEvent(QCloseEvent *event) emit dialogClose(this); } -void ChatDialog::init(ChatId id, const QString &title) +void ChatDialog::init(const ChatId &id, const QString &title) { mChatId = id; ChatWidget *cw = getChatWidget(); @@ -102,7 +102,7 @@ void ChatDialog::init(ChatId id, const QString &title) if (chatflags & RS_CHAT_OPEN) { if (id.isLobbyId()) { ChatLobbyDialog* cld = new ChatLobbyDialog(id.toLobbyId()); - cld->init(); + cld->init(ChatId(), ""); cd = cld; } else if(id.isDistantChatId()) diff --git a/retroshare-gui/src/gui/chat/ChatDialog.h b/retroshare-gui/src/gui/chat/ChatDialog.h index f6b4ae57e..a5c6a0bc3 100644 --- a/retroshare-gui/src/gui/chat/ChatDialog.h +++ b/retroshare-gui/src/gui/chat/ChatDialog.h @@ -84,7 +84,7 @@ protected: virtual QString getPeerName(const ChatId &sslid) const ; // can be overloaded for chat dialogs that have specific peers virtual QString getOwnName() const; - virtual void init(ChatId id, const QString &title); + virtual void init(const ChatId &id, const QString &title); virtual void addChatMsg(const ChatMessage& msg) = 0; ChatId mChatId; diff --git a/retroshare-gui/src/gui/chat/ChatLobbyDialog.cpp b/retroshare-gui/src/gui/chat/ChatLobbyDialog.cpp index c5dec3a67..20352b888 100644 --- a/retroshare-gui/src/gui/chat/ChatLobbyDialog.cpp +++ b/retroshare-gui/src/gui/chat/ChatLobbyDialog.cpp @@ -304,12 +304,7 @@ void ChatLobbyDialog::showInPeopleTab() idDialog->navigate(nickname); } -void ChatLobbyDialog::init(ChatId /*id*/, const QString &/*title*/) -{ - init(); -} - -void ChatLobbyDialog::init() +void ChatLobbyDialog::init(const ChatId &/*id*/, const QString &/*title*/) { ChatLobbyInfo linfo ; diff --git a/retroshare-gui/src/gui/chat/ChatLobbyDialog.h b/retroshare-gui/src/gui/chat/ChatLobbyDialog.h index 2dd66a554..420524f93 100644 --- a/retroshare-gui/src/gui/chat/ChatLobbyDialog.h +++ b/retroshare-gui/src/gui/chat/ChatLobbyDialog.h @@ -71,8 +71,7 @@ protected: virtual ~ChatLobbyDialog(); void processSettings(bool load); - virtual void init(ChatId id, const QString &title); - void init(); + virtual void init(const ChatId &id, const QString &title); virtual bool canClose(); virtual void addChatMsg(const ChatMessage &msg); diff --git a/retroshare-gui/src/gui/chat/PopupChatDialog.h b/retroshare-gui/src/gui/chat/PopupChatDialog.h index 0a304b14c..49e3036b3 100644 --- a/retroshare-gui/src/gui/chat/PopupChatDialog.h +++ b/retroshare-gui/src/gui/chat/PopupChatDialog.h @@ -46,7 +46,7 @@ protected: /** Default destructor */ virtual ~PopupChatDialog(); - virtual void init(const ChatId &chat_id, const QString &title); + virtual void init(const ChatId &chat_id, const QString &title); virtual void showDialog(uint chatflags); virtual ChatWidget *getChatWidget(); virtual bool hasPeerStatus() { return true; } From 07b67e9cc90bea746d92711289a212de50ad2fcf Mon Sep 17 00:00:00 2001 From: Phenom Date: Sun, 19 Mar 2017 10:40:34 +0100 Subject: [PATCH 20/32] Fix Clang warnings: 'PopupDistantChatDialog::init' hides overloaded virtual function warning: 'PopupDistantChatDialog::init' hides overloaded virtual function [-Woverloaded-virtual] virtual void init(const DistantChatPeerId& peer_id); /retroshare-gui/src/gui/chat/PopupChatDialog.h:49: hidden overloaded virtual function 'PopupChatDialog::init' declared here: different number of parameters (2 vs 1) virtual void init(const ChatId &chat_id, const QString &title); --- retroshare-gui/src/gui/chat/ChatDialog.cpp | 2 +- .../src/gui/chat/PopupDistantChatDialog.cpp | 13 ++++++++----- .../src/gui/chat/PopupDistantChatDialog.h | 2 +- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/retroshare-gui/src/gui/chat/ChatDialog.cpp b/retroshare-gui/src/gui/chat/ChatDialog.cpp index 2a52ccf35..9fe8220ab 100644 --- a/retroshare-gui/src/gui/chat/ChatDialog.cpp +++ b/retroshare-gui/src/gui/chat/ChatDialog.cpp @@ -109,7 +109,7 @@ void ChatDialog::init(const ChatId &id, const QString &title) { PopupDistantChatDialog* pdcd = new PopupDistantChatDialog(id.toDistantChatId()); - pdcd->init(id.toDistantChatId()); + pdcd->init(id, ""); cd = pdcd; } else diff --git a/retroshare-gui/src/gui/chat/PopupDistantChatDialog.cpp b/retroshare-gui/src/gui/chat/PopupDistantChatDialog.cpp index 4992b5ff5..dea397310 100644 --- a/retroshare-gui/src/gui/chat/PopupDistantChatDialog.cpp +++ b/retroshare-gui/src/gui/chat/PopupDistantChatDialog.cpp @@ -63,9 +63,12 @@ PopupDistantChatDialog::PopupDistantChatDialog(const DistantChatPeerId& tunnel_i updateDisplay() ; } -void PopupDistantChatDialog::init(const DistantChatPeerId &peer_id) +void PopupDistantChatDialog::init(const ChatId &chat_id, const QString &/*title*/) { - _tunnel_id = peer_id; + if (!chat_id.isDistantChatId()) + return; + + _tunnel_id = chat_id.toDistantChatId(); DistantChatPeerInfo tinfo; if(!rsMsgs->getDistantChatStatus(_tunnel_id,tinfo)) @@ -74,15 +77,15 @@ void PopupDistantChatDialog::init(const DistantChatPeerId &peer_id) RsIdentityDetails iddetails ; if(rsIdentity->getIdDetails(tinfo.to_id,iddetails)) - PopupChatDialog::init(ChatId(peer_id), QString::fromUtf8(iddetails.mNickname.c_str())) ; + PopupChatDialog::init(chat_id, QString::fromUtf8(iddetails.mNickname.c_str())) ; else - PopupChatDialog::init(ChatId(peer_id), QString::fromStdString(tinfo.to_id.toStdString())) ; + PopupChatDialog::init(chat_id, QString::fromStdString(tinfo.to_id.toStdString())) ; // Do not use setOwnId, because we don't want the user to change the GXS avatar from the chat window // it will not be transmitted. ui.ownAvatarWidget->setOwnId() ; // sets the flag - ui.ownAvatarWidget->setId(ChatId(peer_id)) ; // sets the actual Id + ui.ownAvatarWidget->setId(chat_id) ; // sets the actual Id } void PopupDistantChatDialog::updateDisplay() diff --git a/retroshare-gui/src/gui/chat/PopupDistantChatDialog.h b/retroshare-gui/src/gui/chat/PopupDistantChatDialog.h index dfe75b9de..ff05f70c0 100644 --- a/retroshare-gui/src/gui/chat/PopupDistantChatDialog.h +++ b/retroshare-gui/src/gui/chat/PopupDistantChatDialog.h @@ -38,7 +38,7 @@ class PopupDistantChatDialog: public PopupChatDialog /** Default destructor */ virtual ~PopupDistantChatDialog(); - virtual void init(const DistantChatPeerId& peer_id); + virtual void init(const ChatId& chat_id, const QString &title); virtual void closeEvent(QCloseEvent *e) ; virtual QString getPeerName(const ChatId &id) const ; From 6f2d7bbca040448b9ad906e4f816543ee3c924f0 Mon Sep 17 00:00:00 2001 From: Phenom Date: Sun, 19 Mar 2017 10:51:48 +0100 Subject: [PATCH 21/32] Fix Clang warnings: implicit conversion from 'double' to 'int' warning: implicit conversion from 'double' to 'int' changes value from 2.5 to 2 [-Wliteral-conversion] QSize buttonSize = QSize(iconSize + QSize(FMM,FMM)); --- retroshare-gui/src/gui/chat/ChatWidget.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/retroshare-gui/src/gui/chat/ChatWidget.cpp b/retroshare-gui/src/gui/chat/ChatWidget.cpp index 2ea4ba348..37e2b589e 100644 --- a/retroshare-gui/src/gui/chat/ChatWidget.cpp +++ b/retroshare-gui/src/gui/chat/ChatWidget.cpp @@ -76,7 +76,7 @@ ChatWidget::ChatWidget(QWidget *parent) : int iconHeight = FMM*QFontMetricsF(font()).height() ; QSize iconSize = QSize(iconHeight,iconHeight); - QSize buttonSize = QSize(iconSize + QSize(FMM,FMM)); + QSize buttonSize = QSize(iconSize + QSize((int)FMM,(int)FMM)); newMessages = false; typing = false; @@ -258,7 +258,7 @@ void ChatWidget::addChatBarWidget(QWidget *w) { int iconHeight = FMM*QFontMetricsF(font()).height() ; QSize iconSize = QSize(iconHeight,iconHeight); - QSize buttonSize = QSize(iconSize + QSize(FMM,FMM)); + QSize buttonSize = QSize(iconSize + QSize((int)FMM,(int)FMM)); w->setFixedSize(buttonSize); ui->pluginButtonFrame->layout()->addWidget(w) ; } From 8d85cf558b0f5f2167185a4b56ce5f968fec8efd Mon Sep 17 00:00:00 2001 From: Phenom Date: Tue, 28 Mar 2017 21:16:05 +0200 Subject: [PATCH 22/32] Fix Clang warnings: 'xxxWidget::sizeHint' hides overloaded vf warning: 'IdentityWidget::sizeHint' hides overloaded virtual function [- Woverloaded-virtual] QSize sizeHint(); warning: 'CircleWidget::sizeHint' hides overloaded virtual function [- Woverloaded-virtual] QSize sizeHint(); /usr/include/qt4/QtGui/qwidget.h:537: hidden overloaded virtual function 'QWidget::sizeHint' declared here: different qualifiers (const vs none) virtual QSize sizeHint() const; --- retroshare-gui/src/gui/People/CircleWidget.cpp | 2 +- retroshare-gui/src/gui/People/CircleWidget.h | 2 +- retroshare-gui/src/gui/People/IdentityWidget.cpp | 2 +- retroshare-gui/src/gui/People/IdentityWidget.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/retroshare-gui/src/gui/People/CircleWidget.cpp b/retroshare-gui/src/gui/People/CircleWidget.cpp index 3a192f97a..b36a3fa56 100644 --- a/retroshare-gui/src/gui/People/CircleWidget.cpp +++ b/retroshare-gui/src/gui/People/CircleWidget.cpp @@ -96,7 +96,7 @@ void CircleWidget::updateData(const RsGroupMetaData& gxs_group_info } } -QSize CircleWidget::sizeHint() +QSize CircleWidget::sizeHint() const { QSize size; size.setHeight(ui->graphicsView->size().height() + ui->label->size().height()); diff --git a/retroshare-gui/src/gui/People/CircleWidget.h b/retroshare-gui/src/gui/People/CircleWidget.h index 08b6ad6dc..75d6899ba 100644 --- a/retroshare-gui/src/gui/People/CircleWidget.h +++ b/retroshare-gui/src/gui/People/CircleWidget.h @@ -24,7 +24,7 @@ public: , const RsGxsCircleDetails& details); //Start QWidget Properties - QSize sizeHint(); + QSize sizeHint() const; //Start FlowLayoutItem Properties virtual const QPixmap getImage(); virtual const QPixmap getDragImage(); diff --git a/retroshare-gui/src/gui/People/IdentityWidget.cpp b/retroshare-gui/src/gui/People/IdentityWidget.cpp index 902a4dc18..0fcfbc127 100644 --- a/retroshare-gui/src/gui/People/IdentityWidget.cpp +++ b/retroshare-gui/src/gui/People/IdentityWidget.cpp @@ -148,7 +148,7 @@ void IdentityWidget::updateData(const RsGxsIdGroup &gxs_group_info, const RsPeer updateData(pgp_details); } -QSize IdentityWidget::sizeHint() +QSize IdentityWidget::sizeHint() const { QSize size; size.setHeight(ui->graphicsView->size().height() + ui->labelName->size().height()); diff --git a/retroshare-gui/src/gui/People/IdentityWidget.h b/retroshare-gui/src/gui/People/IdentityWidget.h index c9ade98e3..7f5dcd97f 100644 --- a/retroshare-gui/src/gui/People/IdentityWidget.h +++ b/retroshare-gui/src/gui/People/IdentityWidget.h @@ -26,7 +26,7 @@ public: , const RsPeerDetails& pgp_details); //Start QWidget Properties - QSize sizeHint(); + QSize sizeHint() const; //Start FlowLayoutItem Properties virtual const QPixmap getImage(); virtual const QPixmap getDragImage(); From fd92bca688e07ade46aec892a23a323e6a3bed1c Mon Sep 17 00:00:00 2001 From: Phenom Date: Tue, 28 Mar 2017 21:18:25 +0200 Subject: [PATCH 23/32] Fix Clang warnings: variable 'layout' is used uninitialized warning: variable 'layout' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized] if (wid) layout = --- retroshare-gui/src/gui/People/PeopleDialog.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/retroshare-gui/src/gui/People/PeopleDialog.cpp b/retroshare-gui/src/gui/People/PeopleDialog.cpp index 5098da953..bdf247a4f 100644 --- a/retroshare-gui/src/gui/People/PeopleDialog.cpp +++ b/retroshare-gui/src/gui/People/PeopleDialog.cpp @@ -901,7 +901,7 @@ void PeopleDialog::pf_dropEventOccursExt(QDropEvent *event) QWidget *wid = qobject_cast(event->source());//QT5 return QObject - FlowLayout *layout; + FlowLayout *layout = NULL; if (wid) layout = qobject_cast(wid->layout()); if (layout) { @@ -991,7 +991,7 @@ void PeopleDialog::pf_dropEventOccursInt(QDropEvent *event) QWidget *wid = qobject_cast(event->source());//QT5 return QObject - FlowLayout *layout; + FlowLayout *layout = NULL; if (wid) layout = qobject_cast(wid->layout()); if (layout) { From 94ac8216f7c2b7725ddd6607f5717adac1b5cd31 Mon Sep 17 00:00:00 2001 From: Phenom Date: Wed, 29 Mar 2017 18:13:17 +0200 Subject: [PATCH 24/32] Fix Clang warnings: Unused variable Pi warning: unused variable 'Pi' [-Wunused-const-variable] static const double Pi = 3.14159265358979323846264338327950288419717; --- retroshare-gui/src/gui/elastic/edge.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/retroshare-gui/src/gui/elastic/edge.cpp b/retroshare-gui/src/gui/elastic/edge.cpp index 4fec24fe7..e9e60f06b 100644 --- a/retroshare-gui/src/gui/elastic/edge.cpp +++ b/retroshare-gui/src/gui/elastic/edge.cpp @@ -46,7 +46,7 @@ #include -static const double Pi = 3.14159265358979323846264338327950288419717; +//static const double Pi = 3.14159265358979323846264338327950288419717; Edge::Edge(Node *sourceNode, Node *destNode) : arrowSize(10) From a3a53b970dadc3c11c1c35b5ddff56cd1572a1e5 Mon Sep 17 00:00:00 2001 From: Phenom Date: Fri, 7 Apr 2017 18:19:42 +0200 Subject: [PATCH 25/32] Fix Clang warnings: unused parameter 'req' warning: unused parameter 'req' [-Wunused-parameter] void PeersHandler::handleGetStateString(Request& req, Response& resp) --- libresapi/src/api/PeersHandler.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libresapi/src/api/PeersHandler.cpp b/libresapi/src/api/PeersHandler.cpp index 8473bce04..1c4129a38 100644 --- a/libresapi/src/api/PeersHandler.cpp +++ b/libresapi/src/api/PeersHandler.cpp @@ -200,7 +200,7 @@ static bool have_avatar(RsMsgs* msgs, const RsPeerId& id) return size != 0; } -void PeersHandler::handleGetStateString(Request& req, Response& resp) +void PeersHandler::handleGetStateString(Request& /*req*/, Response& resp) { { RS_STACK_MUTEX(mMtx); @@ -246,7 +246,7 @@ void PeersHandler::handleSetStateString(Request& req, Response& resp) resp.setOk(); } -void PeersHandler::handleGetCustomStateString(Request& req, Response& resp) +void PeersHandler::handleGetCustomStateString(Request& /*req*/, Response& resp) { { RS_STACK_MUTEX(mMtx); From 19196e2cb05dfb451d9ca15305042404fc3425c8 Mon Sep 17 00:00:00 2001 From: Phenom Date: Fri, 7 Apr 2017 18:21:49 +0200 Subject: [PATCH 26/32] Fix Clang warnings: ariable 'status' is used uninitialized warning: variable 'status' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized] else if(state_string == "away") ^~~~~~~~~~~~~~~~~~~~~~ --- libresapi/src/api/PeersHandler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libresapi/src/api/PeersHandler.cpp b/libresapi/src/api/PeersHandler.cpp index 1c4129a38..88e9bc445 100644 --- a/libresapi/src/api/PeersHandler.cpp +++ b/libresapi/src/api/PeersHandler.cpp @@ -234,7 +234,7 @@ void PeersHandler::handleSetStateString(Request& req, Response& resp) std::string state_string; req.mStream << makeKeyValueReference("state_string", state_string); - uint32_t status; + uint32_t status = RS_STATUS_OFFLINE; if(state_string == "online") status = RS_STATUS_ONLINE; else if(state_string == "busy") From d8a73132c11bab531cbb8b31ad9583fe09a88532 Mon Sep 17 00:00:00 2001 From: Phenom Date: Fri, 7 Apr 2017 18:32:55 +0200 Subject: [PATCH 27/32] Fix Clang warnings: implicit conversion from 'double' to 'int' warning: implicit conversion from 'double' to 'int' changes value from 0.5 to 0 [-Wliteral-conversion] painter.setPen(QColor::fromRgb(0.5,0.5,0.5)); --- retroshare-gui/src/gui/statistics/GlobalRouterStatistics.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/retroshare-gui/src/gui/statistics/GlobalRouterStatistics.cpp b/retroshare-gui/src/gui/statistics/GlobalRouterStatistics.cpp index a309717b8..a8e830624 100644 --- a/retroshare-gui/src/gui/statistics/GlobalRouterStatistics.cpp +++ b/retroshare-gui/src/gui/statistics/GlobalRouterStatistics.cpp @@ -379,7 +379,7 @@ void GlobalRouterStatisticsWidget::updateContent() painter.setPen(QColor::fromRgb(0,0,0)) ; - painter.setPen(QColor::fromRgb(0.5,0.5,0.5)); + painter.setPen(QColor::fromRgb(127,127,127)); painter.drawRect(ox+2*cellx,current_oy+0.15*celly,fm_monospace.width(ids)+cellx*matrix_info.friend_ids.size()- 2*cellx,celly) ; float total_length = (matrix_info.friend_ids.size()+2)*cellx ; From a476a8138cb410e7b00090e6c371461398365900 Mon Sep 17 00:00:00 2001 From: Phenom Date: Fri, 7 Apr 2017 18:40:02 +0200 Subject: [PATCH 28/32] Fix Clang warnings: function 'update_children_background' is not needed warning: function 'update_children_background' is not needed and will not be emitted [-Wunneeded-internal-declaration] static void update_children_background(QTreeWidgetItem *item, uint32_t type) ^ --- retroshare-gui/src/gui/Identity/IdDialog.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/retroshare-gui/src/gui/Identity/IdDialog.cpp b/retroshare-gui/src/gui/Identity/IdDialog.cpp index 1cf93055b..3b097b986 100644 --- a/retroshare-gui/src/gui/Identity/IdDialog.cpp +++ b/retroshare-gui/src/gui/Identity/IdDialog.cpp @@ -1233,6 +1233,7 @@ static void set_item_background(QTreeWidgetItem *item, uint32_t type) item->setBackground (0, brush); } +#ifdef SUSPENDED static void update_children_background(QTreeWidgetItem *item, uint32_t type) { int count = item->childCount(); @@ -1248,7 +1249,6 @@ static void update_children_background(QTreeWidgetItem *item, uint32_t type) } } -#ifdef SUSPENDED static void set_tree_background(QTreeWidget *tree, uint32_t type) { std::cerr << "CirclesDialog set_tree_background()"; From 0bbd1499d4a57f235032068f6d5824b745d1fbbd Mon Sep 17 00:00:00 2001 From: Phenom Date: Fri, 7 Apr 2017 18:42:22 +0200 Subject: [PATCH 29/32] Fix Clang warnings: comparison of integers of different signs warning: comparison of integers of different signs: 'uint32_t' (aka 'unsigned int') and 'int' [-Wsign-compare] for(uint32_t i=0;i<(*it).size();++i) ~^~~~~~~~~~~~~ --- retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp index 4254af49e..5c479005c 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp @@ -1607,7 +1607,7 @@ void GxsForumThreadWidget::insertMessage() int current_index = 0 ; - for(uint32_t i=0;i<(*it).size();++i) + for(int i=0;i<(*it).size();++i) { ui->versions_CB->insertItem(i, ((i==0)?tr("(Latest) "):tr("(Old) "))+" "+DateTime::formatLongDateTime( (*it)[i].first)); ui->versions_CB->setItemData(i,QString::fromStdString((*it)[i].second.toStdString())); From 76f75736598c1e1ce7fca9741bc7b34ccef0185b Mon Sep 17 00:00:00 2001 From: Phenom Date: Fri, 7 Apr 2017 18:48:40 +0200 Subject: [PATCH 30/32] Fix Clang warnings: comparison of array != a null pointer is always true warning: comparison of array 'known_zones[i].tzName' not equal to a null pointer is always true [-Wtautological-pointer-compare] for (int i=0; known_zones[i].tzName != 0; i++) { --- plugins/FeedReader/services/p3FeedReaderThread.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/FeedReader/services/p3FeedReaderThread.cc b/plugins/FeedReader/services/p3FeedReaderThread.cc index c638304f4..9ec1106ef 100644 --- a/plugins/FeedReader/services/p3FeedReaderThread.cc +++ b/plugins/FeedReader/services/p3FeedReaderThread.cc @@ -651,7 +651,7 @@ static time_t parseRFC822Date(const std::string &pubDate) offset = abs(offset); offset = ((offset / 100)*60 + (offset % 100))*sgn; } else { - for (int i=0; known_zones[i].tzName != 0; i++) { + for (int i=0; known_zones[i].tzName[0] != 0; i++) { if (0 == strncasecmp(dateString, known_zones[i].tzName, strlen(known_zones[i].tzName))) { offset = known_zones[i].tzOffset; break; From 4f939b2b760ae0257cb49db19d9da610a11b1ac3 Mon Sep 17 00:00:00 2001 From: Phenom Date: Fri, 7 Apr 2017 19:29:27 +0200 Subject: [PATCH 31/32] Fix Clang warnings: unused function 'set_item_background' warning: unused function 'set_item_background' [-Wunused-function] static void set_item_background(QTreeWidgetItem *item, uint32_t type) --- retroshare-gui/src/gui/Identity/IdDialog.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/retroshare-gui/src/gui/Identity/IdDialog.cpp b/retroshare-gui/src/gui/Identity/IdDialog.cpp index 3b097b986..aac7e3ba5 100644 --- a/retroshare-gui/src/gui/Identity/IdDialog.cpp +++ b/retroshare-gui/src/gui/Identity/IdDialog.cpp @@ -1208,6 +1208,7 @@ void IdDialog::CircleListCustomPopupMenu( QPoint ) contextMnu.exec(QCursor::pos()); } +#ifdef SUSPENDED static void set_item_background(QTreeWidgetItem *item, uint32_t type) { QBrush brush; @@ -1233,7 +1234,6 @@ static void set_item_background(QTreeWidgetItem *item, uint32_t type) item->setBackground (0, brush); } -#ifdef SUSPENDED static void update_children_background(QTreeWidgetItem *item, uint32_t type) { int count = item->childCount(); From 87dd6140885771e9534782b438b1ad9fb31691c6 Mon Sep 17 00:00:00 2001 From: Phenom Date: Fri, 7 Apr 2017 19:32:19 +0200 Subject: [PATCH 32/32] Fix Clang Warnings: private field 'encoding_debug_file' is not used warning: private field 'encoding_debug_file' is not used [-Wunused- private-field] FILE *encoding_debug_file ; --- plugins/VOIP/gui/VideoProcessor.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/VOIP/gui/VideoProcessor.h b/plugins/VOIP/gui/VideoProcessor.h index 4e47b2c29..4946c4342 100644 --- a/plugins/VOIP/gui/VideoProcessor.h +++ b/plugins/VOIP/gui/VideoProcessor.h @@ -66,7 +66,9 @@ private: AVPacket decoding_buffer; uint64_t encoding_frame_count ; +#ifdef DEBUG_MPEG_VIDEO FILE *encoding_debug_file ; +#endif }; // This class decodes video from a stream. It keeps a queue of