Skip to content

Commit

Permalink
Fix building with clang 3.5 (abs->std::abs, unused vars)
Browse files Browse the repository at this point in the history
  • Loading branch information
vedranmiletic committed Mar 11, 2015
1 parent 3edd12c commit 7967235
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
10 changes: 5 additions & 5 deletions src/internet/model/rtt-estimator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -170,23 +170,23 @@ RttMeanDeviation::CheckForReciprocalPowerOfTwo (double val) const
return 0;
}
// supports 1/32, 1/16, 1/8, 1/4, 1/2
if (abs (1/val - 8) < TOLERANCE)
if (std::abs (1/val - 8) < TOLERANCE)
{
return 3;
}
if (abs (1/val - 4) < TOLERANCE)
if (std::abs (1/val - 4) < TOLERANCE)
{
return 2;
}
if (abs (1/val - 32) < TOLERANCE)
if (std::abs (1/val - 32) < TOLERANCE)
{
return 5;
}
if (abs (1/val - 16) < TOLERANCE)
if (std::abs (1/val - 16) < TOLERANCE)
{
return 4;
}
if (abs (1/val - 2) < TOLERANCE)
if (std::abs (1/val - 2) < TOLERANCE)
{
return 1;
}
Expand Down
8 changes: 2 additions & 6 deletions src/wave/helper/wave-helper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include "ns3/wave-net-device.h"
#include "ns3/minstrel-wifi-manager.h"
#include "ns3/radiotap-header.h"
#include "ns3/unused.h"
#include "wave-mac-helper.h"
#include "wave-helper.h"

Expand Down Expand Up @@ -484,12 +485,7 @@ WaveHelper::Install (const WifiPhyHelper &phyHelper, const WifiMacHelper &macHe
try
{
const QosWaveMacHelper& qosMac = dynamic_cast<const QosWaveMacHelper&> (macHelper);
// below check will never fail, just used for survive from
// gcc warn "-Wunused-but-set-variable"
if (&qosMac == 0)
{
NS_FATAL_ERROR ("it could never get here");
}
NS_UNUSED (qosMac);
}
catch (const std::bad_cast &)
{
Expand Down

0 comments on commit 7967235

Please sign in to comment.