cleaned some compiler warnings

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3092 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2010-06-09 19:51:46 +00:00
parent ead1228535
commit c3b6da6386
8 changed files with 25 additions and 22 deletions

View File

@ -186,7 +186,6 @@ int FileIndexStore::RequestDirDetails(void *ref, DirDetails &details, uint32_t f
std::cerr << "FileIndexStore::RequestDirDetails() ref=" << ref << " flags: " << flags << std::endl; std::cerr << "FileIndexStore::RequestDirDetails() ref=" << ref << " flags: " << flags << std::endl;
#endif #endif
bool found = true;
std::map<RsPeerId, FileIndex *>::const_iterator pit; std::map<RsPeerId, FileIndex *>::const_iterator pit;
lockData(); lockData();
@ -307,7 +306,6 @@ int FileIndexStore::SearchKeywords(std::list<std::string> keywords, std::list<Di
std::list<FileEntry *> firesults; std::list<FileEntry *> firesults;
results.clear() ; results.clear() ;
time_t now = time(NULL);
#ifdef FIS_DEBUG #ifdef FIS_DEBUG
std::cerr << "FileIndexStore::SearchKeywords()" << std::endl; std::cerr << "FileIndexStore::SearchKeywords()" << std::endl;
@ -362,8 +360,6 @@ int FileIndexStore::searchBoolExp(Expression * exp, std::list<DirDetails> &resul
std::list<FileEntry *>::iterator rit; std::list<FileEntry *>::iterator rit;
std::list<FileEntry *> firesults; std::list<FileEntry *> firesults;
time_t now = time(NULL);
#ifdef FIS_DEBUG #ifdef FIS_DEBUG
std::cerr << "FileIndexStore::searchBoolExp()" << std::endl; std::cerr << "FileIndexStore::searchBoolExp()" << std::endl;
#endif #endif

View File

@ -46,7 +46,9 @@ static std::string setKeyPairParams(bool useRsa, unsigned int blen,
std::string name, std::string comment, std::string email, std::string name, std::string comment, std::string email,
std::string inPassphrase); std::string inPassphrase);
#ifdef UNUSED_CODE
static gpgme_key_t getKey(gpgme_ctx_t, std::string, std::string, std::string); static gpgme_key_t getKey(gpgme_ctx_t, std::string, std::string, std::string);
#endif
static gpg_error_t keySignCallback(void *, gpgme_status_code_t, \ static gpg_error_t keySignCallback(void *, gpgme_status_code_t, \
const char *, int); const char *, int);
@ -732,7 +734,10 @@ bool AuthGPG::DoOwnSignature_locked(const void *data, unsigned int datalen, void
return false; return false;
} }
gpgme_sign_result_t res = gpgme_op_sign_result(CTX); #ifdef GPG_DEBUG
gpgme_sign_result_t res =
#endif
gpgme_op_sign_result(CTX);
#ifdef GPG_DEBUG #ifdef GPG_DEBUG
if (res) if (res)

View File

@ -210,7 +210,7 @@ void RsInit::InitRsConfig()
#ifdef WINDOWS_SYS #ifdef WINDOWS_SYS
// test for portable version // test for portable version
if (GetFileAttributes ("gpg.exe") != -1 && GetFileAttributes ("gpgme-w32spawn.exe") != -1) { if (GetFileAttributes ("gpg.exe") != (DWORD) -1 && GetFileAttributes ("gpgme-w32spawn.exe") != (DWORD) -1) {
// use portable version // use portable version
RsInitConfig::portable = true; RsInitConfig::portable = true;
} }

View File

@ -60,7 +60,7 @@ virtual std::ostream& print(std::ostream &out, uint16_t indent = 0);
/* Not Serialised */ /* Not Serialised */
std::string msgId; /* Msg Id */ std::string msgId; /* Msg Id */
uint32_t childTS; /* timestamp of most recent child */ time_t childTS; /* timestamp of most recent child */
RsTlvKeySignature publishSignature; RsTlvKeySignature publishSignature;
RsTlvKeySignature personalSignature; RsTlvKeySignature personalSignature;
}; };

View File

