pass over compiler warnings

This commit is contained in:
csoler 2016-06-05 10:43:57 -04:00
parent c2ae4fc904
commit 927f782bef
23 changed files with 66 additions and 73 deletions

View File

@ -218,7 +218,7 @@ ResponseTask* IdentityHandler::handleOwn(Request & /* req */, Response &resp)
return 0;
}
ResponseTask* IdentityHandler::handleCreateIdentity(Request &req, Response &resp)
ResponseTask* IdentityHandler::handleCreateIdentity(Request & /* req */, Response & /* resp */)
{
return new CreateIdentityTask(mRsIdentity);
}

View File

@ -12,7 +12,7 @@ public:
{
addResourceHandler("eins", this, &TestResource::eins);
}
ResponseTask* eins(Request& req, Response& resp)
ResponseTask* eins(Request& /* req */, Response& /* resp */)
{
return 0;
}

View File

@ -55,7 +55,7 @@ bool RsControlModule::processShouldExit()
return mProcessShouldExit;
}
bool RsControlModule::askForPassword(const std::string &key_details, bool prev_is_bad, std::string &password, bool& cancelled)
bool RsControlModule::askForPassword(const std::string &key_details, bool /* prev_is_bad */, std::string &password, bool& cancelled)
{
cancelled = false ;
{

View File

@ -42,7 +42,7 @@ void TransfersHandler::tick()
}
}
void TransfersHandler::handleWildcard(Request &req, Response &resp)
void TransfersHandler::handleWildcard(Request & /*req*/, Response & /*resp*/)
{
}
@ -108,7 +108,7 @@ void TransfersHandler::handleControlDownload(Request &req, Response &resp)
resp.setFail("error: action not handled");
}
void TransfersHandler::handleDownloads(Request &req, Response &resp)
void TransfersHandler::handleDownloads(Request & /* req */, Response &resp)
{
tick();
resp.mStateToken = mStateToken;

View File

@ -266,7 +266,7 @@ int BinEncryptedFileInterface::readdata(void* data, int len)
}
if(len <= sizeData)
if((uint64_t)len <= sizeData)
{
memcpy(data, this->data, len);
cpyCount += len;

View File

@ -671,7 +671,7 @@ int pqistreamer::handleincoming_locked()
allocate_rpend_locked();
// enough space to read any packet.
int maxlen = mPkt_rpend_size;
uint32_t maxlen = mPkt_rpend_size;
void *block = mPkt_rpending;
// initial read size: basic packet.
@ -787,7 +787,7 @@ continue_packet:
std::cerr << "[" << (void*)pthread_self() << "] " << "continuing packet state=" << mReading_state << std::endl ;
std::cerr << "[" << (void*)pthread_self() << "] " << "block 1 : " << RsUtil::BinToHex(block,8) << std::endl;
#endif
if (extralen > maxlen - blen)
if (extralen + (uint32_t)blen > maxlen)
{
pqioutput(PQL_ALERT, pqistreamerzone, "ERROR: Read Packet too Big!");

View File

@ -1381,8 +1381,10 @@ RsPeerDetails::RsPeerDetails()
trustLvl(0), validLvl(0),ownsign(false),
hasSignedMe(false),accept_connection(false),
state(0),localAddr(""),localPort(0),extAddr(""),extPort(0),netMode(0),vs_disc(0), vs_dht(0),
lastConnect(0),connectState(0),connectStateString(""),connectPeriod(0),
hiddenType(RS_HIDDEN_TYPE_NONE), foundDHT(false), wasDeniedConnection(false), deniedTS(0)
lastConnect(0),connectState(0),connectStateString(""),
hiddenType(RS_HIDDEN_TYPE_NONE),
connectPeriod(0),
foundDHT(false), wasDeniedConnection(false), deniedTS(0)
{
}

View File

@ -7,12 +7,15 @@
#if defined(HAS_GNOME_KEYRING) || defined(__FreeBSD__) || defined(__OpenBSD__)
#include <gnome-keyring-1/gnome-keyring.h>
GnomeKeyringPasswordSchema my_schema = {
GNOME_KEYRING_ITEM_ENCRYPTION_KEY_PASSWORD,
{
{ "RetroShare SSL Id", GNOME_KEYRING_ATTRIBUTE_TYPE_STRING },
{ NULL, (GnomeKeyringAttributeType)0 }
}
GnomeKeyringPasswordSchema my_schema = {
GNOME_KEYRING_ITEM_ENCRYPTION_KEY_PASSWORD,
{
{ "RetroShare SSL Id", GNOME_KEYRING_ATTRIBUTE_TYPE_STRING },
{ NULL, (GnomeKeyringAttributeType)0 }
},
NULL,
NULL,
NULL
};
#endif

View File

@ -1060,6 +1060,7 @@ bool p3GxsCircles::locked_processLoadingCacheEntry(RsGxsCircleCache& cache)
/* check cache */
if(!(pit->second.subscription_flags & GXS_EXTERNAL_CIRCLE_FLAGS_KEY_AVAILABLE))
{
if(mIdentities->haveKey(pit->first))
{
pit->second.subscription_flags |= GXS_EXTERNAL_CIRCLE_FLAGS_KEY_AVAILABLE;
@ -1068,26 +1069,27 @@ bool p3GxsCircles::locked_processLoadingCacheEntry(RsGxsCircleCache& cache)
#endif
}
else
{
std::list<PeerId> peers;
{
std::list<PeerId> peers;
if(!cache.mOriginator.isNull())
{
peers.push_back(cache.mOriginator) ;
if(!cache.mOriginator.isNull())
{
peers.push_back(cache.mOriginator) ;
#ifdef DEBUG_CIRCLES
std::cerr << " Requesting unknown/unloaded identity: " << pit->first << " to originator " << cache.mOriginator << std::endl;
std::cerr << " Requesting unknown/unloaded identity: " << pit->first << " to originator " << cache.mOriginator << std::endl;
#endif
}
else
{
std::cerr << " (WW) cache entry for circle " << cache.mCircleId << " has empty originator. Asking info for GXS id " << pit->first << " to all connected friends." << std::endl;
}
else
{
std::cerr << " (WW) cache entry for circle " << cache.mCircleId << " has empty originator. Asking info for GXS id " << pit->first << " to all connected friends." << std::endl;
rsPeers->getOnlineList(peers) ;
}
rsPeers->getOnlineList(peers) ;
}
mIdentities->requestKey(pit->first, peers);
//isUnprocessedPeers = true;
}
mIdentities->requestKey(pit->first, peers);
//isUnprocessedPeers = true;
}
}
#ifdef DEBUG_CIRCLES
else
std::cerr << " Key is available. Nothing to process." << std::endl;

View File

@ -1007,7 +1007,7 @@ std::string p3FeedReaderThread::getProxyForFeed(const RsFeedReaderFeed &feed)
RsFeedReaderErrorState p3FeedReaderThread::processMsg(const RsFeedReaderFeed &feed, RsFeedReaderMsg *msg, std::string &errorString)
{
long todo_fill_errorString;
//long todo_fill_errorString;
if (!msg) {
return RS_FEED_ERRORSTATE_PROCESS_INTERNAL_ERROR;
@ -1073,7 +1073,7 @@ RsFeedReaderErrorState p3FeedReaderThread::processMsg(const RsFeedReaderFeed &fe
if (isRunning()) {
/* process description */
long todo; // encoding
//long todo; // encoding
HTMLWrapper html;
if (html.readHTML(msg->description.c_str(), url.c_str())) {
xmlNodePtr root = html.getRootElement();
@ -1527,7 +1527,7 @@ RsFeedReaderErrorState p3FeedReaderThread::processXslt(const std::string &xslt,
RsFeedReaderErrorState result = RS_FEED_ERRORSTATE_OK;
/* process description */
long todo; // encoding
//long todo; // encoding
HTMLWrapper html;
if (html.readHTML(description.c_str(), "")) {
xmlNodePtr root = html.getRootElement();

View File

@ -227,7 +227,7 @@ void xProgressBar::paint()
linearGrad.setColorAt(1.00, gradColor1);
painter->setPen(gradBorderColor);
int width = static_cast<int>(rect.width()-1-2*hSpan) ;
uint32_t width = static_cast<uint32_t>(rect.width()-1-2*hSpan) ;
painter->setBrush(linearGrad);

View File

@ -561,7 +561,7 @@ void IdDialog::loadCircleGroupMeta(const uint32_t &token)
// remove any identity that has an item, but no subscription flag entry
std::vector<QTreeWidgetItem*> to_delete ;
for(uint32_t k=0;k<item->childCount();++k)
for(int k=0;k<item->childCount();++k)
if(details.mSubscriptionFlags.find(RsGxsId(item->child(k)->data(CIRCLEGROUP_CIRCLE_COL_GROUPID,Qt::UserRole).toString().toStdString())) == details.mSubscriptionFlags.end())
to_delete.push_back(item->child(k));

View File

@ -624,8 +624,9 @@ void NewsFeed::loadChannelPublishKey(const uint32_t &token)
std::cerr << std::endl;
return;
}
#ifdef UNUSED_CODE
MessageComposer::sendChannelPublishKey(groups[0]);
#endif
}
void NewsFeed::loadForumGroup(const uint32_t &token)
@ -717,8 +718,9 @@ void NewsFeed::loadForumPublishKey(const uint32_t &token)
std::cerr << std::endl;
return;
}
#ifdef UNUSED_CODE
MessageComposer::sendForumPublishKey(groups[0]);
#endif
}
void NewsFeed::loadPostedGroup(const uint32_t &token)

View File

@ -295,9 +295,10 @@ void PostedItem::fill()
ui->voteDownButton->setEnabled(false);
}
uint32_t up, down, nComments;
#if 0
uint32_t up, down, nComments;
bool ok = rsPosted->retrieveScores(mPost.mMeta.mServiceString, up, down, nComments);
if(ok)

View File

@ -65,7 +65,7 @@ void AvatarDefs::getAvatarFromSslId(const RsPeerId& sslId, QPixmap &avatar, cons
}
void AvatarDefs::getAvatarFromGxsId(const RsGxsId& gxsId, QPixmap &avatar, const QString& defaultImage)
{
int size = 0;
//int size = 0;
/* get avatar */
RsIdentityDetails details ;

View File

@ -524,7 +524,7 @@ void RSGraphWidget::paintTotals()
float FS = QFontMetricsF(font()).height();
float fact = FS/14.0 ;
int x = SCALE_WIDTH*fact + FS, y = 0;
//int x = SCALE_WIDTH*fact + FS, y = 0;
int rowHeight = FS;
#if !defined(Q_OS_MAC)
@ -626,7 +626,7 @@ void RSGraphWidget::wheelEvent(QWheelEvent *e)
void RSGraphWidget::paintLegend()
{
int bottom = _rec.height();
//int bottom = _rec.height();
std::vector<QPointF> vals ;
_source->getCurrentValues(vals) ;

View File

@ -45,6 +45,7 @@ static void fillLabelCallback(GxsIdDetailsType type, const RsIdentityDetails &de
case GXS_ID_DETAILS_TYPE_EMPTY:
case GXS_ID_DETAILS_TYPE_LOADING:
case GXS_ID_DETAILS_TYPE_FAILED:
case GXS_ID_DETAILS_TYPE_BANNED:
break;
case GXS_ID_DETAILS_TYPE_DONE:

View File

@ -627,6 +627,7 @@ void MessageComposer::sendConnectAttemptMsg(const RsPgpId &gpgId, const RsPeerId
rsMail->SystemMessage(title.toUtf8().constData(), msgText.toUtf8().constData(), RS_MSG_USER_REQUEST);
}
#ifdef UNUSED_CODE
void MessageComposer::sendChannelPublishKey(RsGxsChannelGroup &group)
{
// QString channelName = QString::fromUtf8(group.mMeta.mGroupName.c_str());
@ -658,6 +659,7 @@ void MessageComposer::sendForumPublishKey(RsGxsForumGroup &group)
// QString msgText = tr("... %1 ...<br>%2").arg(forumName, link.toHtml());
// rsMail->SystemMessage(title.toUtf8().constData(), msgText.toUtf8().constData(), RS_MSG_PUBLISH_KEY);
}
#endif
void MessageComposer::closeEvent (QCloseEvent * event)
{

View File

@ -64,8 +64,10 @@ public:
static QString recommendMessage();
static void recommendFriend(const std::set <RsPeerId> &sslIds, const RsPeerId &to = RsPeerId(), const QString &msg = "", bool autoSend = false);
static void sendConnectAttemptMsg(const RsPgpId &gpgId, const RsPeerId &sslId, const QString &sslName);
#ifdef UNUSED_CODE
static void sendChannelPublishKey(RsGxsChannelGroup &group);
static void sendForumPublishKey(RsGxsForumGroup &group);
#endif
static MessageComposer *newMsg(const std::string &msgId = "");
static MessageComposer *replyMsg(const std::string &msgId, bool all);

View File

@ -304,7 +304,7 @@ void RSPermissionMatrixWidget::paintEvent(QPaintEvent *)
_painter->setPen(pen) ;
int i=0;
int x=5/14.0*S ;
//int x=5/14.0*S ;
int y=S*fMATRIX_START_Y ;
for(std::list<RsPeerId>::const_iterator it(ssllist.begin());it!=ssllist.end();++it,++i)
@ -383,7 +383,7 @@ void RSPermissionMatrixWidget::paintEvent(QPaintEvent *)
static const std::string global_switch[2] = { ":/icons/global_switch_off_128.png",
":/icons/global_switch_on_128.png" } ;
for(int i=0;i<service_ids.size();++i)
for(uint32_t i=0;i<service_ids.size();++i)
{
RsServicePermissions serv_perm ;
rsServiceControl->getServicePermissions(service_ids[i],serv_perm) ;
@ -450,7 +450,7 @@ void RSPermissionMatrixWidget::paintEvent(QPaintEvent *)
// now display some info about current node.
if(n_row_selected < peer_ids.size() && n_col_selected < service_ids.size())
if(n_row_selected < (int)peer_ids.size() && n_col_selected < (int)service_ids.size())
{
QRect position = computeNodePosition(n_row_selected,n_col_selected,false) ;
@ -592,36 +592,14 @@ bool RSPermissionMatrixWidget::computeServiceGlobalSwitch(int x,int y,uint32_t&
return true ;
}
void RSPermissionMatrixWidget::defaultPermissionSwitched(uint32_t ServiceId,bool b)
void RSPermissionMatrixWidget::defaultPermissionSwitched(uint32_t /* ServiceId */,bool /* b */)
{
NOT_IMPLEMENTED ;
}
void RSPermissionMatrixWidget::userPermissionSwitched(uint32_t ServiceId,const RsPeerId& friend_id,bool b)
void RSPermissionMatrixWidget::userPermissionSwitched(uint32_t /* ServiceId */,const RsPeerId& /* friend_id */,bool /* b */)
{
NOT_IMPLEMENTED ;
}
// void RSGraphWidget::paintLegend()
// {
// int bottom = _rec.height();
//
// std::vector<float> vals ;
// _source->getCurrentValues(vals) ;
//
// for(uint i=0;i<vals.size();++i)
// {
// qreal paintStep = 4+FONT_SIZE;
// qreal pos = 20+i*paintStep;
// QString text = _source->legend(i,vals[i]) ;
//
// QPen oldPen = _painter->pen();
// _painter->setPen(QPen(getColor(i), Qt::SolidLine));
// _painter->drawLine(QPointF(SCALE_WIDTH+10.0, pos), QPointF(SCALE_WIDTH+30.0, pos));
// _painter->setPen(oldPen);
//
// _painter->setPen(SCALE_COLOR);
// _painter->drawText(QPointF(SCALE_WIDTH + 40,pos + 0.5*FONT_SIZE), text) ;
// }
// }

View File

@ -594,7 +594,7 @@ void ServerPage::moveToWhiteList2()
rsBanList->addIpRange(addr,2,RSBANLIST_TYPE_WHITELIST, tr("Added by you").toStdString());
}
void ServerPage::ipWhiteListContextMenu(const QPoint& point)
void ServerPage::ipWhiteListContextMenu(const QPoint& /* point */)
{
QMenu contextMenu(this) ;
int row = ui.whiteListIpsTable->currentRow();

View File

@ -167,7 +167,7 @@ void GlobalRouterStatistics::updateContent()
groupBox->setTitle(tr("Pending packets")+": " + QString::number(cache_infos.size()) );
for(int i=0;i<cache_infos.size();++i)
for(uint32_t i=0;i<cache_infos.size();++i)
{
QTreeWidgetItem *item = new QTreeWidgetItem();
treeWidget->addTopLevelItem(item);

View File

@ -227,8 +227,8 @@ GxsTunnelsDialog::GxsTunnelsDialog(QWidget *parent)
m_bProcessSettings = false;
float fontHeight = QFontMetricsF(font()).height();
float fact = fontHeight/14.0;
//float fontHeight = QFontMetricsF(font()).height();
//float fact = fontHeight/14.0;
maxWidth = 200 ;
maxHeight = 200 ;