mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-25 07:29:33 -05:00
Merge pull request #804 from PhenomRetroShare/Fix_Warnings
Fix warnings
This commit is contained in:
commit
9a0df3f757
@ -377,8 +377,8 @@ std::string ApiServer::handleRequest(Request &request)
|
|||||||
if(data.isRawData())
|
if(data.isRawData())
|
||||||
return data.getRawData();
|
return data.getRawData();
|
||||||
|
|
||||||
if(!resp.mCallbackName.empty())
|
if(!resp.mCallbackName.empty())
|
||||||
outstream << resource_api::makeKeyValueReference("callback_name", resp.mCallbackName);
|
outstream << resource_api::makeKeyValueReference("callback_name", resp.mCallbackName);
|
||||||
|
|
||||||
outstream << resource_api::makeKeyValue("debug_msg", debugString.str());
|
outstream << resource_api::makeKeyValue("debug_msg", debugString.str());
|
||||||
outstream << resource_api::makeKeyValueReference("returncode", returncode);
|
outstream << resource_api::makeKeyValueReference("returncode", returncode);
|
||||||
|
@ -106,7 +106,7 @@ public:
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void gxsDoWork(Request &req, Response &resp)
|
virtual void gxsDoWork(Request &req, Response & /* resp */)
|
||||||
{
|
{
|
||||||
RsGxsIdGroup group;
|
RsGxsIdGroup group;
|
||||||
std::string gxs_id;
|
std::string gxs_id;
|
||||||
@ -545,7 +545,7 @@ ResponseTask* IdentityHandler::handleCreateIdentity(Request & /* req */, Respons
|
|||||||
return new CreateIdentityTask(mRsIdentity);
|
return new CreateIdentityTask(mRsIdentity);
|
||||||
}
|
}
|
||||||
|
|
||||||
ResponseTask* IdentityHandler::handleDeleteIdentity(Request& req, Response& resp)
|
ResponseTask* IdentityHandler::handleDeleteIdentity(Request& /* req */, Response& /* resp */)
|
||||||
{
|
{
|
||||||
return new DeleteIdentityTask(mRsIdentity);
|
return new DeleteIdentityTask(mRsIdentity);
|
||||||
}
|
}
|
||||||
|
@ -39,8 +39,8 @@ static const uint32_t RS_CHAT_SERIALIZER_FLAGS_NO_SIGNATURE = 0x0001;
|
|||||||
|
|
||||||
RsItem *RsChatSerialiser::create_item(uint16_t service_id,uint8_t item_sub_id) const
|
RsItem *RsChatSerialiser::create_item(uint16_t service_id,uint8_t item_sub_id) const
|
||||||
{
|
{
|
||||||
if(service_id != RS_SERVICE_TYPE_CHAT)
|
if (service_id != RS_SERVICE_TYPE_CHAT)
|
||||||
return NULL ;
|
return NULL;
|
||||||
|
|
||||||
switch(item_sub_id)
|
switch(item_sub_id)
|
||||||
{
|
{
|
||||||
@ -97,12 +97,12 @@ void RsChatLobbyMsgItem::serial_process(RsGenericSerializer::SerializeJob j,RsGe
|
|||||||
RsChatLobbyBouncingObject::serial_process(j,ctx) ;
|
RsChatLobbyBouncingObject::serial_process(j,ctx) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
void RsChatLobbyListRequestItem::serial_process(RsGenericSerializer::SerializeJob j,RsGenericSerializer::SerializeContext& ctx)
|
void RsChatLobbyListRequestItem::serial_process(RsGenericSerializer::SerializeJob /*j*/,RsGenericSerializer::SerializeContext& /*ctx*/)
|
||||||
{
|
{
|
||||||
// nothing to do. This is an empty item.
|
// nothing to do. This is an empty item.
|
||||||
}
|
}
|
||||||
|
|
||||||
template<> void RsTypeSerializer::serial_process(RsGenericSerializer::SerializeJob j,RsGenericSerializer::SerializeContext& ctx,VisibleChatLobbyInfo& info,const std::string& name)
|
template<> void RsTypeSerializer::serial_process(RsGenericSerializer::SerializeJob j,RsGenericSerializer::SerializeContext& ctx,VisibleChatLobbyInfo& info,const std::string& /*name*/)
|
||||||
{
|
{
|
||||||
RsTypeSerializer::serial_process<uint64_t>(j,ctx,info.id,"info.id") ;
|
RsTypeSerializer::serial_process<uint64_t>(j,ctx,info.id,"info.id") ;
|
||||||
|
|
||||||
|
@ -93,7 +93,7 @@ class RsChatItem: public RsItem
|
|||||||
}
|
}
|
||||||
|
|
||||||
virtual ~RsChatItem() {}
|
virtual ~RsChatItem() {}
|
||||||
virtual std::ostream& print(std::ostream &out, uint16_t indent = 0) { return out; } // derived from RsItem, but should be removed
|
virtual std::ostream& print(std::ostream &out, uint16_t /*indent*/ = 0) { return out; } // derived from RsItem, but should be removed
|
||||||
|
|
||||||
virtual void clear() {}
|
virtual void clear() {}
|
||||||
};
|
};
|
||||||
|
@ -815,7 +815,7 @@ X509 *AuthSSLimpl::SignX509ReqWithGPG(X509_REQ *req, long /*days*/)
|
|||||||
const EVP_MD *type = EVP_sha1();
|
const EVP_MD *type = EVP_sha1();
|
||||||
|
|
||||||
EVP_MD_CTX *ctx = EVP_MD_CTX_create();
|
EVP_MD_CTX *ctx = EVP_MD_CTX_create();
|
||||||
unsigned char *p,*buf_in=NULL;
|
unsigned char *buf_in=NULL;
|
||||||
unsigned char *buf_hashout=NULL,*buf_sigout=NULL;
|
unsigned char *buf_hashout=NULL,*buf_sigout=NULL;
|
||||||
int inl=0,hashoutl=0;
|
int inl=0,hashoutl=0;
|
||||||
int sigoutl=0;
|
int sigoutl=0;
|
||||||
@ -854,6 +854,7 @@ X509 *AuthSSLimpl::SignX509ReqWithGPG(X509_REQ *req, long /*days*/)
|
|||||||
#if OPENSSL_VERSION_NUMBER < 0x10100000L
|
#if OPENSSL_VERSION_NUMBER < 0x10100000L
|
||||||
inl=i2d(data,NULL);
|
inl=i2d(data,NULL);
|
||||||
buf_in=(unsigned char *)OPENSSL_malloc((unsigned int)inl);
|
buf_in=(unsigned char *)OPENSSL_malloc((unsigned int)inl);
|
||||||
|
unsigned char *p=NULL;
|
||||||
#else
|
#else
|
||||||
inl=i2d_re_X509_tbs(x509,&buf_in) ; // this does the i2d over x509->cert_info
|
inl=i2d_re_X509_tbs(x509,&buf_in) ; // this does the i2d over x509->cert_info
|
||||||
#endif
|
#endif
|
||||||
@ -977,9 +978,9 @@ bool AuthSSLimpl::AuthX509WithGPG(X509 *x509,uint32_t& diagnostic)
|
|||||||
/* verify GPG signature */
|
/* verify GPG signature */
|
||||||
|
|
||||||
/*** NOW The Manual signing bit (HACKED FROM asn1/a_sign.c) ***/
|
/*** NOW The Manual signing bit (HACKED FROM asn1/a_sign.c) ***/
|
||||||
int (*i2d)(X509_CINF*, unsigned char**) = i2d_X509_CINF;
|
|
||||||
|
|
||||||
#if OPENSSL_VERSION_NUMBER < 0x10100000L
|
#if OPENSSL_VERSION_NUMBER < 0x10100000L
|
||||||
|
int (*i2d)(X509_CINF*, unsigned char**) = i2d_X509_CINF;
|
||||||
ASN1_BIT_STRING *signature = x509->signature;
|
ASN1_BIT_STRING *signature = x509->signature;
|
||||||
X509_CINF *data = x509->cert_info;
|
X509_CINF *data = x509->cert_info;
|
||||||
#else
|
#else
|
||||||
@ -993,7 +994,7 @@ bool AuthSSLimpl::AuthX509WithGPG(X509 *x509,uint32_t& diagnostic)
|
|||||||
const EVP_MD *type = EVP_sha1();
|
const EVP_MD *type = EVP_sha1();
|
||||||
|
|
||||||
EVP_MD_CTX *ctx = EVP_MD_CTX_create();
|
EVP_MD_CTX *ctx = EVP_MD_CTX_create();
|
||||||
unsigned char *p,*buf_in=NULL;
|
unsigned char *buf_in=NULL;
|
||||||
unsigned char *buf_hashout=NULL,*buf_sigout=NULL;
|
unsigned char *buf_hashout=NULL,*buf_sigout=NULL;
|
||||||
int inl=0,hashoutl=0;
|
int inl=0,hashoutl=0;
|
||||||
int sigoutl=0;
|
int sigoutl=0;
|
||||||
@ -1002,6 +1003,7 @@ bool AuthSSLimpl::AuthX509WithGPG(X509 *x509,uint32_t& diagnostic)
|
|||||||
#if OPENSSL_VERSION_NUMBER < 0x10100000L
|
#if OPENSSL_VERSION_NUMBER < 0x10100000L
|
||||||
inl=i2d(data,NULL);
|
inl=i2d(data,NULL);
|
||||||
buf_in=(unsigned char *)OPENSSL_malloc((unsigned int)inl);
|
buf_in=(unsigned char *)OPENSSL_malloc((unsigned int)inl);
|
||||||
|
unsigned char *p=NULL;
|
||||||
#else
|
#else
|
||||||
inl=i2d_re_X509_tbs(x509,&buf_in) ; // this does the i2d over x509->cert_info
|
inl=i2d_re_X509_tbs(x509,&buf_in) ; // this does the i2d over x509->cert_info
|
||||||
#endif
|
#endif
|
||||||
@ -1026,13 +1028,13 @@ bool AuthSSLimpl::AuthX509WithGPG(X509 *x509,uint32_t& diagnostic)
|
|||||||
diagnostic = RS_SSL_HANDSHAKE_DIAGNOSTIC_MALLOC_ERROR ;
|
diagnostic = RS_SSL_HANDSHAKE_DIAGNOSTIC_MALLOC_ERROR ;
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
p=buf_in;
|
|
||||||
|
|
||||||
#ifdef AUTHSSL_DEBUG
|
#ifdef AUTHSSL_DEBUG
|
||||||
std::cerr << "Buffers Allocated" << std::endl;
|
std::cerr << "Buffers Allocated" << std::endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if OPENSSL_VERSION_NUMBER < 0x10100000L
|
#if OPENSSL_VERSION_NUMBER < 0x10100000L
|
||||||
|
p=buf_in;
|
||||||
i2d(data,&p);
|
i2d(data,&p);
|
||||||
#endif
|
#endif
|
||||||
/* data in buf_in, ready to be hashed */
|
/* data in buf_in, ready to be hashed */
|
||||||
|
@ -192,7 +192,7 @@ void RsPeerStunItem::serial_process(RsGenericSerializer::SerializeJob j,RsGeneri
|
|||||||
RsTypeSerializer::serial_process<RsTlvItem>(j,ctx,stunList,"stunList") ;
|
RsTypeSerializer::serial_process<RsTlvItem>(j,ctx,stunList,"stunList") ;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<> uint32_t RsTypeSerializer::serial_size(const PeerBandwidthLimits& s)
|
template<> uint32_t RsTypeSerializer::serial_size(const PeerBandwidthLimits& /*s*/)
|
||||||
{
|
{
|
||||||
return 4+4 ;
|
return 4+4 ;
|
||||||
}
|
}
|
||||||
@ -213,7 +213,7 @@ template<> bool RsTypeSerializer::deserialize(const uint8_t data[], uint32_t siz
|
|||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<> void RsTypeSerializer::print_data(const std::string& n, const PeerBandwidthLimits& s)
|
template<> void RsTypeSerializer::print_data(const std::string& /*n*/, const PeerBandwidthLimits& s)
|
||||||
{
|
{
|
||||||
std::cerr << " [Peer BW limit] " << s.max_up_rate_kbs << " / " << s.max_dl_rate_kbs << std::endl;
|
std::cerr << " [Peer BW limit] " << s.max_up_rate_kbs << " / " << s.max_dl_rate_kbs << std::endl;
|
||||||
}
|
}
|
||||||
|
@ -193,7 +193,7 @@ template<> void RsTypeSerializer::print_data(const std::string& n, uint16_t type
|
|||||||
// TlvInt with subtype //
|
// TlvInt with subtype //
|
||||||
//=================================================================================================//
|
//=================================================================================================//
|
||||||
|
|
||||||
template<> uint32_t RsTypeSerializer::serial_size(uint16_t /* type_subtype */,const uint32_t& s)
|
template<> uint32_t RsTypeSerializer::serial_size(uint16_t /* type_subtype */,const uint32_t& /*s*/)
|
||||||
{
|
{
|
||||||
return GetTlvUInt32Size() ;
|
return GetTlvUInt32Size() ;
|
||||||
}
|
}
|
||||||
|
@ -333,7 +333,7 @@ class RsTypeSerializer
|
|||||||
//=================================================================================================//
|
//=================================================================================================//
|
||||||
|
|
||||||
template<int N>
|
template<int N>
|
||||||
static void serial_process(RsGenericSerializer::SerializeJob j,RsGenericSerializer::SerializeContext& ctx,t_RsFlags32<N>& v,const std::string& member_name)
|
static void serial_process(RsGenericSerializer::SerializeJob j,RsGenericSerializer::SerializeContext& ctx,t_RsFlags32<N>& v,const std::string& /*member_name*/)
|
||||||
{
|
{
|
||||||
switch(j)
|
switch(j)
|
||||||
{
|
{
|
||||||
|
@ -552,8 +552,8 @@ RsGxsRecognTagItem *RsRecogn::extractTag(const std::string &encoded)
|
|||||||
std::vector<uint8_t> buffer = Radix64::decode(encoded);
|
std::vector<uint8_t> buffer = Radix64::decode(encoded);
|
||||||
pktsize = buffer.size();
|
pktsize = buffer.size();
|
||||||
|
|
||||||
if(buffer.empty())
|
if( buffer.empty() )
|
||||||
return NULL ;
|
return NULL;
|
||||||
|
|
||||||
RsGxsRecognSerialiser serialiser;
|
RsGxsRecognSerialiser serialiser;
|
||||||
RsItem *item = serialiser.deserialise(buffer.data(), &pktsize);
|
RsItem *item = serialiser.deserialise(buffer.data(), &pktsize);
|
||||||
|
@ -2472,8 +2472,8 @@ void IdDialog::copyRetroshareLink()
|
|||||||
|
|
||||||
RsIdentityDetails details ;
|
RsIdentityDetails details ;
|
||||||
|
|
||||||
if(! rsIdentity->getIdDetails(gxs_id,details))
|
if(! rsIdentity->getIdDetails(gxs_id,details))
|
||||||
return ;
|
return ;
|
||||||
|
|
||||||
if (!mIdQueue)
|
if (!mIdQueue)
|
||||||
return;
|
return;
|
||||||
|
@ -600,16 +600,16 @@ void RetroShareLink::check()
|
|||||||
if(!checkPGPId(_GPGid)) _valid = false ;
|
if(!checkPGPId(_GPGid)) _valid = false ;
|
||||||
break ;
|
break ;
|
||||||
|
|
||||||
case TYPE_IDENTITY:
|
case TYPE_IDENTITY:
|
||||||
if(_name.isNull())
|
if(_name.isNull())
|
||||||
_valid = false ;
|
_valid = false ;
|
||||||
|
|
||||||
if(_radix_group_data.isNull())
|
if(_radix_group_data.isNull())
|
||||||
_valid = false ;
|
_valid = false ;
|
||||||
|
|
||||||
if(_hash.isNull())
|
if(_hash.isNull())
|
||||||
_valid = false ;
|
_valid = false ;
|
||||||
break ;
|
break ;
|
||||||
|
|
||||||
case TYPE_PERSON:
|
case TYPE_PERSON:
|
||||||
if(_size != 0)
|
if(_size != 0)
|
||||||
@ -858,8 +858,8 @@ QString RetroShareLink::niceName() const
|
|||||||
if (type() == TYPE_PERSON)
|
if (type() == TYPE_PERSON)
|
||||||
return PeerDefs::rsid(name().toUtf8().constData(), RsPgpId(hash().toStdString()));
|
return PeerDefs::rsid(name().toUtf8().constData(), RsPgpId(hash().toStdString()));
|
||||||
|
|
||||||
if(type() == TYPE_IDENTITY)
|
if(type() == TYPE_IDENTITY)
|
||||||
return QObject::tr("Identity link (name=%1, ID=%2)").arg(_name).arg(_hash) ;
|
return QObject::tr("Identity link (name=%1, ID=%2)").arg(_name).arg(_hash) ;
|
||||||
|
|
||||||
if(type() == TYPE_PUBLIC_MSG) {
|
if(type() == TYPE_PUBLIC_MSG) {
|
||||||
RsPeerDetails detail;
|
RsPeerDetails detail;
|
||||||
|
@ -278,10 +278,10 @@ void CreateGxsForumMsg::loadFormInformation()
|
|||||||
uint32_t fl = IDCHOOSER_ID_REQUIRED ;
|
uint32_t fl = IDCHOOSER_ID_REQUIRED ;
|
||||||
|
|
||||||
if( (mForumMeta.mSignFlags & GXS_SERV::FLAG_AUTHOR_AUTHENTICATION_GPG) || (mForumMeta.mSignFlags & GXS_SERV::FLAG_AUTHOR_AUTHENTICATION_GPG_KNOWN))
|
if( (mForumMeta.mSignFlags & GXS_SERV::FLAG_AUTHOR_AUTHENTICATION_GPG) || (mForumMeta.mSignFlags & GXS_SERV::FLAG_AUTHOR_AUTHENTICATION_GPG_KNOWN))
|
||||||
fl |= IDCHOOSER_NON_ANONYMOUS ;
|
fl |= IDCHOOSER_NON_ANONYMOUS;
|
||||||
|
|
||||||
if(!mPosterId.isNull())
|
if(!mPosterId.isNull())
|
||||||
fl |= IDCHOOSER_NO_CREATE;
|
fl |= IDCHOOSER_NO_CREATE;
|
||||||
|
|
||||||
ui.idChooser->setFlags(fl) ;
|
ui.idChooser->setFlags(fl) ;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user