From 3ad6f6710ba3bc66058bf40edb60000d12351d6e Mon Sep 17 00:00:00 2001 From: thunder2 Date: Mon, 3 Jan 2022 01:57:38 +0100 Subject: [PATCH] Fixed unused variable warning --- libretroshare/src/ft/ftserver.cc | 4 ++++ libretroshare/src/grouter/p3grouter.cc | 3 +++ libretroshare/src/gxs/rsgenexchange.cc | 2 +- libretroshare/src/gxs/rsgxsnetservice.cc | 5 +++++ libretroshare/src/gxs/rsgxsutil.cc | 2 +- libretroshare/src/services/p3gxscircles.cc | 2 +- libretroshare/src/tor/TorControlCommand.cpp | 2 +- libretroshare/src/util/retrodb.cc | 1 - libretroshare/src/util/rskbdinput.cc | 2 +- 9 files changed, 17 insertions(+), 6 deletions(-) diff --git a/libretroshare/src/ft/ftserver.cc b/libretroshare/src/ft/ftserver.cc index bf745e9e8..69f050a32 100644 --- a/libretroshare/src/ft/ftserver.cc +++ b/libretroshare/src/ft/ftserver.cc @@ -2049,6 +2049,10 @@ bool ftServer::receiveSearchRequest( return RsServiceSerializer::serialise( &resIt, searchResultData, &searchResultDataLen ); } +#else + (void) searchRequestData; + (void) searchRequestDataLen; + (void) maxAllowsHits; #endif // def RS_DEEP_FILES_INDEX searchResultData = nullptr; diff --git a/libretroshare/src/grouter/p3grouter.cc b/libretroshare/src/grouter/p3grouter.cc index 16148d508..1c3f56515 100644 --- a/libretroshare/src/grouter/p3grouter.cc +++ b/libretroshare/src/grouter/p3grouter.cc @@ -512,6 +512,9 @@ void p3GRouter::receiveTurtleData(const RsTurtleGenericTunnelItem *gitem, const std::cerr << " Received data for hash : " << hash << std::endl; std::cerr << " Virtual peer id : " << virtual_peer_id << std::endl; std::cerr << " Direction : " << direction << std::endl; +#else + (void) hash; + (void) direction; #endif // turtle data is received. diff --git a/libretroshare/src/gxs/rsgenexchange.cc b/libretroshare/src/gxs/rsgenexchange.cc index fb1b4c295..d91c41fdf 100644 --- a/libretroshare/src/gxs/rsgenexchange.cc +++ b/libretroshare/src/gxs/rsgenexchange.cc @@ -1780,7 +1780,7 @@ void RsGenExchange::receiveNewMessages(const std::vector& messages) } } -void RsGenExchange::receiveDistantSearchResults(TurtleRequestId id,const RsGxsGroupId &grpId) +void RsGenExchange::receiveDistantSearchResults(TurtleRequestId id,const RsGxsGroupId &/*grpId*/) { std::cerr << __PRETTY_FUNCTION__ << " received result for request " << std::hex << id << std::dec << ": this method should be overloaded in the client service, but it is not. This is a bug!" << std::endl; } diff --git a/libretroshare/src/gxs/rsgxsnetservice.cc b/libretroshare/src/gxs/rsgxsnetservice.cc index 9d9437991..d51fdceef 100644 --- a/libretroshare/src/gxs/rsgxsnetservice.cc +++ b/libretroshare/src/gxs/rsgxsnetservice.cc @@ -4277,6 +4277,9 @@ bool RsGxsNetService::locked_checkResendingOfUpdates(const RsPeerId& pid,const R { #ifdef NXS_NET_DEBUG_0 GXSNETDEBUG_PG(pid,grpId) << "(II) peer " << pid << " already sent the same TS " << (long int)now-(long int)rec.mTs << " secs ago for that group ID. Will not send msg list again for a while to prevent clogging..." << std::endl; +#else + (void) pid; + (void) grpId; #endif return false; } @@ -4439,7 +4442,9 @@ void RsGxsNetService::handleRecvSyncMessage(RsNxsSyncMsgReqItem *item,bool item_ uint32_t transN = locked_getTransactionId(); RsGxsCircleId should_encrypt_to_this_circle_id ; +#ifndef RS_GXS_SEND_ALL rstime_t now = time(NULL) ; +#endif #ifndef RS_GXS_SEND_ALL uint32_t max_send_delay = locked_getGrpConfig(item->grpId).msg_req_delay; // we should use "sync" but there's only one variable used in the GUI: the req one. diff --git a/libretroshare/src/gxs/rsgxsutil.cc b/libretroshare/src/gxs/rsgxsutil.cc index 4a0f3e372..16e30c3b3 100644 --- a/libretroshare/src/gxs/rsgxsutil.cc +++ b/libretroshare/src/gxs/rsgxsutil.cc @@ -340,7 +340,7 @@ bool RsGxsIntegrityCheck::check(uint16_t service_type, RsGixs *mgixs, RsGeneralD } bool RsGxsSinglePassIntegrityCheck::check( - uint16_t service_type, RsGixs* mgixs, RsGeneralDataService* mds, + uint16_t /*service_type*/, RsGixs* /*mgixs*/, RsGeneralDataService* mds, std::vector& grpsToDel, GxsMsgReq& msgsToDel ) { #ifdef DEBUG_GXSUTIL diff --git a/libretroshare/src/services/p3gxscircles.cc b/libretroshare/src/services/p3gxscircles.cc index 0b7bc9570..2fc99759f 100644 --- a/libretroshare/src/services/p3gxscircles.cc +++ b/libretroshare/src/services/p3gxscircles.cc @@ -236,7 +236,7 @@ bool p3GxsCircles::createCircle( bool p3GxsCircles::checkCircleParamConsistency( const std::string& circleName, RsGxsCircleType circleType, const RsGxsCircleId& restrictedId, - const RsGxsId& authorId, const std::set& gxsIdMembers, + const RsGxsId& /*authorId*/, const std::set& gxsIdMembers, const std::set& localMembers ) const { if(circleName.empty()) diff --git a/libretroshare/src/tor/TorControlCommand.cpp b/libretroshare/src/tor/TorControlCommand.cpp index 127b6a04a..42c98d96a 100644 --- a/libretroshare/src/tor/TorControlCommand.cpp +++ b/libretroshare/src/tor/TorControlCommand.cpp @@ -52,7 +52,7 @@ void TorControlCommand::onFinished(int statusCode) mFinished(this); } -void TorControlCommand::onDataLine(const ByteArray &data) +void TorControlCommand::onDataLine(const ByteArray &/*data*/) { } diff --git a/libretroshare/src/util/retrodb.cc b/libretroshare/src/util/retrodb.cc index 122f3e6a1..c9b3566ff 100644 --- a/libretroshare/src/util/retrodb.cc +++ b/libretroshare/src/util/retrodb.cc @@ -184,7 +184,6 @@ bool RetroDb::execSQL(const std::string &query){ } - uint32_t delta = 3; rstime_t stamp = time(NULL); bool timeOut = false, ok = false; diff --git a/libretroshare/src/util/rskbdinput.cc b/libretroshare/src/util/rskbdinput.cc index 38b0307a2..ac8309e5a 100644 --- a/libretroshare/src/util/rskbdinput.cc +++ b/libretroshare/src/util/rskbdinput.cc @@ -30,7 +30,7 @@ #define PASS_MAX 512 namespace RsUtil { -std::string rs_getpass(const std::string& prompt,bool no_echo) +std::string rs_getpass(const std::string& prompt,bool /*no_echo*/) { static char getpassbuf [PASS_MAX + 1]; size_t i = 0;