diff --git a/libretroshare/src/gxs/rsdataservice.cc b/libretroshare/src/gxs/rsdataservice.cc index fbf8ad9a6..8486e95d0 100644 --- a/libretroshare/src/gxs/rsdataservice.cc +++ b/libretroshare/src/gxs/rsdataservice.cc @@ -1634,10 +1634,14 @@ bool RsDataService::locked_removeGroupEntries(const std::vector& g const RsGxsGroupId& grpId = *vit; mDb->sqlDelete(GRP_TABLE_NAME, KEY_GRP_ID+ "='" + grpId.toStdString() + "'", ""); + + // also remove the group meta from cache. + mGrpMetaDataCache.erase(*vit) ; } ret &= mDb->commitTransaction(); + mGrpMetaDataCache_ContainsAllDatabase = false ; return ret; } uint32_t RsDataService::cacheSize() const { diff --git a/libretroshare/src/gxs/rsgds.h b/libretroshare/src/gxs/rsgds.h index 0593610ce..c56b47c12 100644 --- a/libretroshare/src/gxs/rsgds.h +++ b/libretroshare/src/gxs/rsgds.h @@ -90,6 +90,8 @@ public: uint32_t mSuppliers ; uint32_t mMaxVisibleCount ; + bool mGrpAutoSync ; + bool mAllowMsgSync; }; typedef std::map > NxsMsgDataResult; diff --git a/libretroshare/src/gxs/rsgenexchange.cc b/libretroshare/src/gxs/rsgenexchange.cc index 2be82a401..7551d68c3 100644 --- a/libretroshare/src/gxs/rsgenexchange.cc +++ b/libretroshare/src/gxs/rsgenexchange.cc @@ -63,8 +63,8 @@ static const uint32_t INDEX_AUTHEN_ADMIN = 0x00000040; // admin key //#define GEN_EXCH_DEBUG 1 -#define MSG_CLEANUP_PERIOD 60*59 // 59 minutes -#define INTEGRITY_CHECK_PERIOD 60*31 // 31 minutes +static const uint32_t MSG_CLEANUP_PERIOD = 60*59; // 59 minutes +static const uint32_t INTEGRITY_CHECK_PERIOD = 60*31; // 31 minutes RsGenExchange::RsGenExchange(RsGeneralDataService *gds, RsNetworkExchangeService *ns, RsSerialType *serviceSerialiser, uint16_t servType, RsGixs* gixs, @@ -81,7 +81,7 @@ RsGenExchange::RsGenExchange(RsGeneralDataService *gds, RsNetworkExchangeService mLastClean((int)time(NULL) - (int)(RSRandom::random_u32() % MSG_CLEANUP_PERIOD)), // this helps unsynchronising the checks for the different services mMsgCleanUp(NULL), mChecking(false), - mLastCheck((int)time(NULL) - (int)(RSRandom::random_u32() % INTEGRITY_CHECK_PERIOD)), // this helps unsynchronising the checks for the different services + mLastCheck((int)time(NULL) - (int)(RSRandom::random_u32() % INTEGRITY_CHECK_PERIOD) + 120), // this helps unsynchronising the checks for the different services, with 2 min security to avoid checking right away before statistics come up. mIntegrityCheck(NULL), CREATE_FAIL(0), CREATE_SUCCESS(1), @@ -211,6 +211,11 @@ void RsGenExchange::tick() std::cerr << " " << *it << std::endl; #endif mNotifications.push_back(gc); + + // also notify the network exchange service that these groups no longer exist. + + if(mNetService) + mNetService->removeGroups(grpIds) ; } if (!msgIds.empty()) { @@ -1718,6 +1723,11 @@ uint32_t RsGenExchange::getSyncPeriod(const RsGxsGroupId& grpId) return RS_GXS_DEFAULT_MSG_REQ_PERIOD; } +bool RsGenExchange::getGroupNetworkStats(const RsGxsGroupId& grpId,RsGroupNetworkStats& stats) +{ + return (!mNetService) || mNetService->getGroupNetworkStats(grpId,stats) ; +} + void RsGenExchange::setSyncPeriod(const RsGxsGroupId& grpId,uint32_t age_in_secs) { if(mNetService != NULL) diff --git a/libretroshare/src/gxs/rsgenexchange.h b/libretroshare/src/gxs/rsgenexchange.h index 870082893..87b2344e8 100644 --- a/libretroshare/src/gxs/rsgenexchange.h +++ b/libretroshare/src/gxs/rsgenexchange.h @@ -646,6 +646,7 @@ public: virtual uint32_t getDefaultSyncPeriod(); virtual uint32_t getSyncPeriod(const RsGxsGroupId& grpId) ; virtual void setSyncPeriod(const RsGxsGroupId& grpId,uint32_t age_in_secs) ; + virtual bool getGroupNetworkStats(const RsGxsGroupId& grpId,RsGroupNetworkStats& stats); uint16_t serviceType() const { return mServType ; } uint32_t serviceFullType() const { return ((uint32_t)mServType << 8) + (((uint32_t) RS_PKT_VERSION_SERVICE) << 24); } diff --git a/libretroshare/src/gxs/rsgxsnetservice.cc b/libretroshare/src/gxs/rsgxsnetservice.cc index cade3b986..a41229a2f 100644 --- a/libretroshare/src/gxs/rsgxsnetservice.cc +++ b/libretroshare/src/gxs/rsgxsnetservice.cc @@ -2311,6 +2311,8 @@ bool RsGxsNetService::getGroupNetworkStats(const RsGxsGroupId& gid,RsGroupNetwor stats.mSuppliers = it->second.suppliers.ids.size(); stats.mMaxVisibleCount = it->second.max_visible_count ; + stats.mAllowMsgSync = mAllowMsgSync ; + stats.mGrpAutoSync = mGrpAutoSync ; return true ; } @@ -2971,9 +2973,8 @@ void RsGxsNetService::locked_genReqGrpTransaction(NxsTransaction* tr) GXSNETDEBUG_P_(tr->mTransaction->PeerId()) << "locked_genReqGrpTransaction(): " << std::endl; #endif - RsGxsMetaDataTemporaryMap grpMetaMap; - std::list grpItemL; + RsGxsMetaDataTemporaryMap grpMetaMap; for(std::list::iterator lit = tr->mItems.begin(); lit != tr->mItems.end(); ++lit) { @@ -2991,7 +2992,23 @@ void RsGxsNetService::locked_genReqGrpTransaction(NxsTransaction* tr) } if (grpItemL.empty()) - return; + { + // Normally the client grp updateTS is set after the transaction, but if no transaction is to happen, we have to set it here. + // Possible change: always do the update of the grpClientTS here. Needs to be tested... + + RsGxsGrpUpdate& item (mClientGrpUpdateMap[tr->mTransaction->PeerId()]); + +#ifdef NXS_NET_DEBUG_0 + GXSNETDEBUG_P_(tr->mTransaction->PeerId()) << " reqList is empty, updating anyway ClientGrpUpdate TS for peer " << tr->mTransaction->PeerId() << " to: " << tr->mTransaction->updateTS << std::endl; +#endif + + if(item.grpUpdateTS != tr->mTransaction->updateTS) + { + item.grpUpdateTS = tr->mTransaction->updateTS; + IndicateConfigChanged(); + } + return; + } mDataStore->retrieveGxsGrpMetaData(grpMetaMap); @@ -3036,16 +3053,23 @@ void RsGxsNetService::locked_genReqGrpTransaction(NxsTransaction* tr) if(!reqList.empty()) locked_pushGrpTransactionFromList(reqList, tr->mTransaction->PeerId(), transN); else - { - RsGxsGrpUpdate& item (mClientGrpUpdateMap[tr->mTransaction->PeerId()]); + { + // Normally the client grp updateTS is set after the transaction, but if no transaction is to happen, we have to set it here. + // Possible change: always do the update of the grpClientTS here. Needs to be tested... + + RsGxsGrpUpdate& item (mClientGrpUpdateMap[tr->mTransaction->PeerId()]); #ifdef NXS_NET_DEBUG_0 - GXSNETDEBUG_P_(tr->mTransaction->PeerId()) << " reqList is empty, updating anyway ClientGrpUpdate TS for peer " << tr->mTransaction->PeerId() << " to: " << tr->mTransaction->updateTS << std::endl; + GXSNETDEBUG_P_(tr->mTransaction->PeerId()) << " reqList is empty, updating anyway ClientGrpUpdate TS for peer " << tr->mTransaction->PeerId() << " to: " << tr->mTransaction->updateTS << std::endl; #endif - item.grpUpdateTS = tr->mTransaction->updateTS; - IndicateConfigChanged(); - } + if(item.grpUpdateTS != tr->mTransaction->updateTS) + { + item.grpUpdateTS = tr->mTransaction->updateTS; + IndicateConfigChanged(); + } + } + } void RsGxsNetService::locked_genSendGrpsTransaction(NxsTransaction* tr) @@ -4046,7 +4070,12 @@ void RsGxsNetService::handleRecvSyncMessage(RsNxsSyncMsgReqItem *item,bool item_ GXSNETDEBUG_PG(item->PeerId(),item->grpId) << "handleRecvSyncMsg(): Received last update TS of group " << item->grpId << ", for peer " << peer << ", TS = " << time(NULL) - item->updateTS << " secs ago." ; #endif - if(grp_is_known) + // We update suppliers in two cases: + // Case 1: the grp is known because it is the hash of an existing group, but it's not yet in the server config map + // Case 2: the gtp is not known, possibly because it was deleted, but there's an entry in mServerGrpConfigMap due to statistics gathering. Still, statistics are only + // gathered from known suppliers. So statistics never add new suppliers. These are only added here. + + if(grp_is_known || mServerGrpConfigMap.find(item->grpId)!=mServerGrpConfigMap.end()) { RsGxsGrpConfig & rec(mServerGrpConfigMap[item->grpId]) ; // this creates it if needed. When the grp is unknown (and hashed) this will would create a unused entry rec.suppliers.ids.insert(peer) ; @@ -4143,7 +4172,7 @@ void RsGxsNetService::handleRecvSyncMessage(RsNxsSyncMsgReqItem *item,bool item_ if(details.mReputation.mOverallReputationLevel < minReputationForForwardingMessages(grpMeta->mSignFlags, details.mFlags)) { #ifdef NXS_NET_DEBUG_0 - std::cerr << GXSNETDEBUG_PG(item->PeerId(),item->grpId) << " not sending item ID " << (*vit)->mMsgId << ", because the author is flags " << std::hex << details.mFlags << std::dec << " and reputation level " << details.mReputation.mOverallReputationLevel << std::endl; + GXSNETDEBUG_PG(item->PeerId(),item->grpId) << " not sending item ID " << (*vit)->mMsgId << ", because the author is flags " << std::hex << details.mFlags << std::dec << " and reputation level " << details.mReputation.mOverallReputationLevel << std::endl; #endif continue ; } @@ -4724,7 +4753,7 @@ void RsGxsNetService::handleRecvPublishKeys(RsNxsGroupPublishKeyItem *item) if(ret) { -#ifdef NXS_NET_DEBUG +#ifdef NXS_NET_DEBUG_3 GXSNETDEBUG_PG(item->PeerId(),item->grpId)<< " updated database with new publish keys." << std::endl; #endif mNewPublishKeysToNotify.insert(item->grpId) ; @@ -4751,6 +4780,44 @@ bool RsGxsNetService::getGroupServerUpdateTS(const RsGxsGroupId& gid,time_t& gro return true ; } +bool RsGxsNetService::removeGroups(const std::list& groups) +{ + RS_STACK_MUTEX(mNxsMutex) ; + +#ifdef NXS_NET_DEBUG_0 + GXSNETDEBUG___ << "Removing group information from deleted groups:" << std::endl; +#endif + + for(std::list::const_iterator git(groups.begin());git!=groups.end();++git) + { +#ifdef NXS_NET_DEBUG_0 + GXSNETDEBUG__G(*git) << " deleting info for group " << *git << std::endl; +#endif + + GrpConfigMap::iterator it = mServerGrpConfigMap.find(*git) ; + + if(it != mServerGrpConfigMap.end()) + { + it->second.suppliers.TlvClear(); // we dont erase the entry, because we want to keep the user-defined sync parameters. + it->second.max_visible_count = 0; + } + + mServerMsgUpdateMap.erase(*git) ; + + for(ClientMsgMap::iterator it(mClientMsgUpdateMap.begin());it!=mClientMsgUpdateMap.end();++it) + it->second.msgUpdateInfos.erase(*git) ; + + // This last step is very important: it makes RS re-sync all groups after deleting, with every new peer. If may happen indeed that groups + // are deleted because there's no suppliers since the actual supplier friend is offline for too long. In this case, the group needs + // to re-appear when the friend who is a subscriber comes online again. + + mClientGrpUpdateMap.clear(); + } + + IndicateConfigChanged(); + return true ; +} + bool RsGxsNetService::stampMsgServerUpdateTS(const RsGxsGroupId& gid) { RS_STACK_MUTEX(mNxsMutex) ; diff --git a/libretroshare/src/gxs/rsgxsnetservice.h b/libretroshare/src/gxs/rsgxsnetservice.h index 6aae36462..b14d55058 100644 --- a/libretroshare/src/gxs/rsgxsnetservice.h +++ b/libretroshare/src/gxs/rsgxsnetservice.h @@ -161,6 +161,7 @@ public: virtual bool getGroupServerUpdateTS(const RsGxsGroupId& gid,time_t& grp_server_update_TS,time_t& msg_server_update_TS) ; virtual bool stampMsgServerUpdateTS(const RsGxsGroupId& gid) ; + virtual bool removeGroups(const std::list& groups); /* p3Config methods */ public: diff --git a/libretroshare/src/gxs/rsgxsnetutils.cc b/libretroshare/src/gxs/rsgxsnetutils.cc index 1956f8964..4d54ce117 100644 --- a/libretroshare/src/gxs/rsgxsnetutils.cc +++ b/libretroshare/src/gxs/rsgxsnetutils.cc @@ -40,7 +40,7 @@ bool AuthorPending::expired() const return time(NULL) > (mTimeStamp + EXPIRY_PERIOD_OFFSET); } -bool AuthorPending::getAuthorRep(GixsReputation& rep, const RsGxsId& authorId, const RsPeerId& peerId) +bool AuthorPending::getAuthorRep(GixsReputation& rep, const RsGxsId& authorId, const RsPeerId& /*peerId*/) { rep.id = authorId ; rep.reputation_level = mRep->overallReputationLevel(authorId); @@ -96,7 +96,7 @@ bool MsgRespPending::accepted() GixsReputation rep; if(getAuthorRep(rep, entry.mAuthorId, mPeerId)) { - if(rep.reputation_level >= mCutOff) + if(rep.reputation_level >= (uint32_t)mCutOff) { entry.mPassedVetting = true; count++; @@ -131,7 +131,7 @@ bool GrpRespPending::accepted() if(getAuthorRep(rep, entry.mAuthorId, mPeerId)) { - if(rep.reputation_level >= mCutOff) + if(rep.reputation_level >= (uint32_t)mCutOff) { entry.mPassedVetting = true; count++; diff --git a/libretroshare/src/gxs/rsgxsutil.cc b/libretroshare/src/gxs/rsgxsutil.cc index aa5c5558a..2e9ce5204 100644 --- a/libretroshare/src/gxs/rsgxsutil.cc +++ b/libretroshare/src/gxs/rsgxsutil.cc @@ -188,20 +188,17 @@ bool RsGxsIntegrityCheck::check() grpsToDel.push_back(grp->grpId); } -#ifdef TODO - if(!(grp->metaData->mSubscribeFlags & GXS_SERV::GROUP_SUBSCRIBE_SUBSCRIBED)) + if(!(grp->metaData->mSubscribeFlags & GXS_SERV::GROUP_SUBSCRIBE_SUBSCRIBED) && !(grp->metaData->mSubscribeFlags & GXS_SERV::GROUP_SUBSCRIBE_ADMIN) && !(grp->metaData->mSubscribeFlags & GXS_SERV::GROUP_SUBSCRIBE_PUBLISH)) { RsGroupNetworkStats stats ; mGenExchangeClient->getGroupNetworkStats(grp->grpId,stats); - if(stats.mSuppliers == 0 && stats.mMaxVisibleCount == 0) + if(stats.mSuppliers == 0 && stats.mMaxVisibleCount == 0 && stats.mGrpAutoSync) { - GXSUTIL_DEBUG() << "Scheduling group \"" << grp->metaData->mGroupName << "\" ID=" << grp->grpId << " for deletion because it has no suppliers not any visible data at friends." << std::endl; -#warning Should we do that here? What happens for groups that are normally empty such as identities? + GXSUTIL_DEBUG() << "Scheduling group \"" << grp->metaData->mGroupName << "\" ID=" << grp->grpId << " in service " << std::hex << mGenExchangeClient->serviceType() << std::dec << " for deletion because it has no suppliers not any visible data at friends." << std::endl; grpsToDel.push_back(grp->grpId); } } -#endif delete grp; } diff --git a/libretroshare/src/gxs/rsnxs.h b/libretroshare/src/gxs/rsnxs.h index 9b879d2d0..ef86caa28 100644 --- a/libretroshare/src/gxs/rsnxs.h +++ b/libretroshare/src/gxs/rsnxs.h @@ -162,6 +162,14 @@ public: */ virtual bool stampMsgServerUpdateTS(const RsGxsGroupId& gid) =0; + /*! + * \brief removeGroups + * Removes time stamp information from the list of groups. This allows to re-sync them if suppliers are present. + * \param groups list of groups to remove from the update maps + * \return true if nothing bad happens. + */ + virtual bool removeGroups(const std::list& groups)=0; + /*! * \brief minReputationForForwardingMessages * Encodes the policy for sending/requesting messages depending on anti-spam settings. diff --git a/libretroshare/src/serialiser/rsgxsreputationitems.h b/libretroshare/src/serialiser/rsgxsreputationitems.h index c7321f74b..0fdc40ee2 100644 --- a/libretroshare/src/serialiser/rsgxsreputationitems.h +++ b/libretroshare/src/serialiser/rsgxsreputationitems.h @@ -91,9 +91,9 @@ public: virtual ~RsGxsReputationSetItem_deprecated3() {} virtual void clear() {} - std::ostream &print(std::ostream &out, uint16_t indent = 0) { return out;} + std::ostream &print(std::ostream &out, uint16_t /*indent*/ = 0) { return out;} - virtual bool serialise(void *data,uint32_t& size) const { return false ;} + virtual bool serialise(void */*data*/,uint32_t& /*size*/) const { return false ;} virtual uint32_t serial_size() const { return 0;} RsGxsId mGxsId; diff --git a/libretroshare/src/util/rssharedptr.h b/libretroshare/src/util/rssharedptr.h index 495c99e28..70213952e 100644 --- a/libretroshare/src/util/rssharedptr.h +++ b/libretroshare/src/util/rssharedptr.h @@ -18,7 +18,7 @@ class RsSharedPtr { public: - RsSharedPtr() : mShared(NULL), mCount(NULL) {} + RsSharedPtr() : mShared(NULL), mCount(NULL), mSharedPtrMutex(NULL){} RsSharedPtr(T* shared) : mShared(shared), mCount(new int(0)), mSharedPtrMutex(new RsMutex("SharedMutex")) @@ -96,8 +96,8 @@ private: private: - int* mCount; T* mShared; + int* mCount; RsMutex* mSharedPtrMutex; }; diff --git a/plugins/VOIP/gui/VOIPToasterItem.cpp b/plugins/VOIP/gui/VOIPToasterItem.cpp index 54659caac..f1791a9c6 100644 --- a/plugins/VOIP/gui/VOIPToasterItem.cpp +++ b/plugins/VOIP/gui/VOIPToasterItem.cpp @@ -55,7 +55,9 @@ VOIPToasterItem::VOIPToasterItem(const RsPeerId &peer_id, const QString &msg, co connect(closeButton, SIGNAL(clicked()), SLOT(hide())); /* set informations */ - textLabel->setText(RsHtml().formatText(NULL, msg, RSHTML_FORMATTEXT_EMBED_SMILEYS | RSHTML_FORMATTEXT_EMBED_LINKS | RSHTML_FORMATTEXT_CLEANSTYLE)); + // emoticons disabled because of crazy cost + //textLabel->setText(RsHtml().formatText(NULL, msg, RSHTML_FORMATTEXT_EMBED_SMILEYS | RSHTML_FORMATTEXT_EMBED_LINKS | RSHTML_FORMATTEXT_CLEANSTYLE)); + textLabel->setText(RsHtml().formatText(NULL, msg, RSHTML_FORMATTEXT_EMBED_LINKS | RSHTML_FORMATTEXT_CLEANSTYLE)); //toasterLabel->setText(QString::fromUtf8(rsPeers->getPeerName(mPeerId).c_str())); avatarWidget->setFrameType(AvatarWidget::STATUS_FRAME); avatarWidget->setId(ChatId(mPeerId)); diff --git a/retroshare-gui/src/gui/feeds/MsgItem.cpp b/retroshare-gui/src/gui/feeds/MsgItem.cpp index cacd739dd..c56173e59 100644 --- a/retroshare-gui/src/gui/feeds/MsgItem.cpp +++ b/retroshare-gui/src/gui/feeds/MsgItem.cpp @@ -177,7 +177,9 @@ void MsgItem::updateItemStatic() void MsgItem::fillExpandFrame() { - msgLabel->setText(RsHtml().formatText(NULL, mMsg, RSHTML_FORMATTEXT_EMBED_SMILEYS | RSHTML_FORMATTEXT_EMBED_LINKS)); + // emoticons disabled because of crazy cost. + //msgLabel->setText(RsHtml().formatText(NULL, mMsg, RSHTML_FORMATTEXT_EMBED_SMILEYS | RSHTML_FORMATTEXT_EMBED_LINKS)); + msgLabel->setText(RsHtml().formatText(NULL, mMsg, RSHTML_FORMATTEXT_EMBED_LINKS)); } void MsgItem::updateItem() diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp index c20598294..dff2f5546 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp @@ -1389,10 +1389,10 @@ void GxsForumThreadWidget::fillThreads(QList &threadList, boo ++index; } - // (csoler) QTreeWidget::findItems apparently does not always work so I need to make the search manually, which I do using a map for efficiency reasons. - std::map oldThreadMap ; - for(uint32_t i=0;ithreadTreeWidget->topLevelItemCount();++i) - oldThreadMap[ui->threadTreeWidget->topLevelItem(i)->data(COLUMN_THREAD_MSGID,Qt::DisplayRole).toString()] = ui->threadTreeWidget->topLevelItem(i) ; + //(csoler) QTreeWidget::findItems apparently does not always work so I need to make the search manually, which I do using a map for efficiency reasons. + std::map oldThreadMap; + for(int i=0; ithreadTreeWidget->topLevelItemCount(); ++i) + oldThreadMap[ui->threadTreeWidget->topLevelItem(i)->data(COLUMN_THREAD_MSGID, Qt::DisplayRole).toString()] = ui->threadTreeWidget->topLevelItem(i); // iterate all new threads for (QList::iterator newThread = threadList.begin (); newThread != threadList.end (); ++newThread) { diff --git a/retroshare-gui/src/gui/msgs/MessageWidget.cpp b/retroshare-gui/src/gui/msgs/MessageWidget.cpp index cbffc00dd..bf1cafee3 100644 --- a/retroshare-gui/src/gui/msgs/MessageWidget.cpp +++ b/retroshare-gui/src/gui/msgs/MessageWidget.cpp @@ -571,7 +571,9 @@ void MessageWidget::fill(const std::string &msgId) ui.subjectText->setText(QString::fromUtf8(msgInfo.title.c_str())); - text = RsHtmlMsg(msgInfo.msgflags).formatText(ui.msgText->document(), QString::fromUtf8(msgInfo.msg.c_str()), RSHTML_FORMATTEXT_EMBED_SMILEYS | RSHTML_FORMATTEXT_EMBED_LINKS); + // emoticons disabled because of crazy cost. + //text = RsHtmlMsg(msgInfo.msgflags).formatText(ui.msgText->document(), QString::fromUtf8(msgInfo.msg.c_str()), RSHTML_FORMATTEXT_EMBED_SMILEYS | RSHTML_FORMATTEXT_EMBED_LINKS); + text = RsHtmlMsg(msgInfo.msgflags).formatText(ui.msgText->document(), QString::fromUtf8(msgInfo.msg.c_str()), RSHTML_FORMATTEXT_EMBED_LINKS); ui.msgText->resetImagesStatus(Settings->getMsgLoadEmbeddedImages() || (msgInfo.msgflags & RS_MSG_LOAD_EMBEDDED_IMAGES)); ui.msgText->setHtml(text); diff --git a/retroshare.pri b/retroshare.pri index d0c78198d..498131aea 100644 --- a/retroshare.pri +++ b/retroshare.pri @@ -55,6 +55,10 @@ no_rs_gxs:CONFIG -= rs_gxs CONFIG *= no_rs_nodeprecatedwarning rs_nodeprecatedwarning:CONFIG -= no_rs_nodeprecatedwarning +# To disable Cpp #Warning append the following +# assignation to qmake command line "CONFIG+=rs_nocppwarning" +CONFIG *= no_rs_nocppwarning +rs_nocppwarning:CONFIG -= no_rs_nocppwarning unix { isEmpty(PREFIX) { PREFIX = "/usr" } @@ -166,4 +170,10 @@ rs_nodeprecatedwarning { warning("QMAKE: You have disable deprecated warnings.") } +rs_nocppwarning { + QMAKE_CXXFLAGS += -Wno-cpp + DEFINES *= RS_NO_WARN_CPP + warning("QMAKE: You have disable cpp warnings.") +} + rs_gxs_mail:DEFINES *= RS_GXS_MAIL diff --git a/tests/librssimulator/testing/SetServiceTester.cc b/tests/librssimulator/testing/SetServiceTester.cc index 574399a76..3983b3a5b 100644 --- a/tests/librssimulator/testing/SetServiceTester.cc +++ b/tests/librssimulator/testing/SetServiceTester.cc @@ -97,7 +97,7 @@ SetPacket &SetServiceTester::examinePacket(uint32_t idx) return mPackets[idx]; } -bool SetServiceTester::injectPacket(const SetPacket &pkt) +bool SetServiceTester::injectPacket(const SetPacket &/*pkt*/) { std::cerr << "SetServiceTester::injectPacket() Incomplete"; std::cerr << std::endl; diff --git a/tests/unittests/libretroshare/gxs/data_service/rsdataservice_test.cc b/tests/unittests/libretroshare/gxs/data_service/rsdataservice_test.cc index 96404dfab..6cf0abeef 100644 --- a/tests/unittests/libretroshare/gxs/data_service/rsdataservice_test.cc +++ b/tests/unittests/libretroshare/gxs/data_service/rsdataservice_test.cc @@ -124,7 +124,7 @@ void test_groupStoreAndRetrieve(){ grpMetaR.clear(); - EXPECT_TRUE(grpMatch); + EXPECT_TRUE(grpMatch && grpMetaMatch); tearDown(); } @@ -225,12 +225,12 @@ void test_messageStoresAndRetrieve() std::vector& result0 = msgResult[grpId0]; std::vector& result1 = msgResult[grpId1]; std::vector& resultMeta0 = msgMetaResult[grpId0]; - std::vector& resultMeta1 = msgMetaResult[grpId1]; + //std::vector& resultMeta1 = msgMetaResult[grpId1]; bool msgGrpId0_Match = true, msgGrpId1_Match = true; - bool msgMetaGrpId0_Match = true, msgMetaGrpId1_Match = true; + bool msgMetaGrpId0_Match = true/*, msgMetaGrpId1_Match = true*/; // MSG test, selective retrieval for(std::vector::size_type i = 0; i < result0.size(); i++) diff --git a/tests/unittests/libretroshare/gxs/gen_exchange/genexchangetester.cc b/tests/unittests/libretroshare/gxs/gen_exchange/genexchangetester.cc index cf79d3761..6fd3bfda2 100644 --- a/tests/unittests/libretroshare/gxs/gen_exchange/genexchangetester.cc +++ b/tests/unittests/libretroshare/gxs/gen_exchange/genexchangetester.cc @@ -334,7 +334,8 @@ void GenExchangeTest::init(RsGroupMetaData& grpMetaData) const randString(SHORT_STR, grpMetaData.mServiceString); - grpMetaData.mGroupFlags = randNum(); + grpMetaData.mGroupFlags = randNum() & (0x00000007);//See GXS_SERV::FLAG_PRIVACY_XXX values /libretroshare/src/retroshare/rsgxsflags.h:21 + if (grpMetaData.mGroupFlags == 0) grpMetaData.mGroupFlags = GXS_SERV::FLAG_PRIVACY_PRIVATE; grpMetaData.mLastPost = randNum(); grpMetaData.mGroupStatus = randNum(); grpMetaData.mVisibleMsgCount = randNum(); @@ -595,7 +596,7 @@ bool operator ==(const RsDummyMsg& lMsg, const RsDummyMsg& rMsg) return true; } -bool operator ==(const RsGxsGrpItem& lGrp, const RsGxsGrpItem& rGrp) +bool operator ==(const RsGxsGrpItem& /*lGrp*/, const RsGxsGrpItem& /*rGrp*/) { return false; } diff --git a/tests/unittests/libretroshare/gxs/gen_exchange/genexchangetestservice.cc b/tests/unittests/libretroshare/gxs/gen_exchange/genexchangetestservice.cc index daccb7bde..d6c8134a9 100644 --- a/tests/unittests/libretroshare/gxs/gen_exchange/genexchangetestservice.cc +++ b/tests/unittests/libretroshare/gxs/gen_exchange/genexchangetestservice.cc @@ -13,7 +13,7 @@ RsServiceInfo GenExchangeTestService::getServiceInfo() return info; } -void GenExchangeTestService::notifyChanges(std::vector &changes) +void GenExchangeTestService::notifyChanges(std::vector &/*changes*/) { return; } @@ -23,7 +23,7 @@ void GenExchangeTestService::publishDummyGrp(uint32_t &token, RsDummyGrp *grp) publishGroup(token, grp); } -void GenExchangeTestService::updateDummyGrp(uint32_t &token, RsGxsGroupUpdateMeta &updateMeta, RsDummyGrp *group) +void GenExchangeTestService::updateDummyGrp(uint32_t &token, RsGxsGroupUpdateMeta &/*updateMeta*/, RsDummyGrp *group) { //updateGroup(token, updateMeta, group); updateGroup(token, group); diff --git a/tests/unittests/libretroshare/gxs/gen_exchange/rsdummyservices.h b/tests/unittests/libretroshare/gxs/gen_exchange/rsdummyservices.h index 3bb951410..0bb040aba 100644 --- a/tests/unittests/libretroshare/gxs/gen_exchange/rsdummyservices.h +++ b/tests/unittests/libretroshare/gxs/gen_exchange/rsdummyservices.h @@ -15,18 +15,18 @@ public: RsDummyNetService(){ return;} virtual ~RsDummyNetService() { } - void setSyncAge(const RsGxsGroupId& id,uint32_t age_in_secs){} - void setKeepAge(const RsGxsGroupId& id,uint32_t age_in_secs){} + void setSyncAge(const RsGxsGroupId& /*id*/,uint32_t /*age_in_secs*/){} + void setKeepAge(const RsGxsGroupId& /*id*/,uint32_t /*age_in_secs*/){} - void requestGroupsOfPeer(const std::string& peerId){} + void requestGroupsOfPeer(const std::string& /*peerId*/){} - void requestMessagesOfPeer(const std::string& peerId, const std::string& grpId){} + void requestMessagesOfPeer(const std::string& /*peerId*/, const std::string& /*grpId*/){} - void pauseSynchronisation(bool enabled) {} + void pauseSynchronisation(bool /*enabled*/) {} - int requestMsg(const std::string& msgId, uint8_t hops){ return 0;} + int requestMsg(const std::string& /*msgId*/, uint8_t /*hops*/){ return 0;} - int requestGrp(const std::list& grpId, uint8_t hops) { return 0;} + int requestGrp(const std::list& /*grpId*/, uint8_t /*hops*/) { return 0;} }; @@ -44,7 +44,7 @@ public: std::string msgData; - std::ostream &print(std::ostream &out, uint16_t indent = 0){ return out; } + std::ostream &print(std::ostream &out, uint16_t /*indent*/ = 0){ return out; } void clear() { msgData.clear(); } }; @@ -59,7 +59,7 @@ public: std::string grpData; void clear() { grpData.clear(); } - std::ostream &print(std::ostream &out, uint16_t indent = 0){ return out; } + std::ostream &print(std::ostream &out, uint16_t /*indent*/ = 0){ return out; } }; @@ -108,7 +108,7 @@ public: * @param * @param dummyId This is is the only id thats exists in this dummy interface */ - RsGixsDummy(const RsGxsId& incomingId, const RsGxsId& outgoingId){} + RsGixsDummy(const RsGxsId& /*incomingId*/, const RsGxsId& /*outgoingId*/){} virtual ~RsGixsDummy(){} @@ -130,14 +130,14 @@ public: * @param keyref the keyref of key that is being checked for * @return true if available, false otherwise */ - bool haveKey(const RsGxsId &id){ return false;} + bool haveKey(const RsGxsId &/*id*/){ return false;} /*! * Use to query whether private key member of the given key reference is available * @param keyref the KeyRef of the key being checked for * @return true if private key is held here, false otherwise */ - bool havePrivateKey(const RsGxsId &id){ return false; } + bool havePrivateKey(const RsGxsId &/*id*/){ return false; } // The fetchKey has an optional peerList.. this is people that had the msg with the signature. // These same people should have the identity - so we ask them first. @@ -146,8 +146,8 @@ public: * @param keyref the KeyRef of the key being requested * @return will */ - bool requestKey(const RsGxsId &id, const std::list &peers){ return false ;} - bool requestPrivateKey(const RsGxsId &id){ return false;} + bool requestKey(const RsGxsId &/*id*/, const std::list &/*peers*/){ return false ;} + bool requestPrivateKey(const RsGxsId &/*id*/){ return false;} /*! @@ -156,8 +156,8 @@ public: * @return a pointer to a valid profile if successful, otherwise NULL * */ - bool getKey(const RsGxsId &id, RsTlvPublicRSAKey& key){ return false; } - bool getPrivateKey(const RsGxsId &id, RsTlvPrivateRSAKey& key){ return false; } // For signing outgoing messages. + bool getKey(const RsGxsId &/*id*/, RsTlvPublicRSAKey& /*key*/){ return false; } + bool getPrivateKey(const RsGxsId &/*id*/, RsTlvPrivateRSAKey& /*key*/){ return false; } // For signing outgoing messages. private: diff --git a/tests/unittests/libretroshare/gxs/nxs_test/nxsdummyservices.cc b/tests/unittests/libretroshare/gxs/nxs_test/nxsdummyservices.cc index 216188145..d92e48936 100644 --- a/tests/unittests/libretroshare/gxs/nxs_test/nxsdummyservices.cc +++ b/tests/unittests/libretroshare/gxs/nxs_test/nxsdummyservices.cc @@ -14,53 +14,54 @@ rs_nxs_test::RsNxsSimpleDummyCircles::RsNxsSimpleDummyCircles() { } bool rs_nxs_test::RsNxsSimpleDummyCircles::isLoaded( - const RsGxsCircleId& circleId) { + const RsGxsCircleId& /*circleId*/) { return true; } bool rs_nxs_test::RsNxsSimpleDummyCircles::loadCircle( - const RsGxsCircleId& circleId) { + const RsGxsCircleId& /*circleId*/) { return true; } -int rs_nxs_test::RsNxsSimpleDummyCircles::canSend(const RsGxsCircleId& circleId, - const RsPgpId& id, bool &should_encrypt) { +int rs_nxs_test::RsNxsSimpleDummyCircles::canSend(const RsGxsCircleId& /*circleId*/, + const RsPgpId& /*id*/, bool &/*should_encrypt*/) { return true; } int rs_nxs_test::RsNxsSimpleDummyCircles::canReceive( - const RsGxsCircleId& circleId, const RsPgpId& id) { + const RsGxsCircleId& /*circleId*/, const RsPgpId& /*id*/) { return true; } -bool rs_nxs_test::RsNxsSimpleDummyCircles::isRecipient(const RsGxsCircleId &circleId, const RsGxsGroupId &destination_group, const RsGxsId& id) +bool rs_nxs_test::RsNxsSimpleDummyCircles::isRecipient(const RsGxsCircleId &/*circleId*/, const RsGxsGroupId &/*destination_group*/, const RsGxsId& /*id*/) { return true ; } bool rs_nxs_test::RsNxsSimpleDummyCircles::recipients( - const RsGxsCircleId& circleId, std::list& friendlist) { + const RsGxsCircleId& /*circleId*/, std::list& /*friendlist*/) { return true; } -bool rs_nxs_test::RsNxsSimpleDummyCircles::recipients(const RsGxsCircleId& circleId, const RsGxsGroupId &destination_group, std::list& friendlist) { +bool rs_nxs_test::RsNxsSimpleDummyCircles::recipients(const RsGxsCircleId& /*circleId*/, const RsGxsGroupId &/*destination_group*/, std::list& /*friendlist*/) { return true; } + rs_nxs_test::RsNxsSimpleDummyReputation::RsNxsSimpleDummyReputation( - RepMap& repMap, bool cached) { + RepMap& /*repMap*/, bool /*cached*/) { } bool rs_nxs_test::RsNxsSimpleDummyReputation::haveReputation( - const RsGxsId& id) { + const RsGxsId& /*id*/) { return true; } -bool rs_nxs_test::RsNxsSimpleDummyReputation::loadReputation(const RsGxsId& id, - const std::list& peers) { +bool rs_nxs_test::RsNxsSimpleDummyReputation::loadReputation(const RsGxsId& /*id*/, + const std::list& /*peers*/) { return true; } -bool rs_nxs_test::RsNxsSimpleDummyReputation::getReputation(const RsGxsId& id, +bool rs_nxs_test::RsNxsSimpleDummyReputation::getReputation(const RsGxsId& /*id*/, GixsReputation& rep) { rep.reputation_level = 5; return true; @@ -84,17 +85,17 @@ bool rs_nxs_test::RsNxsDelayedDummyCircles::loadCircle( return allowed(circleId); } -int rs_nxs_test::RsNxsDelayedDummyCircles::canSend(const RsGxsCircleId& circleId, const RsPgpId& id, bool &should_encrypt) { +int rs_nxs_test::RsNxsDelayedDummyCircles::canSend(const RsGxsCircleId& circleId, const RsPgpId& /*id*/, bool &/*should_encrypt*/) { return allowed(circleId); } int rs_nxs_test::RsNxsDelayedDummyCircles::canReceive( - const RsGxsCircleId& circleId, const RsPgpId& id) { + const RsGxsCircleId& circleId, const RsPgpId& /*id*/) { return allowed(circleId); } bool rs_nxs_test::RsNxsDelayedDummyCircles::recipients( - const RsGxsCircleId& circleId, std::list& friendlist) { + const RsGxsCircleId& circleId, std::list& /*friendlist*/) { return allowed(circleId); } diff --git a/tests/unittests/libretroshare/gxs/nxs_test/nxsdummyservices.h b/tests/unittests/libretroshare/gxs/nxs_test/nxsdummyservices.h index 2a7f3aeff..9f42c4bbc 100644 --- a/tests/unittests/libretroshare/gxs/nxs_test/nxsdummyservices.h +++ b/tests/unittests/libretroshare/gxs/nxs_test/nxsdummyservices.h @@ -44,7 +44,7 @@ namespace rs_nxs_test virtual bool recipients(const RsGxsCircleId &circleId, std::list &friendlist); virtual bool recipients(const RsGxsCircleId &circleId, const RsGxsGroupId& destination_group, std::list& idlist) ; virtual bool isRecipient(const RsGxsCircleId &circleId, const RsGxsGroupId& destination_group, const RsGxsId& id) ; - virtual bool getLocalCircleServerUpdateTS(const RsGxsCircleId& gid,time_t& grp_server_update_TS,time_t& msg_server_update_TS) { return true ; } + virtual bool getLocalCircleServerUpdateTS(const RsGxsCircleId& /*gid*/,time_t& /*grp_server_update_TS*/,time_t& /*msg_server_update_TS*/) { return true ; } }; /*! @@ -71,9 +71,9 @@ namespace rs_nxs_test int canSend(const RsGxsCircleId &circleId, const RsPgpId &id,bool& should_encrypt); int canReceive(const RsGxsCircleId &circleId, const RsPgpId &id); virtual bool recipients(const RsGxsCircleId &circleId, std::list &friendlist); - virtual bool recipients(const RsGxsCircleId &circleId, const RsGxsGroupId& destination_group, std::list& idlist) { return true ;} - virtual bool isRecipient(const RsGxsCircleId &circleId, const RsGxsGroupId& destination_group, const RsGxsId& id) { return allowed(circleId) ; } - virtual bool getLocalCircleServerUpdateTS(const RsGxsCircleId& gid,time_t& grp_server_update_TS,time_t& msg_server_update_TS) { return true ; } + virtual bool recipients(const RsGxsCircleId &/*circleId*/, const RsGxsGroupId& /*destination_group*/, std::list& /*idlist*/) { return true ;} + virtual bool isRecipient(const RsGxsCircleId &circleId, const RsGxsGroupId& /*destination_group*/, const RsGxsId& /*id*/) { return allowed(circleId) ; } + virtual bool getLocalCircleServerUpdateTS(const RsGxsCircleId& /*gid*/,time_t& /*grp_server_update_TS*/,time_t& /*msg_server_update_TS*/) { return true ; } private: bool allowed(const RsGxsCircleId& circleId); @@ -130,7 +130,7 @@ namespace rs_nxs_test } const RsPeerId& getOwnId() { return mOwnId; } - void getOnlineList(const uint32_t serviceId, std::set& ssl_peers) + void getOnlineList(const uint32_t /*serviceId*/, std::set& ssl_peers) { RsPeerId::std_list::iterator lit = mPeers.begin(); diff --git a/tests/unittests/libretroshare/gxs/nxs_test/nxsgrpsync_test.cc b/tests/unittests/libretroshare/gxs/nxs_test/nxsgrpsync_test.cc index b7806d466..769eb4495 100644 --- a/tests/unittests/libretroshare/gxs/nxs_test/nxsgrpsync_test.cc +++ b/tests/unittests/libretroshare/gxs/nxs_test/nxsgrpsync_test.cc @@ -114,12 +114,12 @@ RsNxsNetMgr* NxsGrpSync::getDummyNetManager(const RsPeerId& peerId) return mNxsNetMgrs[peerId]; } -RsGcxs* NxsGrpSync::getDummyCircles(const RsPeerId& peerId) +RsGcxs* NxsGrpSync::getDummyCircles(const RsPeerId& /*peerId*/) { return mCircles; } -RsGixsReputation* NxsGrpSync::getDummyReputations(const RsPeerId& peerId) +RsGixsReputation* NxsGrpSync::getDummyReputations(const RsPeerId& /*peerId*/) { return mRep; } diff --git a/tests/unittests/libretroshare/gxs/nxs_test/nxsmsgsync_test.cc b/tests/unittests/libretroshare/gxs/nxs_test/nxsmsgsync_test.cc index 0d036c038..f0b0e4dec 100644 --- a/tests/unittests/libretroshare/gxs/nxs_test/nxsmsgsync_test.cc +++ b/tests/unittests/libretroshare/gxs/nxs_test/nxsmsgsync_test.cc @@ -129,12 +129,12 @@ RsNxsNetMgr* rs_nxs_test::NxsMsgSync::getDummyNetManager( return mNxsNetMgrs[peerId]; } -RsGcxs* rs_nxs_test::NxsMsgSync::getDummyCircles(const RsPeerId& peerId) { +RsGcxs* rs_nxs_test::NxsMsgSync::getDummyCircles(const RsPeerId& /*peerId*/) { return mCircles; } RsGixsReputation* rs_nxs_test::NxsMsgSync::getDummyReputations( - const RsPeerId& peerId) { + const RsPeerId& /*peerId*/) { return mRep; } diff --git a/tests/unittests/libretroshare/gxs/nxs_test/nxstesthub.cc b/tests/unittests/libretroshare/gxs/nxs_test/nxstesthub.cc index 1e46f17d6..216f971c1 100644 --- a/tests/unittests/libretroshare/gxs/nxs_test/nxstesthub.cc +++ b/tests/unittests/libretroshare/gxs/nxs_test/nxstesthub.cc @@ -149,7 +149,7 @@ void rs_nxs_test::NxsTestHub::notifyNewMessages(const RsPeerId& pid, meta->mChildTs = 0; meta->recvTS = 0; meta->validated = false; - bool ok = meta->deserialise(msg->meta.bin_data, &(msg->meta.bin_len)); + meta->deserialise(msg->meta.bin_data, &(msg->meta.bin_len)); toStore.insert(std::make_pair(msg, meta)); } @@ -168,7 +168,7 @@ void rs_nxs_test::NxsTestHub::notifyNewGroups(const RsPeerId& pid, std::vectordeserialise(grp->meta.bin_data, grp->meta.bin_len); + meta->deserialise(grp->meta.bin_data, grp->meta.bin_len); toStore.insert(std::make_pair(grp, meta)); } diff --git a/tests/unittests/libretroshare/gxs/nxs_test/nxstesthub.h b/tests/unittests/libretroshare/gxs/nxs_test/nxstesthub.h index f5eeac5f0..a37ff78e3 100644 --- a/tests/unittests/libretroshare/gxs/nxs_test/nxstesthub.h +++ b/tests/unittests/libretroshare/gxs/nxs_test/nxstesthub.h @@ -103,9 +103,9 @@ namespace rs_nxs_test typedef std::map PeerNxsMap ; - RsMutex mMtx; - PeerNxsMap mPeerNxsMap; NxsTestScenario::pointer mTestScenario; + RsMutex mMtx; + PeerNxsMap mPeerNxsMap; std::queue mPayLoad; }; diff --git a/tests/unittests/libretroshare/gxs/security/gxssecurity_test.cc b/tests/unittests/libretroshare/gxs/security/gxssecurity_test.cc index 416979ec0..ac293f566 100644 --- a/tests/unittests/libretroshare/gxs/security/gxssecurity_test.cc +++ b/tests/unittests/libretroshare/gxs/security/gxssecurity_test.cc @@ -40,11 +40,11 @@ TEST(libretroshare_gxs, GxsSecurity) EXPECT_TRUE(GxsSecurity::generateKeyPair(pub_key,priv_key)) ; -#ifdef WIN32 - srand(getpid()) ; -#else +#ifdef WIN32 + srand(getpid()) ; +#else srand48(getpid()) ; -#endif +#endif EXPECT_TRUE( pub_key.keyId == priv_key.keyId ); EXPECT_TRUE( pub_key.startTS == priv_key.startTS ); @@ -93,7 +93,7 @@ TEST(libretroshare_gxs, GxsSecurity) // Check that decrypted data is equal to original data. // - EXPECT_TRUE((int)data_len == outlen2) ; + EXPECT_TRUE(data_len == outlen2) ; EXPECT_TRUE(!memcmp(data,out2,outlen2)) ; } diff --git a/tests/unittests/libretroshare/serialiser/rstlvutil.cc b/tests/unittests/libretroshare/serialiser/rstlvutil.cc index 6613ed9b3..4ca2ab0e4 100644 --- a/tests/unittests/libretroshare/serialiser/rstlvutil.cc +++ b/tests/unittests/libretroshare/serialiser/rstlvutil.cc @@ -112,18 +112,18 @@ bool test_StepThroughTlvStack(std::ostream &str, void *data, int size) { uint32_t offset = 0; uint32_t index = 0; - while (offset + 4 <= size) + while (offset + 4 <= (uint32_t)size) { - uint16_t tlvtype = GetTlvType( &(((uint8_t *) data)[offset]) ); - uint16_t tlvsize = GetTlvSize( &(((uint8_t *) data)[offset]) ); + uint16_t tlvtype = GetTlvType( &(((uint8_t *) data)[offset]) ); + uint16_t tlvsize = GetTlvSize( &(((uint8_t *) data)[offset]) ); str << "Tlv Entry[" << index << "] => Offset: " << offset; str << " Type: " << tlvtype; str << " Size: " << tlvsize; str << std::endl; - offset += tlvsize; + offset += tlvsize ; } - EXPECT_TRUE(offset == size); /* we match up exactly */ + EXPECT_TRUE(offset == (uint32_t)size); /* we match up exactly */ return 1; } diff --git a/tests/unittests/libretroshare/serialiser/tlvbase_test.cc b/tests/unittests/libretroshare/serialiser/tlvbase_test.cc index 0dd6e839a..a99038493 100644 --- a/tests/unittests/libretroshare/serialiser/tlvbase_test.cc +++ b/tests/unittests/libretroshare/serialiser/tlvbase_test.cc @@ -141,7 +141,7 @@ TEST(libretroshare_serialiser, test_RsTlvBase) uint16_t data5[6 + 20]; uint32_t pos =0; uint32_t* offset = &pos; - uint32_t pre_pos = pos; + //uint32_t pre_pos = pos; SetTlvString((void*)data5, sizeof(data5), offset, TLV_TYPE_STR_NAME, teststring); uint32_t tlvsize = GetTlvStringSize(teststring); EXPECT_TRUE(tlvsize == *offset); diff --git a/tests/unittests/libretroshare/services/gxs/FakePgpAuxUtils.cc b/tests/unittests/libretroshare/services/gxs/FakePgpAuxUtils.cc index 2b31d53d1..f4dfc85dc 100644 --- a/tests/unittests/libretroshare/services/gxs/FakePgpAuxUtils.cc +++ b/tests/unittests/libretroshare/services/gxs/FakePgpAuxUtils.cc @@ -108,7 +108,7 @@ bool FakePgpAuxUtils::getGPGAllList(std::list &ids) bool FakePgpAuxUtils::askForDeferredSelfSignature(const void* /*data*/, const uint32_t /*len*/, unsigned char *sign, unsigned int *signlen,int& signature_result, std::string /*reason = ""*/ ) { - for(int i = 0; i < *signlen; i++) + for(unsigned int i = 0; i < *signlen; i++) { sign[i] = 0; } diff --git a/tests/unittests/libretroshare/services/gxs/GxsIsolatedServiceTester.cc b/tests/unittests/libretroshare/services/gxs/GxsIsolatedServiceTester.cc index 38e47e862..46d4cfdee 100644 --- a/tests/unittests/libretroshare/services/gxs/GxsIsolatedServiceTester.cc +++ b/tests/unittests/libretroshare/services/gxs/GxsIsolatedServiceTester.cc @@ -28,11 +28,11 @@ GxsIsolatedServiceTester::GxsIsolatedServiceTester(const RsPeerId &ownId, const { // extract bits we need. PeerNode *node = getPeerNode(); - p3PeerMgr *peerMgr = node->getPeerMgr(); - p3LinkMgr *linkMgr = node->getLinkMgr(); - p3NetMgr *netMgr = node->getNetMgr(); + //p3PeerMgr *peerMgr = node->getPeerMgr(); + //p3LinkMgr *linkMgr = node->getLinkMgr(); + //p3NetMgr *netMgr = node->getNetMgr(); RsNxsNetMgr *nxsMgr = node->getNxsNetMgr(); - p3ServiceControl *serviceCtrl = node->getServiceControl(); + //p3ServiceControl *serviceCtrl = node->getServiceControl(); // Create Service for Testing. // Specific Testing service here. diff --git a/tests/unittests/libretroshare/services/gxs/GxsPairServiceTester.cc b/tests/unittests/libretroshare/services/gxs/GxsPairServiceTester.cc index 3df343b9b..b56f2c868 100644 --- a/tests/unittests/libretroshare/services/gxs/GxsPairServiceTester.cc +++ b/tests/unittests/libretroshare/services/gxs/GxsPairServiceTester.cc @@ -104,7 +104,7 @@ void GxsPairServiceTester::PrintCapturedPackets() std::cerr << "#Packets: " << getPacketCount(); std::cerr << std::endl; - for(int i = 0; i < getPacketCount(); i++) + for(uint32_t i = 0; i < getPacketCount(); i++) { SetPacket &pkt = examinePacket(i); diff --git a/tests/unittests/libretroshare/services/gxs/GxsPeerNode.cc b/tests/unittests/libretroshare/services/gxs/GxsPeerNode.cc index 18156a693..83089fa0c 100644 --- a/tests/unittests/libretroshare/services/gxs/GxsPeerNode.cc +++ b/tests/unittests/libretroshare/services/gxs/GxsPeerNode.cc @@ -33,11 +33,11 @@ GxsPeerNode::GxsPeerNode(const RsPeerId &ownId, const std::list &frien mTestNs(NULL) { // extract bits we need. - p3PeerMgr *peerMgr = getPeerMgr(); - p3LinkMgr *linkMgr = getLinkMgr(); - p3NetMgr *netMgr = getNetMgr(); + //p3PeerMgr *peerMgr = getPeerMgr(); + //p3LinkMgr *linkMgr = getLinkMgr(); + //p3NetMgr *netMgr = getNetMgr(); RsNxsNetMgr *nxsMgr = getNxsNetMgr(); - p3ServiceControl *serviceCtrl = getServiceControl(); + //p3ServiceControl *serviceCtrl = getServiceControl(); // Create Service for Testing. // Specific Testing service here. @@ -165,7 +165,7 @@ GxsPeerNode::~GxsPeerNode() RsDirUtil::cleanupDirectory(mGxsDir, filesToKeep); } -bool GxsPeerNode::checkTestServiceAllowedGroups(const RsPeerId &peerId) +bool GxsPeerNode::checkTestServiceAllowedGroups(const RsPeerId &/*peerId*/) { #ifdef USER_NETSERVICE_WRAPPER std::vector groups; @@ -178,7 +178,7 @@ bool GxsPeerNode::checkTestServiceAllowedGroups(const RsPeerId &peerId) } -bool GxsPeerNode::checkCircleServiceAllowedGroups(const RsPeerId &peerId) +bool GxsPeerNode::checkCircleServiceAllowedGroups(const RsPeerId &/*peerId*/) { #ifdef USER_NETSERVICE_WRAPPER std::vector groups; diff --git a/tests/unittests/libretroshare/services/gxs/gxstestservice.cc b/tests/unittests/libretroshare/services/gxs/gxstestservice.cc index 1a033bf4c..882bd9cc8 100644 --- a/tests/unittests/libretroshare/services/gxs/gxstestservice.cc +++ b/tests/unittests/libretroshare/services/gxs/gxstestservice.cc @@ -54,7 +54,7 @@ RsServiceInfo GxsTestService::getServiceInfo() } -uint32_t GxsTestService::testAuthenPolicy(uint32_t testMode) +uint32_t GxsTestService::testAuthenPolicy(uint32_t /*testMode*/) { uint32_t policy = 0; uint8_t flag = 0; @@ -304,7 +304,7 @@ std::ostream &operator<<(std::ostream &out, const RsTestMsg &msg) // Overloaded from RsTickEvent for Event callbacks. -void GxsTestService::handle_event(uint32_t event_type, const std::string &elabel) +void GxsTestService::handle_event(uint32_t event_type, const std::string &/*elabel*/) { std::cerr << "GxsTestService::handle_event(" << event_type << ")"; std::cerr << std::endl; diff --git a/tests/unittests/libretroshare/services/gxs/rsgxstestitems.cc b/tests/unittests/libretroshare/services/gxs/rsgxstestitems.cc index 97a4cd5e3..46025ca7a 100644 --- a/tests/unittests/libretroshare/services/gxs/rsgxstestitems.cc +++ b/tests/unittests/libretroshare/services/gxs/rsgxstestitems.cc @@ -45,7 +45,7 @@ uint32_t RsGxsTestSerialiser::size(RsItem *item) { return sizeGxsTestMsgItem(msg_item); } - return NULL; + return 0; } bool RsGxsTestSerialiser::serialise(RsItem *item, void *data, uint32_t *size) diff --git a/tests/unittests/libretroshare/services/status/status_test.cc b/tests/unittests/libretroshare/services/status/status_test.cc index 1f8723728..59945ad95 100644 --- a/tests/unittests/libretroshare/services/status/status_test.cc +++ b/tests/unittests/libretroshare/services/status/status_test.cc @@ -27,9 +27,9 @@ TEST(libretroshare_services, Status_test1) // extract bits we need. PeerNode *node = tester.getPeerNode(); - p3PeerMgr *peerMgr = node->getPeerMgr(); - p3LinkMgr *linkMgr = node->getLinkMgr(); - p3NetMgr *netMgr = node->getNetMgr(); + //p3PeerMgr *peerMgr = node->getPeerMgr(); + //p3LinkMgr *linkMgr = node->getLinkMgr(); + //p3NetMgr *netMgr = node->getNetMgr(); p3ServiceControl *serviceCtrl = node->getServiceControl(); // add in service.