mirror of
https://github.com/fwbuilder/fwbuilder
synced 2026-03-21 02:37:16 +01:00
address warnings gcc 4.3
This commit is contained in:
parent
3d11499301
commit
d35860e90a
@ -1,5 +1,9 @@
|
||||
2008-08-12 Vadim Kurland <vadim@vk.crocodile.org>
|
||||
|
||||
* ObjectListViewItem.cpp (ObjectListViewItem::operator<): (and
|
||||
several other places): code fixes to address warnings issued by
|
||||
gcc 4.3
|
||||
|
||||
* Helper.cpp (Helper::findInterfaceByNetzone): fixed bug in policy
|
||||
compiler for pix - it could not properly identify interface with
|
||||
network zone "any"
|
||||
|
||||
@ -229,7 +229,7 @@ void listObject(FWObject *obj, bool list_children, bool recursive,
|
||||
else
|
||||
{
|
||||
string format = list_format;
|
||||
while (replaceFirstMacroInString(format, obj));
|
||||
while (replaceFirstMacroInString(format, obj)) ;
|
||||
|
||||
string::size_type n;
|
||||
while ( (n=format.find("\\t"))!=string::npos )
|
||||
|
||||
@ -97,7 +97,7 @@ FWObject* FWObjectClipboard::getObject()
|
||||
|
||||
FWObject* FWObjectClipboard::getObjectByIdx (int idx)
|
||||
{
|
||||
if (idx < ids.size())
|
||||
if (idx < int(ids.size()))
|
||||
{
|
||||
pair<int,ProjectPanel*> p = ids[idx];
|
||||
return p.second->db()->findInIndex( p.first );
|
||||
|
||||
@ -37,59 +37,55 @@ using namespace libfwbuilder;
|
||||
|
||||
bool ObjectListViewItem::operator< ( const QTreeWidgetItem & other ) const
|
||||
{
|
||||
QTreeWidget * widget = treeWidget () ;
|
||||
if (widget!=NULL)
|
||||
QTreeWidget * widget = treeWidget() ;
|
||||
if (widget==NULL) return false;
|
||||
|
||||
int col = widget->sortColumn ();
|
||||
if (col==1)
|
||||
{
|
||||
int col = widget->sortColumn ();
|
||||
if (col==1)
|
||||
FWObject *right = ((ObjectListViewItem*)(&other))->getFWObject();
|
||||
FWObject *left = this->getFWObject();
|
||||
TCPUDPService * rtcpudp = TCPUDPService::cast(right);
|
||||
TCPUDPService * ltcpudp = TCPUDPService::cast(left);
|
||||
|
||||
IPService * rip = IPService::cast(right);
|
||||
IPService * lip = IPService::cast(left);
|
||||
|
||||
ICMPService * ricmp = ICMPService::cast(right);
|
||||
ICMPService * licmp = ICMPService::cast(left);
|
||||
if (rtcpudp != NULL && ltcpudp != NULL)
|
||||
{
|
||||
FWObject *right = ((ObjectListViewItem*)(&other))->getFWObject();
|
||||
FWObject *left = this->getFWObject();
|
||||
TCPUDPService * rtcpudp = TCPUDPService::cast(right);
|
||||
TCPUDPService * ltcpudp = TCPUDPService::cast(left);
|
||||
|
||||
IPService * rip = IPService::cast(right);
|
||||
IPService * lip = IPService::cast(left);
|
||||
|
||||
ICMPService * ricmp = ICMPService::cast(right);
|
||||
ICMPService * licmp = ICMPService::cast(left);
|
||||
if (rtcpudp != NULL && ltcpudp != NULL)
|
||||
int ls = ltcpudp->getDstRangeStart();
|
||||
int rs = rtcpudp->getDstRangeStart();
|
||||
if (ls<rs)
|
||||
return true ;
|
||||
else
|
||||
{
|
||||
int ls = ltcpudp->getDstRangeStart();
|
||||
int rs = rtcpudp->getDstRangeStart();
|
||||
if (ls<rs)
|
||||
return true ;
|
||||
else
|
||||
if (ls==rs)
|
||||
{
|
||||
if (ls==rs)
|
||||
{
|
||||
int le = ltcpudp->getDstRangeEnd();
|
||||
int re = rtcpudp->getDstRangeEnd();
|
||||
if (le<re)
|
||||
return true ;
|
||||
else
|
||||
return false ;
|
||||
}
|
||||
return false ;
|
||||
int le = ltcpudp->getDstRangeEnd();
|
||||
int re = rtcpudp->getDstRangeEnd();
|
||||
if (le<re)
|
||||
return true ;
|
||||
else
|
||||
return false ;
|
||||
}
|
||||
return false ;
|
||||
}
|
||||
if (rip != NULL && lip != NULL)
|
||||
{
|
||||
int lpn = lip->getProtocolNumber();
|
||||
int rpn = rip->getProtocolNumber();
|
||||
return (lpn < rpn);
|
||||
}
|
||||
if (ricmp != NULL && licmp != NULL)
|
||||
{
|
||||
int lpn = licmp->getInt("code");
|
||||
int rpn = ricmp->getInt("code");
|
||||
return (lpn < rpn);
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
if (rip != NULL && lip != NULL)
|
||||
{
|
||||
return QTreeWidgetItem::operator < (other);
|
||||
int lpn = lip->getProtocolNumber();
|
||||
int rpn = rip->getProtocolNumber();
|
||||
return (lpn < rpn);
|
||||
}
|
||||
if (ricmp != NULL && licmp != NULL)
|
||||
{
|
||||
int lpn = licmp->getInt("code");
|
||||
int rpn = ricmp->getInt("code");
|
||||
return (lpn < rpn);
|
||||
}
|
||||
|
||||
}
|
||||
return QTreeWidgetItem::operator < (other);
|
||||
}
|
||||
|
||||
@ -2564,11 +2564,13 @@ void ObjectManipulator::libChanged(int ln)
|
||||
ObjectTreeViewItem *otvi=dynamic_cast<ObjectTreeViewItem*>(lv->currentItem());
|
||||
|
||||
if (otvi == NULL)
|
||||
{
|
||||
if (lv->invisibleRootItem()->childCount() > 0)
|
||||
otvi = dynamic_cast<ObjectTreeViewItem*>(lv->invisibleRootItem()->child(0));
|
||||
otvi = dynamic_cast<ObjectTreeViewItem*>(
|
||||
lv->invisibleRootItem()->child(0));
|
||||
else
|
||||
assert(FALSE);
|
||||
|
||||
}
|
||||
currentObj=otvi->getFWObject();
|
||||
showObjectInTree( otvi );
|
||||
|
||||
|
||||
@ -181,10 +181,12 @@ QVariant RuleTableModel::headerData(int section,
|
||||
return f;
|
||||
}
|
||||
if (role == Qt::DecorationRole)
|
||||
{
|
||||
if (ruleSetView->rulesDisabled[section])
|
||||
return QVariant(ruleSetView->negIcon);
|
||||
else
|
||||
return QVariant(QIcon());
|
||||
}
|
||||
}
|
||||
|
||||
return QAbstractTableModel::headerData(section, orientation, role );
|
||||
|
||||
@ -156,6 +156,7 @@ void FakeWizard::showPage(const int page)
|
||||
(previousRelevant(page) > -1) );
|
||||
|
||||
if (titleLabel)
|
||||
{
|
||||
if (!pageTitles[page].isEmpty())
|
||||
{
|
||||
titleLabel->setText(pageTitles[page]);
|
||||
@ -163,7 +164,7 @@ void FakeWizard::showPage(const int page)
|
||||
}
|
||||
else
|
||||
titleLabel->hide();
|
||||
|
||||
}
|
||||
setCurrentPage(page);
|
||||
|
||||
stackedWidget->setCurrentIndex(page);
|
||||
|
||||
@ -254,7 +254,8 @@ void printerStream::printQTable(QTableView *tbl, bool left_margin, bool top_marg
|
||||
int tblHeight = tbl->horizontalHeader()->height();
|
||||
|
||||
int columnsWidth = 0;
|
||||
for (int i = 0; i < tbl->model()->columnCount(); columnsWidth += tbl->columnWidth(i), i++);
|
||||
for (int i = 0; i < tbl->model()->columnCount();
|
||||
columnsWidth += tbl->columnWidth(i), i++) ;
|
||||
|
||||
if ( tblHeight + tbl->rowHeight(0) > getYSpace() )
|
||||
{
|
||||
|
||||
@ -403,8 +403,6 @@ QString getAddrByName(const QString &name, int af_type)
|
||||
try
|
||||
{
|
||||
results = DNS::getHostByName(name.toAscii().constData(), af_type);
|
||||
if (fwbdebug) qDebug("utils::getAddrByName: obtained %ld addresses",
|
||||
results.size());
|
||||
} catch (FWException &e)
|
||||
{
|
||||
if (fwbdebug) qDebug("utils::getAddrByName: DNS lookup error: %s",
|
||||
@ -499,7 +497,7 @@ QString wordWrap(const QString& s, int maxchinline)
|
||||
else
|
||||
{
|
||||
res.append(s.mid(linestart,pos-linestart));
|
||||
while (++pos< s.length() && s.at(pos).isSpace());
|
||||
while (++pos< s.length() && s.at(pos).isSpace()) ;
|
||||
if (pos<s.length())
|
||||
{
|
||||
linestart=pos--;
|
||||
|
||||
@ -175,8 +175,10 @@ string OSConfigurator_pix_os::_printFixups()
|
||||
* ********************************************************************/
|
||||
|
||||
class InspectionProtocol;
|
||||
typedef enum { FIXUP_ENABLE=0, FIXUP_DISABLE=1, FIXUP_SKIP=2 } FixupTypes;
|
||||
|
||||
std::map<std::string,InspectionProtocol*> protocols;
|
||||
enum { FIXUP_ENABLE=0, FIXUP_DISABLE=1, FIXUP_SKIP=2 } fixupStatus;
|
||||
FixupTypes fixupStatus;
|
||||
|
||||
/*
|
||||
* par1 and par2 are parameters for the inspection protocol. These are
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user