diff --git a/libretroshare/src/dbase/rsexpr.cc b/libretroshare/src/dbase/rsexpr.cc index 73110a644..d403b25f3 100644 --- a/libretroshare/src/dbase/rsexpr.cc +++ b/libretroshare/src/dbase/rsexpr.cc @@ -82,7 +82,7 @@ bool PathExpression::eval(FileEntry *file){ bool ExtExpression::eval(FileEntry *file){ std::string ext; /*Get the part of the string after the last instance of . in the filename */ - unsigned int index = file->name.find_last_of('.'); + size_t index = file->name.find_last_of('.'); if (index != std::string::npos) { ext = file->name.substr(index+1); if (ext != "" ){ diff --git a/libretroshare/src/ft/ftfileprovider.cc b/libretroshare/src/ft/ftfileprovider.cc index 38d2e1d09..923d1d968 100644 --- a/libretroshare/src/ft/ftfileprovider.cc +++ b/libretroshare/src/ft/ftfileprovider.cc @@ -13,7 +13,7 @@ static const time_t UPLOAD_CHUNK_MAPS_TIME = 30 ; // time to ask for a new chunkmap from uploaders in seconds. ftFileProvider::ftFileProvider(std::string path, uint64_t size, std::string -hash) : mSize(size), hash(hash), file_name(path), fd(NULL),transfer_rate(0),total_size(0),req_loc(0) +hash) : mSize(size), hash(hash), file_name(path), fd(NULL),req_loc(0),transfer_rate(0),total_size(0) { RsStackMutex stack(ftcMutex); /********** STACK LOCKED MTX ******/ clients_chunk_maps.clear(); diff --git a/libretroshare/src/pqi/authgpg.cc b/libretroshare/src/pqi/authgpg.cc index ad920911a..49c4ba24e 100644 --- a/libretroshare/src/pqi/authgpg.cc +++ b/libretroshare/src/pqi/authgpg.cc @@ -106,7 +106,7 @@ gpg_error_t pgp_pwd_callback(void *hook, const char *uid_hint, const char *passp } AuthGPG::AuthGPG() - :gpgmeInit(false),gpgmeKeySelected(false),p3Config(CONFIG_TYPE_AUTHGPG) + :p3Config(CONFIG_TYPE_AUTHGPG),gpgmeInit(false),gpgmeKeySelected(false) { { RsStackReadWriteMutex stack(pgpMtx, RsReadWriteMutex::WRITE_LOCK); /******* LOCKED ******/ diff --git a/libretroshare/src/pqi/authssl.cc b/libretroshare/src/pqi/authssl.cc index f3c4dc8d7..8b0bcecc4 100644 --- a/libretroshare/src/pqi/authssl.cc +++ b/libretroshare/src/pqi/authssl.cc @@ -403,7 +403,7 @@ X509 *SignX509Certificate(X509_NAME *issuer, EVP_PKEY *privkey, X509_REQ *req, l AuthSSL::AuthSSL() - :init(0), sslctx(NULL), own_private_key(NULL), own_public_key(NULL), p3Config(CONFIG_TYPE_AUTHSSL) + : p3Config(CONFIG_TYPE_AUTHSSL), init(0), sslctx(NULL), own_private_key(NULL), own_public_key(NULL) { } diff --git a/libretroshare/src/pqi/cleanupxpgp.cc b/libretroshare/src/pqi/cleanupxpgp.cc index 45e1a954c..71a0bbbd5 100644 --- a/libretroshare/src/pqi/cleanupxpgp.cc +++ b/libretroshare/src/pqi/cleanupxpgp.cc @@ -48,35 +48,35 @@ std::string cleanUpCertificate(std::string badCertificate) */ char * cleanCertificate=new char[badCertificate.length()+100]; //The entire certificate begin tag - char * beginCertTag="-----BEGIN"; + const char * beginCertTag="-----BEGIN"; //The entire certificate end tag - char * endCertTag="-----END"; + const char * endCertTag="-----END"; //Tag containing dots. The common part of both start and end tags - char * commonTag="-----"; + const char * commonTag="-----"; //Only BEGIN part of the begin tag - char * beginTag="BEGIN"; + const char * beginTag="BEGIN"; //Only END part of the end tag - char * endTag="END"; + const char * endTag="END"; //The start index of the ----- part of the certificate begin tag - int beginCertStartIdx1=0; + size_t beginCertStartIdx1=0; //The start index of the BEGIN part of the certificate begin tag - int beginCertStartIdx2=0; + size_t beginCertStartIdx2=0; //The start index of the end part(-----) of the certificate begin tag. The begin tag ends with -----. Example -----BEGIN XPGP CERTIFICATE----- - int beginCertEndIdx=0; + size_t beginCertEndIdx=0; //The start index of the ----- part of the certificate end tag - int endCertStartIdx1=0; + size_t endCertStartIdx1=0; //The start index of the END part of the certificate end tag - int endCertStartIdx2=0; + size_t endCertStartIdx2=0; //The start index of the end part(-----) of the certificate end tag. The begin tag ends with -----. Example -----BEGIN XPGP CERTIFICATE----- - int endCertEndIdx=0; + size_t endCertEndIdx=0; //The length of the bad certificate. - int lengthOfCert=badCertificate.length(); + size_t lengthOfCert=badCertificate.length(); //The current index value in the cleaned certificate. - int currCleanCertIdx=0; + size_t currCleanCertIdx=0; //The current index value in the bad certificate - int currBadCertIdx=0; + size_t currBadCertIdx=0; //Temporary index value - int tmpIdx=0; + size_t tmpIdx=0; //Boolean flag showing if the begin tag or the end tag has been found bool found=false; /* @@ -94,7 +94,7 @@ std::string cleanUpCertificate(std::string badCertificate) if(beginCertStartIdx2!=std::string::npos) { found=true; - for(int i=beginCertStartIdx1+strlen(commonTag);i::iterator it ; - int cnt = 0 ; + uint32_t cnt = 0 ; for(it = ipAddressList.begin(); it!=(ipAddressList.end()) ;) if(cnt >= PEER_IP_CONNECT_STATE_MAX_LIST_SIZE) { diff --git a/libretroshare/src/serialiser/rsbaseserial.cc b/libretroshare/src/serialiser/rsbaseserial.cc index 5a8abed1f..1218c325d 100644 --- a/libretroshare/src/serialiser/rsbaseserial.cc +++ b/libretroshare/src/serialiser/rsbaseserial.cc @@ -204,7 +204,7 @@ bool getRawString(void *data, uint32_t size, uint32_t *offset, std::string &outS return false; } uint8_t *buf = &(((uint8_t *) data)[*offset]); - for (int i = 0; i < len; i++) + for (uint32_t i = 0; i < len; i++) { outStr += buf[i]; }