Removed a bunch of gcc4 warnings - mostly "unused param"

This commit is contained in:
Srivats P. 2010-01-03 08:56:16 +00:00
parent 395024cc0c
commit aac2229403
28 changed files with 98 additions and 83 deletions

View File

@ -3,6 +3,7 @@
//! \todo Enable Scrollbars
DumpView::DumpView(QWidget *parent)
: QAbstractItemView(parent)
{
int w, h;
@ -26,7 +27,7 @@ DumpView::DumpView(QWidget *parent)
qDebug("DumpView::DumpView");
}
QModelIndex DumpView::indexAt( const QPoint &point ) const
QModelIndex DumpView::indexAt(const QPoint &/*point*/) const
{
#if 0
int x = point.x();
@ -84,12 +85,12 @@ _exit:
return QModelIndex();
}
void DumpView::scrollTo( const QModelIndex &index, ScrollHint hint )
void DumpView::scrollTo(const QModelIndex &/*index*/, ScrollHint /*hint*/)
{
// FIXME: implement scrolling
}
QRect DumpView::visualRect( const QModelIndex &index ) const
QRect DumpView::visualRect(const QModelIndex &/*index*/) const
{
// FIXME: calculate actual rect
return rect();
@ -101,20 +102,20 @@ int DumpView::horizontalOffset() const
return horizontalScrollBar()->value();
}
bool DumpView::isIndexHidden( const QModelIndex &index ) const
bool DumpView::isIndexHidden(const QModelIndex &/*index*/) const
{
return false;
}
QModelIndex DumpView::moveCursor( CursorAction cursorAction,
Qt::KeyboardModifiers modifiers )
QModelIndex DumpView::moveCursor(CursorAction /*cursorAction*/,
Qt::KeyboardModifiers /*modifiers*/)
{
// FIXME(MED): need to implement movement using cursor
return currentIndex();
}
void DumpView::setSelection( const QRect &rect,
QItemSelectionModel::SelectionFlags flags )
void DumpView::setSelection(const QRect &/*rect*/,
QItemSelectionModel::SelectionFlags flags)
{
// FIXME(HI): calculate indexes using rect
selectionModel()->select(QModelIndex(), flags);
@ -125,22 +126,23 @@ int DumpView::verticalOffset() const
return verticalScrollBar()->value();
}
QRegion DumpView::visualRegionForSelection( const QItemSelection &selection ) const
QRegion DumpView::visualRegionForSelection(
const QItemSelection &/*selection*/) const
{
// FIXME(HI)
return QRegion(rect());
}
//protected slots:
void DumpView::dataChanged( const QModelIndex &topLeft,
const QModelIndex &bottomRight )
void DumpView::dataChanged(const QModelIndex &/*topLeft*/,
const QModelIndex &/*bottomRight*/)
{
// FIXME(HI)
update();
}
void DumpView::selectionChanged( const QItemSelection &selected,
const QItemSelection &deselected )
void DumpView::selectionChanged(const QItemSelection &/*selected*/,
const QItemSelection &/*deselected*/)
{
// FIXME(HI)
update();
@ -220,7 +222,7 @@ void DumpView::populateDump(QByteArray &dump, int &selOfs, int &selSize,
}
// TODO(LOW): rewrite this function - it's a mess!
void DumpView::paintEvent(QPaintEvent* event)
void DumpView::paintEvent(QPaintEvent* /*event*/)
{
QStylePainter painter(viewport());
QRect offsetRect = mOffsetPaneTopRect;

View File

@ -9,7 +9,7 @@ HexLineEdit::HexLineEdit( QWidget * parent)
//QLineEdit::QLineEdit(parent);
}
void HexLineEdit::focusOutEvent( QFocusEvent *e )
void HexLineEdit::focusOutEvent(QFocusEvent* /*e*/)
{
#if 0
const QValidator *v = validator();

View File

@ -5,6 +5,7 @@
#include "../common/abstractprotocol.h"
PacketModel::PacketModel(QObject *parent)
: QAbstractItemModel(parent)
{
}
@ -51,7 +52,7 @@ int PacketModel::rowCount(const QModelIndex &parent) const
return 0; // catch all
}
int PacketModel::columnCount(const QModelIndex &parent) const
int PacketModel::columnCount(const QModelIndex &/*parent*/) const
{
return 1;
}

View File

@ -16,8 +16,10 @@ public:
int rowCount(const QModelIndex &parent = QModelIndex()) const;
int columnCount(const QModelIndex &parent = QModelIndex()) const;
QVariant data(const QModelIndex &index, int role) const;
QVariant headerData(int section, Qt::Orientation orientation,
int role = Qt::DisplayRole) const { return QVariant(); } ;
QVariant headerData(int /*section*/, Qt::Orientation /*orientation*/,
int /*role= Qt::DisplayRole*/) const {
return QVariant();
}
QModelIndex index (int row, int col, const QModelIndex & parent = QModelIndex() ) const;
QModelIndex parent(const QModelIndex &index) const;
@ -28,8 +30,8 @@ private:
struct
{
quint16 type;
#define ITYP_PROTOCOL 1
#define ITYP_FIELD 2
#define ITYP_PROTOCOL 1
#define ITYP_FIELD 2
quint16 protocol; // protocol is valid for both ITYPs
} ws;
} IndexId;

