Fixes for 64bit compilation and Qt4.6
This commit is contained in:
parent
2e77fd8b94
commit
35f4a8bafb
3
Makefile
3
Makefile
@ -1,3 +1,4 @@
|
|||||||
|
debug: QMAKE_CONFIG=-config debug
|
||||||
release: QMAKE_CONFIG=-config release
|
release: QMAKE_CONFIG=-config release
|
||||||
|
|
||||||
all:
|
all:
|
||||||
@ -7,7 +8,7 @@ all:
|
|||||||
$(MAKE) -C client
|
$(MAKE) -C client
|
||||||
|
|
||||||
release: qmake all
|
release: qmake all
|
||||||
|
debug: qmake all
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
-$(MAKE) -C client $@
|
-$(MAKE) -C client $@
|
||||||
|
@ -18,13 +18,15 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
|
#include "../common/protocolmanager.h"
|
||||||
|
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
|
|
||||||
QSettings *appSettings;
|
extern ProtocolManager *OstProtocolManager;
|
||||||
|
|
||||||
|
QSettings *appSettings;
|
||||||
QMainWindow *mainWindow;
|
QMainWindow *mainWindow;
|
||||||
|
|
||||||
int main(int argc, char* argv[])
|
int main(int argc, char* argv[])
|
||||||
@ -32,6 +34,8 @@ int main(int argc, char* argv[])
|
|||||||
QApplication app(argc, argv);
|
QApplication app(argc, argv);
|
||||||
int exitCode;
|
int exitCode;
|
||||||
|
|
||||||
|
OstProtocolManager = new ProtocolManager();
|
||||||
|
|
||||||
/* (Portable Mode) If we have a .ini file in the same directory as the
|
/* (Portable Mode) If we have a .ini file in the same directory as the
|
||||||
executable, we use that instead of the platform specific location
|
executable, we use that instead of the platform specific location
|
||||||
and format for the settings */
|
and format for the settings */
|
||||||
|
@ -130,28 +130,28 @@ QVariant PortStatsModel::data(const QModelIndex &index, int role) const
|
|||||||
|
|
||||||
// Statistics
|
// Statistics
|
||||||
case e_STAT_FRAMES_RCVD:
|
case e_STAT_FRAMES_RCVD:
|
||||||
return stats.rx_pkts();
|
return quint64(stats.rx_pkts());
|
||||||
|
|
||||||
case e_STAT_FRAMES_SENT:
|
case e_STAT_FRAMES_SENT:
|
||||||
return stats.tx_pkts();
|
return quint64(stats.tx_pkts());
|
||||||
|
|
||||||
case e_STAT_FRAME_SEND_RATE:
|
case e_STAT_FRAME_SEND_RATE:
|
||||||
return stats.tx_pps();
|
return quint64(stats.tx_pps());
|
||||||
|
|
||||||
case e_STAT_FRAME_RECV_RATE:
|
case e_STAT_FRAME_RECV_RATE:
|
||||||
return stats.rx_pps();
|
return quint64(stats.rx_pps());
|
||||||
|
|
||||||
case e_STAT_BYTES_RCVD:
|
case e_STAT_BYTES_RCVD:
|
||||||
return stats.rx_bytes();
|
return quint64(stats.rx_bytes());
|
||||||
|
|
||||||
case e_STAT_BYTES_SENT:
|
case e_STAT_BYTES_SENT:
|
||||||
return stats.tx_bytes();
|
return quint64(stats.tx_bytes());
|
||||||
|
|
||||||
case e_STAT_BYTE_SEND_RATE:
|
case e_STAT_BYTE_SEND_RATE:
|
||||||
return stats.tx_bps();
|
return quint64(stats.tx_bps());
|
||||||
|
|
||||||
case e_STAT_BYTE_RECV_RATE:
|
case e_STAT_BYTE_RECV_RATE:
|
||||||
return stats.rx_bps();
|
return quint64(stats.rx_bps());
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
case e_STAT_FRAMES_RCVD_NIC:
|
case e_STAT_FRAMES_RCVD_NIC:
|
||||||
|
@ -28,7 +28,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
|
|||||||
|
|
||||||
// FIXME(HI) - remove
|
// FIXME(HI) - remove
|
||||||
#include "../common/protocolmanager.h"
|
#include "../common/protocolmanager.h"
|
||||||
extern ProtocolManager OstProtocolManager;
|
extern ProtocolManager *OstProtocolManager;
|
||||||
|
|
||||||
int StreamConfigDialog::lastTopLevelTabIndex = 0;
|
int StreamConfigDialog::lastTopLevelTabIndex = 0;
|
||||||
|
|
||||||
@ -95,7 +95,7 @@ StreamConfigDialog::StreamConfigDialog(Port &port, uint streamIndex,
|
|||||||
|
|
||||||
if (id2 != ButtonIdNone && id2 != ButtonIdOther)
|
if (id2 != ButtonIdNone && id2 != ButtonIdOther)
|
||||||
{
|
{
|
||||||
if (OstProtocolManager.isValidNeighbour(id1, id2))
|
if (OstProtocolManager->isValidNeighbour(id1, id2))
|
||||||
{
|
{
|
||||||
connect(btn1, SIGNAL(toggled(bool)),
|
connect(btn1, SIGNAL(toggled(bool)),
|
||||||
btn2, SLOT(setEnabled(bool)));
|
btn2, SLOT(setEnabled(bool)));
|
||||||
@ -117,7 +117,7 @@ StreamConfigDialog::StreamConfigDialog(Port &port, uint streamIndex,
|
|||||||
}
|
}
|
||||||
|
|
||||||
mpAvailableProtocolsModel = new QStringListModel(
|
mpAvailableProtocolsModel = new QStringListModel(
|
||||||
OstProtocolManager.protocolDatabase(), this);
|
OstProtocolManager->protocolDatabase(), this);
|
||||||
lvAllProtocols->setModel(mpAvailableProtocolsModel);
|
lvAllProtocols->setModel(mpAvailableProtocolsModel);
|
||||||
mpSelectedProtocolsModel = new QStringListModel(this);
|
mpSelectedProtocolsModel = new QStringListModel(this);
|
||||||
lvSelectedProtocols->setModel(mpSelectedProtocolsModel);
|
lvSelectedProtocols->setModel(mpSelectedProtocolsModel);
|
||||||
@ -375,7 +375,7 @@ void StreamConfigDialog::on_tbAdd_clicked()
|
|||||||
}
|
}
|
||||||
|
|
||||||
foreach(QModelIndex idx, selection)
|
foreach(QModelIndex idx, selection)
|
||||||
_iter->insert(OstProtocolManager.createProtocol(
|
_iter->insert(OstProtocolManager->createProtocol(
|
||||||
mpAvailableProtocolsModel->stringList().at(idx.row()), mpStream));
|
mpAvailableProtocolsModel->stringList().at(idx.row()), mpStream));
|
||||||
|
|
||||||
updateSelectProtocolsAdvancedWidget();
|
updateSelectProtocolsAdvancedWidget();
|
||||||
@ -689,7 +689,7 @@ void StreamConfigDialog::__updateProtocol(int level, int newId)
|
|||||||
switch (oldId)
|
switch (oldId)
|
||||||
{
|
{
|
||||||
case ButtonIdNone:
|
case ButtonIdNone:
|
||||||
_iter->insert(OstProtocolManager.createProtocol(
|
_iter->insert(OstProtocolManager->createProtocol(
|
||||||
newId, mpStream));
|
newId, mpStream));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -699,7 +699,7 @@ void StreamConfigDialog::__updateProtocol(int level, int newId)
|
|||||||
p =_iter->next();
|
p =_iter->next();
|
||||||
|
|
||||||
if (newId)
|
if (newId)
|
||||||
_iter->setValue(OstProtocolManager.createProtocol(
|
_iter->setValue(OstProtocolManager->createProtocol(
|
||||||
newId, mpStream));
|
newId, mpStream));
|
||||||
else
|
else
|
||||||
_iter->remove();
|
_iter->remove();
|
||||||
|
@ -215,7 +215,6 @@ QVariant IcmpProtocol::fieldData(int index, FieldAttrib attrib,
|
|||||||
cksum = 0; // avoid the 'maybe used unitialized' warning
|
cksum = 0; // avoid the 'maybe used unitialized' warning
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
printf("%s: attrib = %d, cksum = %d\n", __FUNCTION__, attrib, cksum);
|
|
||||||
|
|
||||||
switch(attrib)
|
switch(attrib)
|
||||||
{
|
{
|
||||||
|
@ -33,12 +33,12 @@ ProtocolListIterator::~ProtocolListIterator()
|
|||||||
|
|
||||||
bool ProtocolListIterator::findNext(const AbstractProtocol* value) const
|
bool ProtocolListIterator::findNext(const AbstractProtocol* value) const
|
||||||
{
|
{
|
||||||
return _iter->findNext((AbstractProtocol*)((uint)value));
|
return _iter->findNext(const_cast<AbstractProtocol*>(value));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ProtocolListIterator::findPrevious(const AbstractProtocol* value)
|
bool ProtocolListIterator::findPrevious(const AbstractProtocol* value)
|
||||||
{
|
{
|
||||||
return _iter->findPrevious((AbstractProtocol*)((uint)value));
|
return _iter->findPrevious(const_cast<AbstractProtocol*>(value));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ProtocolListIterator::hasNext() const
|
bool ProtocolListIterator::hasNext() const
|
||||||
@ -69,7 +69,7 @@ void ProtocolListIterator::insert(AbstractProtocol* value)
|
|||||||
else
|
else
|
||||||
value->next = NULL;
|
value->next = NULL;
|
||||||
|
|
||||||
_iter->insert((AbstractProtocol*)((uint)value));
|
_iter->insert(const_cast<AbstractProtocol*>(value));
|
||||||
}
|
}
|
||||||
|
|
||||||
AbstractProtocol* ProtocolListIterator::next()
|
AbstractProtocol* ProtocolListIterator::next()
|
||||||
@ -109,7 +109,7 @@ void ProtocolListIterator::setValue(AbstractProtocol* value) const
|
|||||||
_iter->value()->next->prev = value;
|
_iter->value()->next->prev = value;
|
||||||
value->prev = _iter->value()->prev;
|
value->prev = _iter->value()->prev;
|
||||||
value->next = _iter->value()->next;
|
value->next = _iter->value()->next;
|
||||||
_iter->setValue((AbstractProtocol*)((uint)value));
|
_iter->setValue(const_cast<AbstractProtocol*>(value));
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProtocolListIterator::toBack()
|
void ProtocolListIterator::toBack()
|
||||||
|
@ -39,7 +39,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
|
|||||||
#include "userscript.h"
|
#include "userscript.h"
|
||||||
#include "sample.h"
|
#include "sample.h"
|
||||||
|
|
||||||
ProtocolManager OstProtocolManager;
|
ProtocolManager *OstProtocolManager;
|
||||||
|
|
||||||
ProtocolManager::ProtocolManager()
|
ProtocolManager::ProtocolManager()
|
||||||
{
|
{
|
||||||
|
@ -23,7 +23,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
|
|||||||
#include "protocollistiterator.h"
|
#include "protocollistiterator.h"
|
||||||
#include "protocolmanager.h"
|
#include "protocolmanager.h"
|
||||||
|
|
||||||
extern ProtocolManager OstProtocolManager;
|
extern ProtocolManager *OstProtocolManager;
|
||||||
|
|
||||||
StreamBase::StreamBase() :
|
StreamBase::StreamBase() :
|
||||||
mStreamId(new OstProto::StreamId),
|
mStreamId(new OstProto::StreamId),
|
||||||
@ -39,12 +39,12 @@ StreamBase::StreamBase() :
|
|||||||
|
|
||||||
iter = createProtocolListIterator();
|
iter = createProtocolListIterator();
|
||||||
// By default newly created streams have the mac and payload protocols
|
// By default newly created streams have the mac and payload protocols
|
||||||
proto = OstProtocolManager.createProtocol(
|
proto = OstProtocolManager->createProtocol(
|
||||||
OstProto::Protocol::kMacFieldNumber, this);
|
OstProto::Protocol::kMacFieldNumber, this);
|
||||||
iter->insert(proto);
|
iter->insert(proto);
|
||||||
qDebug("stream: mac = %p", proto);
|
qDebug("stream: mac = %p", proto);
|
||||||
|
|
||||||
proto = OstProtocolManager.createProtocol(
|
proto = OstProtocolManager->createProtocol(
|
||||||
OstProto::Protocol::kPayloadFieldNumber, this);
|
OstProto::Protocol::kPayloadFieldNumber, this);
|
||||||
iter->insert(proto);
|
iter->insert(proto);
|
||||||
qDebug("stream: payload = %p", proto);
|
qDebug("stream: payload = %p", proto);
|
||||||
@ -89,7 +89,7 @@ void StreamBase::protoDataCopyFrom(const OstProto::Stream &stream)
|
|||||||
iter = createProtocolListIterator();
|
iter = createProtocolListIterator();
|
||||||
for (int i=0; i < stream.protocol_size(); i++)
|
for (int i=0; i < stream.protocol_size(); i++)
|
||||||
{
|
{
|
||||||
proto = OstProtocolManager.createProtocol(
|
proto = OstProtocolManager->createProtocol(
|
||||||
stream.protocol(i).protocol_id().id(), this);
|
stream.protocol(i).protocol_id().id(), this);
|
||||||
proto->protoDataCopyFrom(stream.protocol(i));
|
proto->protoDataCopyFrom(stream.protocol(i));
|
||||||
iter->insert(proto);
|
iter->insert(proto);
|
||||||
@ -208,7 +208,7 @@ quint16 StreamBase::frameLen(int streamIndex) const
|
|||||||
case OstProto::StreamCore::e_fl_random:
|
case OstProto::StreamCore::e_fl_random:
|
||||||
//! \todo (MED) This 'random' sequence is same across iterations
|
//! \todo (MED) This 'random' sequence is same across iterations
|
||||||
pktLen = 64; // to avoid the 'maybe used uninitialized' warning
|
pktLen = 64; // to avoid the 'maybe used uninitialized' warning
|
||||||
qsrand(((uint) this));
|
qsrand(reinterpret_cast<ulong>(this));
|
||||||
for (int i = 0; i <= streamIndex; i++)
|
for (int i = 0; i <= streamIndex; i++)
|
||||||
pktLen = qrand();
|
pktLen = qrand();
|
||||||
pktLen = frameLenMin() + (pktLen %
|
pktLen = frameLenMin() + (pktLen %
|
||||||
|
@ -19,12 +19,17 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
|
|||||||
|
|
||||||
#include "drone.h"
|
#include "drone.h"
|
||||||
|
|
||||||
|
#include "../common/protocolmanager.h"
|
||||||
|
|
||||||
|
extern ProtocolManager *OstProtocolManager;
|
||||||
|
|
||||||
int myport;
|
int myport;
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
QApplication app(argc, argv);
|
QApplication app(argc, argv);
|
||||||
Drone drone;
|
Drone drone;
|
||||||
|
OstProtocolManager = new ProtocolManager();
|
||||||
|
|
||||||
app.setApplicationName(drone.objectName());
|
app.setApplicationName(drone.objectName());
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user