@ -369,7 +369,7 @@ bool p3Blogs::locked_eventDuplicateMsg(GroupInfo *grp, RsDistribMsg *msg, std::s
} }
/* check age */ /* check age */
time_t age = time(NULL) - msg->timestamp; uint32_t age = time(NULL) - msg->timestamp;
if (age > DOWNLOAD_PERIOD) if (age > DOWNLOAD_PERIOD)
{ {

View File

@ -64,9 +64,6 @@ p3GroupDistrib::p3GroupDistrib(uint16_t subtype,
mMaxCacheSubId(1), mMaxCacheSubId(1),
mKeyBackUpDir(keyBackUpDir), BACKUP_KEY_FILE("key.log"), mLastKeyPublishTime(0) mKeyBackUpDir(keyBackUpDir), BACKUP_KEY_FILE("key.log"), mLastKeyPublishTime(0)
{ {
/* not much yet */
time_t now = time(NULL);
/* force publication of groups (cleared if local cache file found) */ /* force publication of groups (cleared if local cache file found) */
mGroupsRepublish = true; mGroupsRepublish = true;
@ -90,7 +87,7 @@ int p3GroupDistrib::tick()
{ {
RsStackMutex stack(distribMtx); /**** STACK LOCKED MUTEX ****/ RsStackMutex stack(distribMtx); /**** STACK LOCKED MUTEX ****/
toPublish = (mPendingPublish.size() > 0) && (now > mPubPeriod + mLastPublishTime); toPublish = (mPendingPublish.size() > 0) && (now > (time_t) (mPubPeriod + mLastPublishTime));
} }
@ -352,7 +349,7 @@ void p3GroupDistrib::loadFileMsgs(std::string filename, uint16_t cacheSubId, std
mMaxCacheSubId = cacheSubId; mMaxCacheSubId = cacheSubId;
} }
if ((ts < now) && (ts > mLastPublishTime)) if (((time_t) ts < now) && ((time_t) ts > mLastPublishTime))
{ {
#ifdef DISTRIB_DEBUG #ifdef DISTRIB_DEBUG
std::cerr << "p3GroupDistrib::loadFileMsgs() New LastPublishTime"; std::cerr << "p3GroupDistrib::loadFileMsgs() New LastPublishTime";
@ -1528,7 +1525,6 @@ std::string p3GroupDistrib::createGroup(std::wstring name, std::wstring desc, ui
std::cerr << std::endl; std::cerr << std::endl;
#endif #endif
/* Create a Group */ /* Create a Group */
GroupInfo grpInfo;
std::string grpId; std::string grpId;
time_t now = time(NULL); time_t now = time(NULL);
@ -1664,7 +1660,7 @@ std::string p3GroupDistrib::createGroup(std::wstring name, std::wstring desc, ui
unsigned int siglen = EVP_PKEY_size(key_admin); unsigned int siglen = EVP_PKEY_size(key_admin);
unsigned char sigbuf[siglen]; unsigned char sigbuf[siglen];
int ans = EVP_SignFinal(mdctx, sigbuf, &siglen, key_admin); EVP_SignFinal(mdctx, sigbuf, &siglen, key_admin);
/* save signature */ /* save signature */
newGrp->adminSignature.signData.setBinData(sigbuf, siglen); newGrp->adminSignature.signData.setBinData(sigbuf, siglen);
@ -2091,7 +2087,7 @@ std::string p3GroupDistrib::publishMsg(RsDistribMsg *msg, bool personalSign)
unsigned int siglen = EVP_PKEY_size(publishKey); unsigned int siglen = EVP_PKEY_size(publishKey);
unsigned char sigbuf[siglen]; unsigned char sigbuf[siglen];
int ans = EVP_SignFinal(mdctx, sigbuf, &siglen, publishKey); EVP_SignFinal(mdctx, sigbuf, &siglen, publishKey);
/* save signature */ /* save signature */
signedMsg->publishSignature.signData.setBinData(sigbuf, siglen); signedMsg->publishSignature.signData.setBinData(sigbuf, siglen);
@ -2370,7 +2366,7 @@ bool p3GroupDistrib::locked_editGroup(std::string grpId, GroupInfo& gi){
unsigned int siglen = EVP_PKEY_size(key_admin); unsigned int siglen = EVP_PKEY_size(key_admin);
unsigned char sigbuf[siglen]; unsigned char sigbuf[siglen];
int ans = EVP_SignFinal(mdctx, sigbuf, &siglen, key_admin); EVP_SignFinal(mdctx, sigbuf, &siglen, key_admin);
/* save signature */ /* save signature */
gi_curr->distribGroup->adminSignature.signData.setBinData(sigbuf, siglen); gi_curr->distribGroup->adminSignature.signData.setBinData(sigbuf, siglen);
@ -3009,11 +3005,10 @@ bool p3GroupDistrib::locked_checkDistribMsg(
/* check timestamp */ /* check timestamp */
time_t now = time(NULL); time_t now = time(NULL);
time_t min = now - mStorePeriod; uint32_t min = now - mStorePeriod;
time_t minPub = now - mStorePeriod / 2.0; uint32_t max = now + GROUP_MAX_FWD_OFFSET;
time_t max = now + GROUP_MAX_FWD_OFFSET;
if ((msg->timestamp < min) || (msg->timestamp > max)) if ((msg->timestamp < min) || (msg->timestamp > max))
{ {
#ifdef DISTRIB_DEBUG #ifdef DISTRIB_DEBUG
std::cerr << "p3GroupDistrib::locked_checkDistribMsg() TS out of range"; std::cerr << "p3GroupDistrib::locked_checkDistribMsg() TS out of range";

View File

@ -359,6 +359,7 @@ RsTurtleStringSearchRequestItem::RsTurtleStringSearchRequestItem(void *data,uint
ok &= getRawUInt16(data, pktsize, &offset, &depth); ok &= getRawUInt16(data, pktsize, &offset, &depth);
#ifdef WINDOWS_SYS // No Exceptions in Windows compile. (drbobs). #ifdef WINDOWS_SYS // No Exceptions in Windows compile. (drbobs).
UNREFERENCED_LOCAL_VARIABLE(rssize);
#else #else
if (offset != rssize) if (offset != rssize)
throw std::runtime_error("Size error while deserializing.") ; throw std::runtime_error("Size error while deserializing.") ;
@ -399,6 +400,7 @@ RsTurtleRegExpSearchRequestItem::RsTurtleRegExpSearchRequestItem(void *data,uint
for(uint32_t i=0;i<n;++i) ok &= GetTlvString(data, pktsize, &offset, TLV_TYPE_STR_VALUE, expr._strings[i]); for(uint32_t i=0;i<n;++i) ok &= GetTlvString(data, pktsize, &offset, TLV_TYPE_STR_VALUE, expr._strings[i]);
#ifdef WINDOWS_SYS // No Exceptions in Windows compile. (drbobs). #ifdef WINDOWS_SYS // No Exceptions in Windows compile. (drbobs).
UNREFERENCED_LOCAL_VARIABLE(rssize);
#else #else
if (offset != rssize) if (offset != rssize)
throw std::runtime_error("Size error while deserializing.") ; throw std::runtime_error("Size error while deserializing.") ;
@ -536,6 +538,7 @@ RsTurtleSearchResultItem::RsTurtleSearchResultItem(void *data,uint32_t pktsize)
} }
#ifdef WINDOWS_SYS // No Exceptions in Windows compile. (drbobs). #ifdef WINDOWS_SYS // No Exceptions in Windows compile. (drbobs).
UNREFERENCED_LOCAL_VARIABLE(rssize);
#else #else
if (offset != rssize) if (offset != rssize)
throw std::runtime_error("Size error while deserializing.") ; throw std::runtime_error("Size error while deserializing.") ;
@ -600,6 +603,7 @@ RsTurtleOpenTunnelItem::RsTurtleOpenTunnelItem(void *data,uint32_t pktsize)
#endif #endif
#ifdef WINDOWS_SYS // No Exceptions in Windows compile. (drbobs). #ifdef WINDOWS_SYS // No Exceptions in Windows compile. (drbobs).
UNREFERENCED_LOCAL_VARIABLE(rssize);
#else #else
if (offset != rssize) if (offset != rssize)
throw std::runtime_error("RsTurtleOpenTunnelItem::() error while deserializing.") ; throw std::runtime_error("RsTurtleOpenTunnelItem::() error while deserializing.") ;
@ -660,6 +664,7 @@ RsTurtleTunnelOkItem::RsTurtleTunnelOkItem(void *data,uint32_t pktsize)
#endif #endif
#ifdef WINDOWS_SYS // No Exceptions in Windows compile. (drbobs). #ifdef WINDOWS_SYS // No Exceptions in Windows compile. (drbobs).
UNREFERENCED_LOCAL_VARIABLE(rssize);
#else #else
if (offset != rssize) if (offset != rssize)
throw std::runtime_error("RsTurtleTunnelOkItem::() error while deserializing.") ; throw std::runtime_error("RsTurtleTunnelOkItem::() error while deserializing.") ;
@ -722,6 +727,7 @@ RsTurtleFileRequestItem::RsTurtleFileRequestItem(void *data,uint32_t pktsize)
#endif #endif
#ifdef WINDOWS_SYS // No Exceptions in Windows compile. (drbobs). #ifdef WINDOWS_SYS // No Exceptions in Windows compile. (drbobs).
UNREFERENCED_LOCAL_VARIABLE(rssize);
#else #else
if (offset != rssize) if (offset != rssize)
throw std::runtime_error("RsTurtleTunnelOkItem::() error while deserializing.") ; throw std::runtime_error("RsTurtleTunnelOkItem::() error while deserializing.") ;
@ -760,6 +766,7 @@ RsTurtleFileDataItem::RsTurtleFileDataItem(void *data,uint32_t pktsize)
#endif #endif
#ifdef WINDOWS_SYS // No Exceptions in Windows compile. (drbobs). #ifdef WINDOWS_SYS // No Exceptions in Windows compile. (drbobs).
UNREFERENCED_LOCAL_VARIABLE(rssize);
#else #else
if (offset != rssize) if (offset != rssize)
throw std::runtime_error("RsTurtleFileDataItem::() error while deserializing.") ; throw std::runtime_error("RsTurtleFileDataItem::() error while deserializing.") ;

View File

@ -117,7 +117,7 @@ int SetRedirectAndTest(struct UPNPUrls * urls,
char externalIPAddress[16]; char externalIPAddress[16];
char intClient[16]; char intClient[16];
char intPort[6]; char intPort[6];
char leaseDuration[] = "3600"; /* 60 mins */ // char leaseDuration[] = "3600"; /* 60 mins */
int r; int r;
int ok = 1; int ok = 1;