wave: (fixes #2554) fix static analysis warning

This commit is contained in:
Natale Patriciello
2017-04-06 21:52:28 -07:00
parent 54b20047fd
commit 083a0b7b89

View File

@@ -76,35 +76,19 @@ Wifi80211pHelper::EnableLogComponents (void)
NetDeviceContainer
Wifi80211pHelper::Install (const WifiPhyHelper &phyHelper, const WifiMacHelper &macHelper, NodeContainer c) const
{
bool isWaveMacHelper = false;
try
QosWaveMacHelper const * qosMac = dynamic_cast <QosWaveMacHelper const *> (&macHelper);
if (qosMac == 0)
{
const QosWaveMacHelper& qosMac = dynamic_cast<const QosWaveMacHelper&> (macHelper);
isWaveMacHelper = true;
NS_UNUSED (qosMac);
}
catch (const std::bad_cast &)
{
}
try
{
const NqosWaveMacHelper& nqosMac = dynamic_cast<const NqosWaveMacHelper&> (macHelper);
isWaveMacHelper = true;
NqosWaveMacHelper const * nqosMac = dynamic_cast <NqosWaveMacHelper const *> (&macHelper);
if (nqosMac == 0)
{
NS_FATAL_ERROR ("the macHelper should be either QosWaveMacHelper or NqosWaveMacHelper"
", or should be the subclass of QosWaveMacHelper or NqosWaveMacHelper");
}
NS_UNUSED (nqosMac);
}
catch (const std::bad_cast &)
{
}
if (!isWaveMacHelper)
{
NS_FATAL_ERROR ("the macHelper should be either QosWaveMacHelper or NqosWaveMacHelper"
", or should be the subclass of QosWaveMacHelper or NqosWaveMacHelper");
}
NS_UNUSED (qosMac);
return WifiHelper::Install (phyHelper, macHelper, c);
}