View File

@ -85,7 +85,7 @@ void PortGroup::on_rpcChannel_disconnected()
void PortGroup::on_rpcChannel_error(QAbstractSocket::SocketError socketError)
{
qDebug("error\n");
qDebug("%s: error %d", __FUNCTION__, socketError);
emit portGroupDataChanged(mPortGroupId);
}
@ -429,7 +429,7 @@ _exit:
return;
}
void PortGroup::processModifyStreamAck(OstProto::Ack *ack)
void PortGroup::processModifyStreamAck(OstProto::Ack */*ack*/)
{
qDebug("In %s", __FUNCTION__);

View File

@ -53,7 +53,7 @@ int PortModel::rowCount(const QModelIndex &parent) const
}
}
int PortModel::columnCount(const QModelIndex &parent ) const
int PortModel::columnCount(const QModelIndex &/*parent*/) const
{
return 1; // FIXME: hardcoding
}
@ -166,7 +166,7 @@ QVariant PortModel::data(const QModelIndex &index, int role) const
return QVariant();
}
QVariant PortModel::headerData(int section, Qt::Orientation orientation, int role) const
QVariant PortModel::headerData(int /*section*/, Qt::Orientation orientation, int role) const
{
if (role != Qt::DisplayRole)
return QVariant();

View File

@ -1,6 +1,7 @@
#include "portstatsfilterdialog.h"
PortStatsFilterDialog::PortStatsFilterDialog(QWidget *parent)
: QDialog(parent)
{
setupUi(this);
@ -92,8 +93,8 @@ void PortStatsFilterDialog::on_lvUnselected_doubleClicked(const QModelIndex &ind
{
QStandardItem *item;
item = mUnselected.takeItem(lvUnselected->currentIndex().row());
if (mUnselected.removeRow(lvUnselected->currentIndex().row()))
item = mUnselected.takeItem(index.row());
if (mUnselected.removeRow(index.row()))
mSelected.appendRow(item);
}
@ -101,8 +102,8 @@ void PortStatsFilterDialog::on_lvSelected_doubleClicked(const QModelIndex &index
{
QStandardItem *item;
item = mSelected.takeItem(lvSelected->currentIndex().row());
if (mSelected.removeRow(lvSelected->currentIndex().row()))
item = mSelected.takeItem(index.row());
if (mSelected.removeRow(index.row()))
{
mUnselected.appendRow(item);
mUnselected.sort(0);

View File

@ -261,7 +261,7 @@ void PortStatsModel::when_portListChanged()
reset();
}
void PortStatsModel::on_portStatsUpdate(int port, void*stats)
void PortStatsModel::on_portStatsUpdate(int port, void* /*stats*/)
{
QModelIndex topLeft = index(port, 0, QModelIndex());
QModelIndex bottomRight = index(port, e_STAT_MAX, QModelIndex());
@ -277,7 +277,7 @@ void PortStatsModel::updateStats()
pgl->mPortGroups[i]->getPortStats();
}
void PortStatsModel::when_portGroup_stats_update(quint32 portGroupId)
void PortStatsModel::when_portGroup_stats_update(quint32 /*portGroupId*/)
{
// FIXME(MED): update only the changed ports, not all

View File

@ -5,6 +5,7 @@
#include <QItemSelectionModel>
PortsWindow::PortsWindow(PortGroupList *pgl, QWidget *parent)
: QWidget(parent)
{
StreamListDelegate *delegate = new StreamListDelegate;
//slm = new StreamListModel();
@ -90,7 +91,7 @@ void PortsWindow::on_tvStreamList_activated(const QModelIndex & index)
}
void PortsWindow::when_portView_currentChanged(const QModelIndex& current,
const QModelIndex& previous)
const QModelIndex& /*previous*/)
{
plm->getStreamModel()->setCurrentPortIndex(current);
updatePortViewActions(current);
@ -114,8 +115,8 @@ void PortsWindow::when_portView_currentChanged(const QModelIndex& current,
}
}
void PortsWindow::when_streamView_currentChanged(const QModelIndex& current,
const QModelIndex& previous)
void PortsWindow::when_streamView_currentChanged(const QModelIndex& /*current*/,
const QModelIndex& /*previous*/)
{
qDebug("stream view current changed");
updateStreamViewActions();

View File

@ -311,7 +311,7 @@ void StreamConfigDialog::on_tbSelectProtocols_currentChanged(int index)
}
void StreamConfigDialog::when_lvAllProtocols_selectionChanged(
const QItemSelection &selected, const QItemSelection &deselected)
const QItemSelection &/*selected*/, const QItemSelection &/*deselected*/)
{
int size = lvAllProtocols->selectionModel()->selectedIndexes().size();
@ -321,7 +321,7 @@ void StreamConfigDialog::when_lvAllProtocols_selectionChanged(
}
void StreamConfigDialog::when_lvSelectedProtocols_currentChanged(
const QModelIndex &current, const QModelIndex &previous)
const QModelIndex &current, const QModelIndex &/*previous*/)
{
qDebug("%s: currentRow = %d\n", __FUNCTION__, current.row());

View File

@ -21,7 +21,7 @@ int StreamModel::rowCount(const QModelIndex &parent) const
return 0;
}
int StreamModel::columnCount(const QModelIndex &parent ) const
int StreamModel::columnCount(const QModelIndex &/*parent*/) const
{
return (int) StreamMaxFields;
}
@ -197,7 +197,7 @@ QVariant StreamModel::headerData(int section, Qt::Orientation orientation, int r
return QVariant();
}
bool StreamModel::insertRows(int row, int count, const QModelIndex &parent)
bool StreamModel::insertRows(int row, int count, const QModelIndex &/*parent*/)
{
qDebug("insertRows() row = %d", row);
qDebug("insertRows() count = %d", count);
@ -209,7 +209,7 @@ bool StreamModel::insertRows(int row, int count, const QModelIndex &parent)
return true;
}
bool StreamModel::removeRows(int row, int count, const QModelIndex &parent)
bool StreamModel::removeRows(int row, int count, const QModelIndex &/*parent*/)
{
qDebug("removeRows() row = %d", row);
qDebug("removeRows() count = %d", count);

View File

@ -36,8 +36,8 @@ AbstractProtocol::~AbstractProtocol()
{
}
AbstractProtocol* AbstractProtocol::createInstance(StreamBase *stream,
AbstractProtocol *parent)
AbstractProtocol* AbstractProtocol::createInstance(StreamBase* /* stream */,
AbstractProtocol* /* parent */)
{
return NULL;
}
@ -124,7 +124,7 @@ int AbstractProtocol::frameFieldCount() const
return (fieldCount() - metaFieldCount());
}
AbstractProtocol::FieldFlags AbstractProtocol::fieldFlags(int index) const
AbstractProtocol::FieldFlags AbstractProtocol::fieldFlags(int /*index*/) const
{
return FieldIsNormal;
}
@ -187,8 +187,8 @@ QVariant AbstractProtocol::fieldData(int index, FieldAttrib attrib,
/*! Sets the value of a field corresponding to index \n
Returns true if field is successfully set, false otherwise \n
The default implementation always returns false */
bool AbstractProtocol::setFieldData(int index, const QVariant &value,
FieldAttrib attrib)
bool AbstractProtocol::setFieldData(int /*index*/, const QVariant& /*value*/,
FieldAttrib /*attrib*/)
{
return false;
}
@ -198,7 +198,7 @@ AbstractProtocol::ProtocolIdType AbstractProtocol::protocolIdType() const
return ProtocolIdNone;
}
quint32 AbstractProtocol::protocolId(ProtocolIdType type) const
quint32 AbstractProtocol::protocolId(ProtocolIdType /*type*/) const
{
return 0;
}

View File

@ -113,8 +113,8 @@ QVariant Dot3Protocol::fieldData(int index, FieldAttrib attrib,
return AbstractProtocol::fieldData(index, attrib, streamIndex);
}
bool Dot3Protocol::setFieldData(int index, const QVariant &value,
FieldAttrib attrib)
bool Dot3Protocol::setFieldData(int /*index*/, const QVariant &/*value*/,
FieldAttrib /*attrib*/)
{
return false;
}

View File

@ -130,8 +130,8 @@ QVariant LlcProtocol::fieldData(int index, FieldAttrib attrib,
return AbstractProtocol::fieldData(index, attrib, streamIndex);
}
bool LlcProtocol::setFieldData(int index, const QVariant &value,
FieldAttrib attrib)
bool LlcProtocol::setFieldData(int /*index*/, const QVariant &/*value*/,
FieldAttrib /*attrib*/)
{
return false;
}

View File

@ -233,8 +233,8 @@ QVariant MacProtocol::fieldData(int index, FieldAttrib attrib,
return AbstractProtocol::fieldData(index, attrib, streamIndex);
}
bool MacProtocol::setFieldData(int index, const QVariant &value,
FieldAttrib attrib)
bool MacProtocol::setFieldData(int /*index*/, const QVariant& /*value*/,
FieldAttrib /*attrib*/)
{
return false;
}

View File

@ -181,8 +181,8 @@ QVariant PayloadProtocol::fieldData(int index, FieldAttrib attrib,
return AbstractProtocol::fieldData(index, attrib, streamIndex);
}
bool PayloadProtocol::setFieldData(int index, const QVariant &value,
FieldAttrib attrib)
bool PayloadProtocol::setFieldData(int /*index*/, const QVariant &/*value*/,
FieldAttrib /*attrib*/)
{
return false;
}

View File

@ -220,6 +220,7 @@ QVariant SampleProtocol::fieldData(int index, FieldAttrib attrib,
cksum = protocolFrameCksum(streamIndex, CksumIp);
}
default:
cksum = 0; // avoid the 'maybe used unitialized' warning
break;
}

View File

@ -135,8 +135,8 @@ QVariant SnapProtocol::fieldData(int index, FieldAttrib attrib,
return AbstractProtocol::fieldData(index, attrib, streamIndex);
}
bool SnapProtocol::setFieldData(int index, const QVariant &value,
FieldAttrib attrib)
bool SnapProtocol::setFieldData(int /*index*/, const QVariant &/*value*/,
FieldAttrib /*attrib*/)
{
return false;
}

View File

@ -191,6 +191,7 @@ quint16 StreamBase::frameLen(int streamIndex) const
break;
case OstProto::StreamCore::e_fl_random:
//! \todo (MED) This 'random' sequence is same across iterations
pktLen = 64; // to avoid the 'maybe used uninitialized' warning
qsrand(((uint) this));
for (int i = 0; i <= streamIndex; i++)
pktLen = qrand();

View File

@ -374,8 +374,8 @@ QVariant TcpProtocol::fieldData(int index, FieldAttrib attrib,
return AbstractProtocol::fieldData(index, attrib, streamIndex);
}
bool TcpProtocol::setFieldData(int index, const QVariant &value,
FieldAttrib attrib)
bool TcpProtocol::setFieldData(int /*index*/, const QVariant &/*value*/,
FieldAttrib /*attrib*/)
{
return false;
}

View File

@ -205,6 +205,7 @@ QVariant UdpProtocol::fieldData(int index, FieldAttrib attrib,
qDebug("UDP cksum = %hu", cksum);
}
default:
cksum = 0;
break;
}
@ -251,8 +252,8 @@ QVariant UdpProtocol::fieldData(int index, FieldAttrib attrib,
return AbstractProtocol::fieldData(index, attrib, streamIndex);
}
bool UdpProtocol::setFieldData(int index, const QVariant &value,
FieldAttrib attrib)
bool UdpProtocol::setFieldData(int /*index*/, const QVariant &/*value*/,
FieldAttrib /*attrib*/)
{
//! implement UdpProtocol::setFieldData()
return false;

View File

@ -35,7 +35,7 @@ void UserScriptConfigForm::on_programEdit_textChanged()
compileButton->setEnabled(true);
}
void UserScriptConfigForm::on_compileButton_clicked(bool checked)
void UserScriptConfigForm::on_compileButton_clicked(bool /*checked*/)
{
protocol_->storeConfigWidget();
if (!protocol_->isScriptValid())

View File

@ -193,8 +193,8 @@ QVariant VlanProtocol::fieldData(int index, FieldAttrib attrib,
return AbstractProtocol::fieldData(index, attrib, streamIndex);
}
bool VlanProtocol::setFieldData(int index, const QVariant &value,
FieldAttrib attrib)
bool VlanProtocol::setFieldData(int /*index*/, const QVariant &/*value*/,
FieldAttrib /*attrib*/)
{
return false;
}

View File

@ -24,7 +24,9 @@ public:
void SetFailed(const std::string &reason)
{ failed = true; errStr = reason; }
bool IsCanceled() const { return false; };
void NotifyOnCancel(::google::protobuf::Closure *callback) { /*! \todo (MED) */ }
void NotifyOnCancel(::google::protobuf::Closure* /* callback */) {
/*! \todo (MED) */
}
// srivatsp added
QIODevice* binaryBlob() { return blob; };

View File

@ -160,7 +160,8 @@ void RpcServer::when_disconnected()
void RpcServer::when_error(QAbstractSocket::SocketError socketError)
{
qDebug("%s", clientSock->errorString().toAscii().constData());
qDebug("%s (%d)", clientSock->errorString().toAscii().constData(),
socketError);
}
void RpcServer::when_dataAvail()

View File

@ -8,7 +8,7 @@
AbstractPort::AbstractPort(int id, const char *device)
{
data_.mutable_port_id()->set_id(id);
data_.set_name(QString("if%1 ").arg(id).toStdString());
data_.set_name(device);
//! \todo (LOW) admin enable/disable of port
data_.set_is_enabled(true);

View File

@ -27,8 +27,8 @@ MyService::~MyService()
{
}
void MyService::getPortIdList(::google::protobuf::RpcController* controller,
const ::OstProto::Void* request,
void MyService::getPortIdList(::google::protobuf::RpcController* /*controller*/,
const ::OstProto::Void* /*request*/,
::OstProto::PortIdList* response,
::google::protobuf::Closure* done)
{
@ -45,7 +45,7 @@ void MyService::getPortIdList(::google::protobuf::RpcController* controller,
done->Run();
}
void MyService::getPortConfig(::google::protobuf::RpcController* controller,
void MyService::getPortConfig(::google::protobuf::RpcController* /*controller*/,
const ::OstProto::PortIdList* request,
::OstProto::PortConfigList* response,
::google::protobuf::Closure* done)
@ -134,7 +134,7 @@ _invalid_port:
void MyService::addStream(::google::protobuf::RpcController* controller,
const ::OstProto::StreamIdList* request,
::OstProto::Ack* response,
::OstProto::Ack* /*response*/,
::google::protobuf::Closure* done)
{
int portId;
@ -175,7 +175,7 @@ _invalid_port:
void MyService::deleteStream(::google::protobuf::RpcController* controller,
const ::OstProto::StreamIdList* request,
::OstProto::Ack* response,
::OstProto::Ack* /*response*/,
::google::protobuf::Closure* done)
{
int portId;
@ -201,7 +201,7 @@ _invalid_port:
void MyService::modifyStream(::google::protobuf::RpcController* controller,
const ::OstProto::StreamConfigList* request,
::OstProto::Ack* response,
::OstProto::Ack* /*response*/,
::google::protobuf::Closure* done)
{
int portId;
@ -234,9 +234,9 @@ _invalid_port:
done->Run();
}
void MyService::startTx(::google::protobuf::RpcController* controller,
void MyService::startTx(::google::protobuf::RpcController* /*controller*/,
const ::OstProto::PortIdList* request,
::OstProto::Ack* response,
::OstProto::Ack* /*response*/,
::google::protobuf::Closure* done)
{
qDebug("In %s", __PRETTY_FUNCTION__);
@ -257,9 +257,9 @@ void MyService::startTx(::google::protobuf::RpcController* controller,
done->Run();
}
void MyService::stopTx(::google::protobuf::RpcController* controller,
void MyService::stopTx(::google::protobuf::RpcController* /*controller*/,
const ::OstProto::PortIdList* request,
::OstProto::Ack* response,
::OstProto::Ack* /*response*/,
::google::protobuf::Closure* done)
{
qDebug("In %s", __PRETTY_FUNCTION__);
@ -280,9 +280,9 @@ void MyService::stopTx(::google::protobuf::RpcController* controller,
done->Run();
}
void MyService::startCapture(::google::protobuf::RpcController* controller,
void MyService::startCapture(::google::protobuf::RpcController* /*controller*/,
const ::OstProto::PortIdList* request,
::OstProto::Ack* response,
::OstProto::Ack* /*response*/,
::google::protobuf::Closure* done)
{
qDebug("In %s", __PRETTY_FUNCTION__);
@ -303,9 +303,9 @@ void MyService::startCapture(::google::protobuf::RpcController* controller,
done->Run();
}
void MyService::stopCapture(::google::protobuf::RpcController* controller,
void MyService::stopCapture(::google::protobuf::RpcController* /*controller*/,
const ::OstProto::PortIdList* request,
::OstProto::Ack* response,
::OstProto::Ack* /*response*/,
::google::protobuf::Closure* done)
{
qDebug("In %s", __PRETTY_FUNCTION__);
@ -327,7 +327,7 @@ void MyService::stopCapture(::google::protobuf::RpcController* controller,
void MyService::getCaptureBuffer(::google::protobuf::RpcController* controller,
const ::OstProto::PortId* request,
::OstProto::CaptureBuffer* response,
::OstProto::CaptureBuffer* /*response*/,
::google::protobuf::Closure* done)
{
int portId;
@ -350,7 +350,7 @@ _invalid_port:
done->Run();
}
void MyService::getStats(::google::protobuf::RpcController* controller,
void MyService::getStats(::google::protobuf::RpcController* /*controller*/,
const ::OstProto::PortIdList* request,
::OstProto::PortStatsList* response,
::google::protobuf::Closure* done)
@ -397,9 +397,9 @@ void MyService::getStats(::google::protobuf::RpcController* controller,
done->Run();
}
void MyService::clearStats(::google::protobuf::RpcController* controller,
void MyService::clearStats(::google::protobuf::RpcController* /*controller*/,
const ::OstProto::PortIdList* request,
::OstProto::Ack* response,
::OstProto::Ack* /*response*/,
::google::protobuf::Closure* done)
{
qDebug("In %s", __PRETTY_FUNCTION__);

View File

@ -24,7 +24,9 @@ PcapPort::PcapPort(int id, const char *device)
{
if (strcmp(device, dev->name) == 0)
{
#ifndef Q_OS_WIN32
#ifdef Q_OS_WIN32
data_.set_name(QString("if%1 ").arg(id).toStdString());
#else
if (dev->name)
data_.set_name(dev->name);
#endif