libretroshare: fix comparison between signed and unsigned integer

This commit is contained in:
sehraf 2016-06-02 14:53:15 +02:00
parent 8b788b2aa8
commit 4f60c8cc9b
6 changed files with 15 additions and 16 deletions

View File

@ -54,7 +54,7 @@ RsGxsMessageCleanUp::RsGxsMessageCleanUp(RsGeneralDataService* const dataService
bool RsGxsMessageCleanUp::clean()
{
int i = 1;
uint32_t i = 1;
time_t now = time(NULL);
@ -281,7 +281,7 @@ bool RsGxsIntegrityCheck::check()
std::cerr << " " << *it << std::endl;
#endif
}
int nb_requested_not_in_cache = 0;
uint32_t nb_requested_not_in_cache = 0;
#ifdef GXSUTIL_DEBUG
std::cerr << " issuing random get on friends for non existing IDs" << std::endl;
@ -289,7 +289,7 @@ bool RsGxsIntegrityCheck::check()
// now request a cache update for them, which triggers downloading from friends, if missing.
for(;nb_requested_not_in_cache<MAX_GXS_IDS_REQUESTS_NET && gxs_ids.size()>0;)
for(;nb_requested_not_in_cache < MAX_GXS_IDS_REQUESTS_NET && gxs_ids.size() > (size_t)0;)
{
uint32_t n = RSRandom::random_u32() % gxs_ids.size() ;
#ifdef GXSUTIL_DEBUG

View File

@ -270,7 +270,7 @@ int BinEncryptedFileInterface::readdata(void* data, int len)
else
{
if((cpyCount + len) <= sizeData)
if((cpyCount + len) <= (uint64_t)sizeData)
{
memcpy(data, (void *) ((this->data) + cpyCount), len);
cpyCount += len;
@ -306,9 +306,9 @@ uint64_t BinEncryptedFileInterface::bytecount()
bool BinEncryptedFileInterface::moretoread(uint32_t /* usec */)
{
if(haveData)
return (cpyCount < sizeData);
return (cpyCount < (uint64_t)sizeData);
else
return cpyCount < getFileSize();
return cpyCount < (uint64_t)getFileSize();
}
BinMemInterface::BinMemInterface(int defsize, int flags)

View File

@ -57,7 +57,7 @@ const int pqissllistenzone = 49787;
pqissllistenbase::pqissllistenbase(const sockaddr_storage &addr, p3PeerMgr *pm)
: laddr(addr), active(false), mPeerMgr(pm)
: laddr(addr), mPeerMgr(pm), active(false)
{
if (!(AuthSSL::getAuthSSL()-> active()))
{

View File

@ -605,7 +605,7 @@ int pqistreamer::handleoutgoing_locked()
#endif
int ss=0;
if (mPkt_wpending_size != (ss = mBio->senddata(mPkt_wpending, mPkt_wpending_size)))
if (mPkt_wpending_size != (uint32_t)(ss = mBio->senddata(mPkt_wpending, mPkt_wpending_size)))
{
#ifdef DEBUG_PQISTREAMER
std::string out;
@ -846,7 +846,7 @@ continue_packet:
// so, don't do that:
// memset( extradata,0,extralen ) ;
if (extralen != (tmplen = mBio->readdata(extradata, extralen)))
if (extralen != (uint32_t)(tmplen = mBio->readdata(extradata, extralen)))
{
#ifdef DEBUG_PQISTREAMER
if(tmplen > 0)
@ -1288,7 +1288,7 @@ int pqistreamer::locked_gatherStatistics(std::list<RSTrafficClue>& out_lst,std::
return 1 ;
}
void *pqistreamer::locked_pop_out_data(uint32_t max_slice_size,uint32_t& size,bool& starts,bool& ends,uint32_t& packet_id)
void *pqistreamer::locked_pop_out_data(uint32_t /*max_slice_size*/, uint32_t &size, bool &starts, bool &ends, uint32_t &packet_id)
{
size = 0 ;
starts = true ;

View File

@ -110,7 +110,6 @@ uint32_t RsGxsIdLocalInfoItem::serial_size()
std::ostream& RsGxsIdLocalInfoItem::print(std::ostream& out, uint16_t indent)
{
printRsItemBase(out, "RsGxsIdLocalInfoItem", indent);
uint16_t int_Indent = indent + 2;
// convert from binary to hex.
for(std::map<RsGxsId,time_t>::const_iterator it(mTimeStamps.begin());it!=mTimeStamps.end();++it)
@ -382,7 +381,7 @@ RsGxsIdLocalInfoItem *RsGxsIdSerialiser::deserialise_GxsIdLocalInfoItem(void *da
uint32_t n=0 ;
ok &= getRawUInt32(data, rssize, &offset, &n) ;
for(int i=0;ok && i<n;++i)
for(uint32_t i=0;ok && i<n;++i)
{
RsGxsId gxsid ;
time_t TS ;
@ -397,8 +396,8 @@ RsGxsIdLocalInfoItem *RsGxsIdSerialiser::deserialise_GxsIdLocalInfoItem(void *da
{
ok &= getRawUInt32(data, rssize, &offset, &n) ;
RsGxsId gxsid ;
for(int i=0;ok && i<n;++i)
for(uint32_t i=0;ok && i<n;++i)
{
ok &= gxsid.deserialise(data,rssize,offset) ;

View File

@ -323,7 +323,7 @@ RsGxsReputationSetItem *RsGxsReputationSerialiser::deserialiseReputationSetItem_
uint32_t S ;
ok &= getRawUInt32(data, tlvsize, &offset, &S);
for(int i=0;ok && i<S;++i)
for(uint32_t i = 0; ok && (i < S); ++i)
{
RsPeerId pid ;
uint32_t op ;
@ -361,7 +361,7 @@ RsGxsReputationSetItem *RsGxsReputationSerialiser::deserialiseReputationSetItem(
uint32_t S ;
ok &= getRawUInt32(data, tlvsize, &offset, &S);
for(int i=0;ok && i<S;++i)
for(uint32_t i = 0; ok && (i < S); ++i)
{
RsPeerId pid ;
uint32_t op ;