From 7c128bc9296897fc203cae3737e62ab66a264e87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Deronne?= Date: Thu, 21 Jun 2018 22:22:14 +0200 Subject: [PATCH] examples: Fix compilation warning --- examples/wireless/wifi-backward-compatibility.cc | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/examples/wireless/wifi-backward-compatibility.cc b/examples/wireless/wifi-backward-compatibility.cc index ec1a28716..d14ef3ec0 100644 --- a/examples/wireless/wifi-backward-compatibility.cc +++ b/examples/wireless/wifi-backward-compatibility.cc @@ -217,22 +217,31 @@ int main (int argc, char *argv[]) uint64_t rxBytes; double throughput; + bool error = false; if (apHasTraffic) { rxBytes = payloadSize * DynamicCast (staServerApp.Get (0))->GetReceived (); throughput = (rxBytes * 8) / (simulationTime * 1000000.0); //Mbit/s std::cout << "AP Throughput: " << throughput << " Mbit/s" << std::endl; + if (throughput == 0) + { + error = true; + } } if (staHasTraffic) { rxBytes = payloadSize * DynamicCast (apServerApp.Get (0))->GetReceived (); throughput = (rxBytes * 8) / (simulationTime * 1000000.0); //Mbit/s std::cout << "STA Throughput: " << throughput << " Mbit/s" << std::endl; + if (throughput == 0) + { + error = true; + } } Simulator::Destroy (); - if (throughput == 0) + if (error) { NS_LOG_ERROR ("No traffic received!"); exit (1);