1
0
mirror of https://github.com/fwbuilder/fwbuilder synced 2026-06-24 01:49:36 +02:00

fix: Disable unused variables and parameters

This commit is contained in:
Sirius Bakke
2016-05-23 16:35:28 +02:00
parent 5b494b985e
commit d89280d8fe
17 changed files with 35 additions and 5 deletions

View File

@@ -72,6 +72,8 @@ PolicyRule* AutomaticRules::addMgmtRule(
const string &label,
bool related)
{
(void) related; // Unused
if (ruleset == NULL) return NULL;
/* Insert PolicyRules at top so they do not get shadowed by other

View File

@@ -52,6 +52,8 @@ bool junosInterfaces::basicValidateInterfaceName(Interface *,
const QString &obj_name,
QString &err)
{
(void) obj_name; (void) err; // Unused
return true;
}
@@ -59,6 +61,8 @@ bool junosInterfaces::isValidVlanInterfaceName(const QString &subint_name,
const QString &parent_name,
QString &err)
{
(void) parent_name; // Unused
if (!looksLikeVlanInterface(subint_name))
{
err = QObject::tr("'%1' is not a valid unit name")

View File

@@ -65,6 +65,8 @@ bool linux24Interfaces::basicValidateInterfaceName(Interface *intf,
const QString &obj_name,
QString &err)
{
(void) intf; // Unused
if (obj_name.indexOf(' ') != -1)
{
err = QObject::tr("Bridge interface name '%1' can not contain white space").arg(obj_name);

View File

@@ -113,6 +113,8 @@ void expand_interface_with_phys_address(Compiler *compiler,
std::list<FWObject*> &ol1,
std::list<FWObject*> &list_result)
{
(void) rule; // Unused
std::list<FWObject*> lipaddr;
std::list<FWObject*> lother;
physAddress *pa = NULL;

View File

@@ -528,6 +528,8 @@ void PolicyCompiler_junosacl::compile()
string PolicyCompiler_junosacl::printAccessGroupCmd(ciscoACL *acl, bool neg)
{
(void) neg; // Unused
ostringstream str;
string addr_family_prefix = "inet";

View File

@@ -123,6 +123,8 @@ xmlNodePtr DNSName::toXML(xmlNodePtr parent) throw(FWException)
void DNSName::loadFromSource(bool ipv6, FWOptions *options,
bool test_mode) throw(FWException)
{
(void) options; // Unused
int af_type = (ipv6)?AF_INET6:AF_INET;
try
{

View File

@@ -148,6 +148,8 @@ bool DynamicGroup::isCompileTime() const
void DynamicGroup::loadFromSource(bool ipv6, FWOptions *options, bool test_mode)
throw (FWException)
{
(void) ipv6; (void) options; (void) test_mode; // Unused
FWObjectDatabase *root = getRoot();
FWObject::tree_iterator tree_iter;

View File

@@ -439,7 +439,7 @@ class RoutingRule : public Rule
RoutingRuleTypes rule_type;
std::string sorted_dst_ids;
int ecmp_id;
// int ecmp_id; // Unused
public:

View File

@@ -48,6 +48,8 @@ QWidget *DynamicItemDelegate::createEditor(QWidget *parent,
const QStyleOptionViewItem &option,
const QModelIndex &index) const
{
Q_UNUSED(option)
if (index.column() == 0) {
QToolButton *button = new QToolButton(parent);
QPixmap pixmap;
@@ -71,6 +73,8 @@ QWidget *DynamicItemDelegate::createEditor(QWidget *parent,
void DynamicItemDelegate::comboActivated(int abc)
{
Q_UNUSED(abc)
/* Don't wait until we lose focus on the combobox */
emit commitData(dynamic_cast<QWidget *>(sender()));
}
@@ -307,6 +311,7 @@ void DynamicGroupDialog::loadFWObject(FWObject *o)
void DynamicGroupDialog::validate(bool *result)
{
Q_UNUSED(result)
}

View File

@@ -75,7 +75,7 @@ class HttpGet : public QObject
public:
HttpGet(QObject *parent = 0);
bool get(const QUrl &url) { return false; }
bool get(const QUrl &url) { Q_UNUSED(url) return false; }
QString getLastError() { return QString("HttpGet is disabled when compiled with Qt 5"); }
bool getStatus() { return false; }
QString toString() { return QString(); }
@@ -85,7 +85,7 @@ signals:
void done(const QString &res);
private slots:
void httpDone(int id, bool error) {}
void httpDone(int id, bool error) { Q_UNUSED(id) Q_UNUSED(error) }
void fileDone() {}
};

View File

@@ -1271,6 +1271,7 @@ int RuleSetModel::getRulePosition(QModelIndex index)
void RuleSetModel::objectChanged(FWObject* object)
{
Q_UNUSED(object)
/*
* See #2373
*

View File

@@ -2861,6 +2861,9 @@ void RuleSetView::updateColumnSizeForIndex(QModelIndex index)
void RuleSetView::updateSectionSizesForIndex(QModelIndex idx1, QModelIndex idx2)
{
Q_UNUSED(idx1)
Q_UNUSED(idx2)
updateAllColumnsSize();
}

View File

@@ -612,7 +612,7 @@ QSize RuleSetViewDelegate::calculateCellSizeForObject(const QModelIndex & index)
}
}
QSize res = QSize(w+HORIZONTAL_MARGIN*2,h);
QModelIndex idx = index;
// QModelIndex idx = index; // Unused
return res;
}

View File

@@ -38,6 +38,8 @@ TutorialDialog::TutorialDialog(QString tutorial, QWidget *parent) :
QDialog(NULL),
ui(new Ui::TutorialDialog_q)
{
Q_UNUSED(parent)
ui->setupUi(this);
setWindowFlags(Qt::Window | Qt::WindowTitleHint | Qt::CustomizeWindowHint | Qt::WindowMinimizeButtonHint);
#if QT_VERSION >= 0x040500

View File

@@ -98,6 +98,8 @@ static bool decendingLessThan(const _item_data &s1, const _item_data &s2)
void ListOfLibrariesModel::sort(int column, Qt::SortOrder order)
{
Q_UNUSED(column)
QList<_item_data> list;
for (int i=0; i<rowCount(); ++i)
{

View File

@@ -100,7 +100,7 @@ void newClusterDialog::setFirewallList(std::vector<libfwbuilder::FWObject*> data
{
m_dialog->interfaceSelector->clear();
firewallList.clear();
typedef QPair<Firewall*, bool> fwpair;
//typedef QPair<Firewall*, bool> fwpair; // Unused
foreach ( FWObject *fw, data )
firewallList.push_back(Firewall::cast(fw));
m_dialog->firewallSelector->setFirewallList(firewallList, select);

View File

@@ -96,6 +96,7 @@ QString CompilerDriver_ipf::composeActivationCommand(libfwbuilder::Firewall *fw,
QString CompilerDriver_ipf::assembleManifest(Cluster*, Firewall* fw, bool )
{
(void) fw; // Unused
QString remote_name = remote_file_names[FW_FILE];
QString remote_ipf_name = remote_file_names[CONF1_FILE];
QString remote_nat_name = remote_file_names[CONF2_FILE];