build fixes for gcc 4.6

This commit is contained in:
Andrey Mazo
2011-04-17 14:54:42 +02:00
parent af275c07eb
commit d3344cbbb8
31 changed files with 34 additions and 96 deletions

View File

@@ -1397,7 +1397,6 @@ RoutingProtocol::RecvError (Ptr<Packet> p, Ipv4Address src )
{
if (i->first == un.first)
{
Ipv4Address dst = un.first;
unreachable.insert (un);
}
}

View File

@@ -72,7 +72,6 @@ RequestQueue::DropPacketWithDst (Ipv4Address dst)
{
NS_LOG_FUNCTION (this << dst);
Purge ();
const Ipv4Address addr = dst;
for (std::vector<QueueEntry>::iterator i = m_queue.begin (); i
!= m_queue.end (); ++i)
{

View File

@@ -82,7 +82,6 @@ MapScheduler::RemoveNext (void)
NS_LOG_FUNCTION (this);
EventMapI i = m_list.begin ();
NS_ASSERT (i != m_list.end ());
std::pair<Scheduler::EventKey, EventImpl*> next = *i;
Event ev;
ev.impl = i->second;
ev.key = i->first;

View File

@@ -84,7 +84,6 @@ PacketQueue::DropPacketWithDst (Ipv4Address dst)
{
NS_LOG_FUNCTION ("Dropping packet to " << dst);
Purge ();
const Ipv4Address addr = dst;
for (std::vector<QueueEntry>::iterator i = m_queue.begin (); i
!= m_queue.end (); ++i)
{

View File

@@ -334,7 +334,6 @@ BasicEnergyDepletionTest::DepletionTestCase (double simTimeS,
// set energy to 0 so that we deplete energy at the beginning of simulation
basicSourceHelper.Set ("BasicEnergySourceInitialEnergyJ", DoubleValue (0.0));
// set update interval
Time updateInterval = Seconds (1.0);
basicSourceHelper.Set ("PeriodicEnergyUpdateInterval",
TimeValue (Seconds (updateIntervalS)));
// install source

View File

@@ -82,8 +82,7 @@ Icmpv4Header::Deserialize (Buffer::Iterator start)
{
m_type = start.ReadU8 ();
m_code = start.ReadU8 ();
uint16_t checksum;
checksum = start.ReadNtohU16 ();
start.Next (2); // uint16_t checksum = start.ReadNtohU16 ();
return 4;
}
void

View File

@@ -1368,13 +1368,11 @@ uint32_t Icmpv6OptionHeader::GetSerializedSize () const
uint32_t Icmpv6OptionHeader::Deserialize (Buffer::Iterator start)
{
Buffer::Iterator i = start;
return GetSerializedSize ();
}
void Icmpv6OptionHeader::Serialize (Buffer::Iterator start) const
{
Buffer::Iterator i = start;
}
NS_OBJECT_ENSURE_REGISTERED (Icmpv6OptionMtu);

View File

@@ -371,7 +371,6 @@ Ipv4StaticRouting::GetDefaultRoute ()
uint32_t metric = i->second;
Ipv4Mask mask = (j)->GetDestNetworkMask ();
uint16_t masklen = mask.GetPrefixLength ();
Ipv4Address entry = (j)->GetDestNetwork ();
if (masklen != 0)
{
continue;

View File

@@ -170,10 +170,6 @@ void RttEstimator::ClearSent ()
void RttEstimator::IncreaseMultiplier ()
{
double a;
a = multiplier * 2.0;
double b;
b = m_maxMultiplier * 2.0;
multiplier = std::min (multiplier * 2.0, m_maxMultiplier);
}

View File

@@ -97,7 +97,6 @@ HwmpProtocolMac::ReceiveAction (Ptr<Packet> packet, const WifiMacHeader & header
m_stats.rxMgtBytes += packet->GetSize ();
WifiActionHeader actionHdr;
packet->RemoveHeader (actionHdr);
WifiActionHeader::ActionValue actionValue = actionHdr.GetAction ();
if (actionHdr.GetCategory () != WifiActionHeader::MESH_PATH_SELECTION)
{
return true;

View File

@@ -139,6 +139,10 @@ IeConfiguration::DeserializeInformationField (Buffer::Iterator i, uint8_t length
Buffer::Iterator start = i;
uint8_t version;
version = i.ReadU8 ();
if (version != 1)
{
NS_FATAL_ERROR ("Other versions not supported yet");
}
// Active Path Selection Protocol ID:
m_APSPId = (dot11sPathSelectionProtocol) i.ReadLsbtohU32 ();
// Active Path Metric ID:

View File

@@ -158,7 +158,6 @@ PeerManagementProtocolMac::UpdateOutcomingFrame (Ptr<Packet> packet, WifiMacHead
{
WifiActionHeader actionHdr;
packet->PeekHeader (actionHdr);
WifiActionHeader::ActionValue actionValue = actionHdr.GetAction ();
if (actionHdr.GetCategory () == WifiActionHeader::MESH_PEERING_MGT)
{
return true;

View File

@@ -405,7 +405,6 @@ MeshWifiInterfaceMac::Receive (Ptr<Packet> packet, WifiMacHeader const *hdr)
{
m_stats.recvBeacons++;
MgtBeaconHeader beacon_hdr;
Mac48Address from = hdr->GetAddr2 ();
packet->PeekHeader (beacon_hdr);

View File

@@ -399,8 +399,7 @@ bool
IsNumber (const string& s)
{
char *endp;
double unused;
unused = strtod (s.c_str (), &endp); // declared with warn_unused_result
(void) strtod (s.c_str (), &endp); // declared with warn_unused_result
return endp == s.c_str () + s.size ();
}

View File

@@ -843,7 +843,6 @@ Buffer::Iterator::Write (Iterator start, Iterator end)
NS_ASSERT (start.m_zeroEnd == end.m_zeroEnd);
NS_ASSERT (m_data != start.m_data);
uint32_t size = end.m_current - start.m_current;
Iterator cur = start;
NS_ASSERT_MSG (CheckNoZero (m_current, m_current + size),
GetWriteErrorMessage ());
if (start.m_current <= start.m_zeroStart)

View File

@@ -784,6 +784,8 @@ PacketMetadataTest::DoRun (void)
p1 = p->CreateFragment (0,6);
p2 = p->CreateFragment (6,535-6);
p1->AddAtEnd(p2);
NS_TEST_EXPECT_MSG_EQ(result, true, "PacketMetadataTest failed");
}
//-----------------------------------------------------------------------------
class PacketMetadataTestSuite : public TestSuite

View File

@@ -60,7 +60,6 @@ NS_LOG_COMPONENT_DEFINE ("CampusNetworkModel");
void Progress ()
{
Time now = Simulator::Now ();
Simulator::Schedule (Seconds (0.1), Progress);
}

View File

@@ -67,9 +67,9 @@ PointToPointRemoteChannel::TransmitStart (
uint32_t wire = src == GetSource (0) ? 0 : 1;
Ptr<PointToPointNetDevice> dst = GetDestination (wire);
#ifdef NS3_MPI
// Calculate the rxTime (absolute)
Time rxTime = Simulator::Now () + txTime + GetDelay ();
#ifdef NS3_MPI
MpiInterface::SendPacket (p, rxTime, dst->GetNode ()->GetId (), dst->GetIfIndex ());
#else
NS_FATAL_ERROR ("Can't use distributed simulator without MPI compiled in");

View File

@@ -118,7 +118,6 @@ SpectrumValueTestSuite::SpectrumValueTestSuite ()
Ptr<SpectrumModel> f = Create<SpectrumModel> (freqs);
SpectrumValue v1 (f), v2 (f), v3 (f), v4 (f), v5 (f), v6 (f), v7 (f), v8 (f), v9 (f), v10 (f);
double nv1, nv2;
double doubleValue;
@@ -185,16 +184,6 @@ SpectrumValueTestSuite::SpectrumValueTestSuite ()
v10[3] = -0.794244913190;
v10[4] = 0.878579343459;
nv1 = 1.76957619675970;
nv2 = 1.68451062071783;
// std::cerr.precision(15);
// std::cerr<< nv1 << " "<< v1.Norm() << std::endl;
SpectrumValue tv3 (f), tv4 (f), tv5 (f), tv6 (f);
tv3 = v1 + v2;

View File

@@ -86,8 +86,8 @@ RocketfuelTopologyReader::GenerateFromMapsFile (int argc, char *argv[])
std::string nuid;
bool dns = false;
bool bb = false;
int num_neigh = 0;
int ext_conn = 0;
int num_neigh_s = 0;
unsigned int num_neigh = 0;
int radius = 0;
std::vector <std::string> neigh_list;
NodeContainer nodes;
@@ -101,12 +101,15 @@ RocketfuelTopologyReader::GenerateFromMapsFile (int argc, char *argv[])
if (argv[3])
bb = true;
num_neigh = ::atoi (argv[4]);
/* the first char should be '&' */
if (argv[5])
num_neigh_s = ::atoi (argv[4]);
if (num_neigh_s < 0)
{
ext_conn = ::atoi (&argv[5][1]);
num_neigh = 0;
NS_LOG_WARN ("Negative number of neighbors given");
}
else
{
num_neigh = num_neigh_s;
}
/* neighbors */
@@ -120,6 +123,10 @@ RocketfuelTopologyReader::GenerateFromMapsFile (int argc, char *argv[])
neigh_list.push_back (nbr + 1);
}
}
if (num_neigh != neigh_list.size ())
{
NS_LOG_WARN ("Given number of neighbors = " << num_neigh << " != size of neighbors list = " << neigh_list.size ());
}
/* externs */
if (argv[7])
@@ -187,13 +194,12 @@ RocketfuelTopologyReader::GenerateFromWeightsFile (int argc, char *argv[])
/* uid @loc [+] [bb] (num_neigh) [&ext] -> <nuid-1> <nuid-2> ... {-euid} ... =name[!] rn */
std::string sname;
std::string tname;
double weight;
char *endptr;
NodeContainer nodes;
sname = argv[0];
tname = argv[1];
weight = strtod (argv[2], &endptr);
(void) strtod (argv[2], &endptr); // weight
if (*endptr != '\0')
{
NS_LOG_WARN ("invalid weight: " << argv[2]);

View File

@@ -139,8 +139,6 @@ UanPhyCalcSinrFhFsk::CalcSinrDb (Ptr<Packet> pkt,
double clearingTime = (m_hops - 1.0) * ts;
double csp = pdp.SumTapsFromMaxNc (Seconds (0), Seconds (ts));
UanPdp::Iterator tmpIt = pdp.GetBegin ();
// Get maximum arrival offset
double maxAmp = -1;
double maxTapDelay = 0.0;

View File

@@ -245,8 +245,7 @@ UanTest::DoRun (void)
#endif // UAN_PROP_BH_INSTALLED
bool phyTestsError;
phyTestsError = DoPhyTests ();
DoPhyTests ();
}

View File

@@ -390,8 +390,6 @@ DcfManager::RequestAccess (DcfState *state)
void
DcfManager::DoGrantAccess (void)
{
Time accessGrantStart = GetAccessGrantStart ();
uint32_t k = 0;
for (States::const_iterator i = m_states.begin (); i != m_states.end (); k++)
{

View File

@@ -253,7 +253,6 @@ WifiNetDevice::Send (Ptr<Packet> packet, const Address& dest, uint16_t protocolN
NS_ASSERT (Mac48Address::IsMatchingType (dest));
Mac48Address realTo = Mac48Address::ConvertFrom (dest);
Mac48Address realFrom = Mac48Address::ConvertFrom (GetAddress ());
LlcSnapHeader llc;
llc.SetType (protocolNumber);

View File

@@ -207,7 +207,6 @@ InterferenceHelperSequenceTest::SendOnePacket (Ptr<WifiNetDevice> dev)
void
InterferenceHelperSequenceTest::SwitchCh (Ptr<WifiNetDevice> dev)
{
Time now = Simulator::Now();
Ptr<WifiPhy> p = dev->GetPhy ();
p->SetChannelNumber (1);
}

View File

@@ -627,13 +627,11 @@ BSSchedulerRtps::BSSchedulerNRTPSConnection (uint32_t &availableSymbols)
Ptr<PacketBurst> burst = Create<PacketBurst> ();
std::vector<ServiceFlow*>::iterator iter;
ServiceFlowRecord *serviceFlowRecord;
std::vector<ServiceFlow*> serviceFlows;
serviceFlows = GetBs ()->GetServiceFlowManager ()->GetServiceFlows (ServiceFlow::SF_TYPE_NRTPS);
for (iter = serviceFlows.begin (); iter != serviceFlows.end (); ++iter)
{
serviceFlowRecord = (*iter)->GetRecord ();
connection = (*iter)->GetConnection ();
while ((*iter)->HasPackets () && availableSymbols > 0)
@@ -684,13 +682,11 @@ BSSchedulerRtps::BSSchedulerBEConnection (uint32_t &availableSymbols)
Ptr<PacketBurst> burst = Create<PacketBurst> ();
std::vector<ServiceFlow*>::iterator iter;
ServiceFlowRecord *serviceFlowRecord;
std::vector<ServiceFlow*> serviceFlows;
serviceFlows = GetBs ()->GetServiceFlowManager ()->GetServiceFlows (ServiceFlow::SF_TYPE_BE);
for (iter = serviceFlows.begin (); iter != serviceFlows.end (); ++iter)
{
serviceFlowRecord = (*iter)->GetRecord ();
connection = (*iter)->GetConnection ();
while ((*iter)->HasPackets () && availableSymbols > 0)

View File

@@ -310,9 +310,6 @@ UplinkSchedulerMBQoS::Schedule (void)
timestamp =
(*(ssRecord->GetServiceFlows (ServiceFlow::SF_TYPE_UGS).begin ()))->GetRecord ()->GetLastGrantTime ()
+ MilliSeconds ((*(ssRecord->GetServiceFlows (ServiceFlow::SF_TYPE_UGS).begin ()))->GetUnsolicitedGrantInterval ());
Time
uInterval =
MilliSeconds ((*(ssRecord->GetServiceFlows (ServiceFlow::SF_TYPE_UGS).begin ()))->GetUnsolicitedGrantInterval ());
Time frame = Time ((timestamp - Simulator::Now ()) / frame_duration);
@@ -500,10 +497,8 @@ bool UplinkSchedulerMBQoS::ServiceBandwidthRequestsBytes (ServiceFlow *serviceFl
{
uint32_t allocSizeBytes = allocationSizeBytes;
uint32_t allocSizeSymbols = 0;
uint16_t sduSize = 0;
ServiceFlowRecord *record = serviceFlow->GetRecord ();
sduSize = serviceFlow->GetSduSize ();
uint32_t requiredBandwidth = record->GetRequestedBandwidth ();
@@ -656,7 +651,6 @@ UplinkSchedulerMBQoS::CheckDeadline (uint32_t &availableSymbols)
if (m_uplinkJobs_inter.size () > 0)
{
std::list<Ptr<UlJob> >::iterator iter = m_uplinkJobs_inter.begin ();
std::list<Ptr<UlJob> >::iterator iterPrev = m_uplinkJobs_inter.begin ();
while (iter != m_uplinkJobs_inter.end () && availableSymbols)
{

View File

@@ -438,6 +438,7 @@ SSLinkManager::IsUlChannelUsable (void)
void
SSLinkManager::AdjustRangingParameters (const RngRsp &rngrsp)
{
#if 0 /* a template for future implementation following */
bool successful = true;
uint8_t temp = rngrsp.GetTimingAdjust ();
temp = rngrsp.GetPowerLevelAdjust ();
@@ -449,6 +450,7 @@ SSLinkManager::AdjustRangingParameters (const RngRsp &rngrsp)
{
// code for setting ranging anomalies goes here
}
#endif
}
void

View File

@@ -1081,9 +1081,11 @@ SubscriberStationNetDevice::ProcessDlMap (const DlMap &dlmap)
mechanism automatically passes it as parameter.*/
}
#if 0 /* a template for future implementation following */
uint8_t temp = iter->GetDiuc ();
temp = iter->GetPreamblePresent ();
temp = iter->GetStartTime ();
#endif
}
}

View File

@@ -85,12 +85,10 @@ SSScheduler::Schedule (uint16_t availableSymbols,
}
Ptr<Packet> packet;
ServiceFlow *serviceFlow;
while (connection && connection->HasPackets (packetType))
{
NS_LOG_INFO ("FRAG_DEBUG: SS Scheduler" << std::endl);
serviceFlow = connection->GetServiceFlow ();
uint32_t availableByte = m_ss->GetPhy ()->
GetNrBytes (availableSymbols, modulationType);

View File

@@ -76,7 +76,6 @@ Ns3WimaxFragmentationTestCase::DoRun (void)
Cid cid;
WimaxConnection *connectionTx = new WimaxConnection (cid, Cid::TRANSPORT);
WimaxConnection *connectionRx = new WimaxConnection (cid, Cid::TRANSPORT);
bool testResult = false;
// A Packet of 1000 bytes has been created.
// It will be fragmentated into 4 fragments and then defragmentated into fullPacket.
@@ -111,39 +110,16 @@ Ns3WimaxFragmentationTestCase::DoRun (void)
if (type)
{
// Check if there is a fragmentation Subheader
uint8_t tmpType = type;
if (((tmpType >> 2) & 1) != 1)
{
// The packet is not a fragment
testResult = true;
break;
}
NS_TEST_EXPECT_MSG_EQ (((type >> 2) & 1), 1, "The packet is not a fragment");
}
// remove header from the received fragment
fragment->RemoveHeader (fragSubhdr);
uint32_t fc = fragSubhdr.GetFc ();
if (fc == 1 && i != 0)
{
// the fragment in not the first one
testResult = true;
break;
}
if (fc == 2 && i != 3)
{
// the fragment in not the latest one
testResult = true;
break;
}
if ((fc == 3 && i != 1) && (fc == 3 && i != 2))
{
// the fragment in not the middle one
testResult = true;
break;
}
NS_TEST_EXPECT_MSG_EQ ((fc == 1 && i != 0), false, "The fragment in not the first one");
NS_TEST_EXPECT_MSG_EQ ((fc == 2 && i != 3), false, "The fragment in not the latest one");
NS_TEST_EXPECT_MSG_EQ (((fc == 3 && i != 1) && (fc == 3 && i != 2)), false, "The fragment in not the middle one");
if (fc != 2)
{
@@ -167,12 +143,7 @@ Ns3WimaxFragmentationTestCase::DoRun (void)
}
connectionRx->ClearFragmentsQueue ();
if (fullPacket->GetSize () != 1000)
{
// The defragmentation is correct.
testResult = true; // Test is passed
break;
}
NS_TEST_EXPECT_MSG_EQ (fullPacket->GetSize (), 1000, "The defragmentation is incorrect");
}
}
delete connectionTx;