From e1c73ce575aeceb7d43fb290243fd045df39a796 Mon Sep 17 00:00:00 2001 From: Robert Ammon Date: Thu, 12 Apr 2018 23:06:30 +0200 Subject: [PATCH] traffic-control: Eliminate Visual Studio compiler warnings in the examples --- examples/traffic-control/queue-discs-benchmark.cc | 4 ++-- examples/traffic-control/traffic-control.cc | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/traffic-control/queue-discs-benchmark.cc b/examples/traffic-control/queue-discs-benchmark.cc index 328581ab9..ef1e03856 100644 --- a/examples/traffic-control/queue-discs-benchmark.cc +++ b/examples/traffic-control/queue-discs-benchmark.cc @@ -83,7 +83,7 @@ GoodputSampling (std::string fileName, ApplicationContainer app, Ptr (app.Get (0))->GetTotalRx (); + uint64_t totalPackets = DynamicCast (app.Get (0))->GetTotalRx (); goodput = totalPackets * 8 / (Simulator::Now ().GetSeconds () * 1024); // Kbit/s *stream->GetStream () << Simulator::Now ().GetSeconds () << " " << goodput << std::endl; } @@ -105,7 +105,7 @@ int main (int argc, char *argv[]) std::string flowsDatarate = "20Mbps"; uint32_t flowsPacketsSize = 1000; - float startTime = 0.1; // in s + float startTime = 0.1f; // in s float simDuration = 60; float samplingPeriod = 1; diff --git a/examples/traffic-control/traffic-control.cc b/examples/traffic-control/traffic-control.cc index 6001f64d4..23761495c 100644 --- a/examples/traffic-control/traffic-control.cc +++ b/examples/traffic-control/traffic-control.cc @@ -202,7 +202,7 @@ main (int argc, char *argv[]) auto dscpVec = classifier->GetDscpCounts (1); for (auto p : dscpVec) { - std::cout << " DSCP value: 0x" << std::hex << static_cast(p.first) << std::dec + std::cout << " DSCP value: 0x" << std::hex << static_cast (p.first) << std::dec << " count: "<< p.second << std::endl; } @@ -210,7 +210,7 @@ main (int argc, char *argv[]) std::cout << std::endl << "*** Application statistics ***" << std::endl; double thr = 0; - uint32_t totalPacketsThr = DynamicCast (sinkApp.Get (0))->GetTotalRx (); + uint64_t totalPacketsThr = DynamicCast (sinkApp.Get (0))->GetTotalRx (); thr = totalPacketsThr * 8 / (simulationTime * 1000000.0); //Mbit/s std::cout << " Rx Bytes: " << totalPacketsThr << std::endl; std::cout << " Average Goodput: " << thr << " Mbit/s" << std::endl;