Merge pull request #2542 from thunder2/warnings1

Removed compiler warnings in libretroshare
This commit is contained in:
csoler 2022-01-03 20:03:41 +01:00 committed by GitHub
commit fd5a008be7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 23 additions and 10 deletions

View File

@ -151,6 +151,10 @@ int p3BitDht::setRelayMode(RsDhtRelayMode mode)
pushRelayServers();
mUdpBitDht->setDhtMode(BITDHT_MODE_RELAYSERVERS_SERVER);
break;
case RsDhtRelayMode::ENABLED:
case RsDhtRelayMode::DISABLED:
case RsDhtRelayMode::MASK:
break;
}
{

View File

@ -657,7 +657,6 @@ bool ftController::completeFile(const RsFileHash& hash)
uint32_t period = 0;
TransferRequestFlags flags ;
TransferRequestFlags extraflags ;
uint32_t completeCount = 0;
{
RS_STACK_MUTEX(ctrlMutex);
@ -780,7 +779,6 @@ bool ftController::completeFile(const RsFileHash& hash)
/* switch map */
mCompleted[fc->mHash] = fc;
completeCount = mCompleted.size();
mDownloads.erase(it);

View File

@ -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;

View File

@ -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.

View File

@ -1186,6 +1186,7 @@ bool RsGenExchange::checkAuthenFlag(const PrivacyBitPos& pos, const uint8_t& fla
}
}
#ifdef TO_REMOVE
static void addMessageChanged(std::map<RsGxsGroupId, std::set<RsGxsMessageId> > &msgs, const std::map<RsGxsGroupId, std::set<RsGxsMessageId> > &msgChanged)
{
if (msgs.empty()) {
@ -1203,7 +1204,6 @@ static void addMessageChanged(std::map<RsGxsGroupId, std::set<RsGxsMessageId> >
}
}
#ifdef TO_REMOVE
void RsGenExchange::receiveChanges(std::vector<RsGxsNotify*>& changes)
{
std::cerr << "*********************************** RsGenExchange::receiveChanges()" << std::endl;
@ -1780,7 +1780,7 @@ void RsGenExchange::receiveNewMessages(const std::vector<RsNxsMsg *>& 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;
}

View File

@ -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.

View File

@ -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<RsGxsGroupId>& grpsToDel, GxsMsgReq& msgsToDel )
{
#ifdef DEBUG_GXSUTIL

View File

@ -273,7 +273,6 @@ int inet_aton(const char *name, struct in_addr *addr)
#ifdef WINDOWS_SYS
# include <winsock2.h>
# include <iphlpapi.h>
# pragma comment(lib, "IPHLPAPI.lib")
#elif defined(__ANDROID__) && __ANDROID_API__ < 24
/// @See: android_ifaddrs/README.adoc
# include "rs_android/ifaddrs-android.h"

View File

@ -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<RsGxsId>& gxsIdMembers,
const RsGxsId& /*authorId*/, const std::set<RsGxsId>& gxsIdMembers,
const std::set<RsPgpId>& localMembers ) const
{
if(circleName.empty())

View File

@ -52,7 +52,7 @@ void TorControlCommand::onFinished(int statusCode)
mFinished(this);
}
void TorControlCommand::onDataLine(const ByteArray &data)
void TorControlCommand::onDataLine(const ByteArray &/*data*/)
{
}

View File

@ -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;

View File

@ -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;

View File

@ -34,6 +34,7 @@
#include <string>
// For win32 systems (tested on MingW+Ubuntu)
#undef stat64
#define stat64 _stati64
// Should be in Iphlpapi.h, but mingw doesn't seem to have these