traffic-control: Eliminate Visual Studio compiler warnings in the examples
This commit is contained in:
@@ -83,7 +83,7 @@ GoodputSampling (std::string fileName, ApplicationContainer app, Ptr<OutputStrea
|
||||
{
|
||||
Simulator::Schedule (Seconds (period), &GoodputSampling, fileName, app, stream, period);
|
||||
double goodput;
|
||||
uint32_t totalPackets = DynamicCast<PacketSink> (app.Get (0))->GetTotalRx ();
|
||||
uint64_t totalPackets = DynamicCast<PacketSink> (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;
|
||||
|
||||
|
||||
@@ -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<uint32_t>(p.first) << std::dec
|
||||
std::cout << " DSCP value: 0x" << std::hex << static_cast<uint32_t> (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<PacketSink> (sinkApp.Get (0))->GetTotalRx ();
|
||||
uint64_t totalPacketsThr = DynamicCast<PacketSink> (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;
|
||||
|
||||
Reference in New Issue
Block a user