# HG changeset patch # User Quincy Tse # Date 1312993616 14400 # Node ID 231acc30d08f611e12867d12026983ab23988be3 # Parent 1e965c4c084bab18724dc2bf7b5a0b9af1948631 bug 928: variable length arrays are not standard-compliant. diff -r 1e965c4c084b -r 231acc30d08f src/wimax/examples/wimax-ipv4.cc --- a/src/wimax/examples/wimax-ipv4.cc Wed Aug 10 12:23:15 2011 -0400 +++ b/src/wimax/examples/wimax-ipv4.cc Wed Aug 10 12:26:56 2011 -0400 @@ -112,7 +112,7 @@ scheduler); bsDevs = wimax.Install (bsNodes, WimaxHelper::DEVICE_TYPE_BASE_STATION, WimaxHelper::SIMPLE_PHY_TYPE_OFDM, scheduler); - Ptr ss[nbSS]; + Ptr* ss = new Ptr[nbSS]; for (int i = 0; i < nbSS; i++) { @@ -141,10 +141,10 @@ wimax.EnableLogComponents (); // Turn on all wimax logging } /*------------------------------*/ - UdpServerHelper udpServer[nbSS / 2]; - ApplicationContainer serverApps[nbSS / 2]; - UdpClientHelper udpClient[nbSS / 2]; - ApplicationContainer clientApps[nbSS / 2]; + UdpServerHelper* udpServer = new UdpServerHelper[nbSS / 2]; + ApplicationContainer* serverApps = new ApplicationContainer[nbSS / 2]; + UdpClientHelper* udpClient = new UdpClientHelper[nbSS / 2]; + ApplicationContainer* clientApps = new ApplicationContainer[nbSS / 2]; for (int i = 0; i < nbSS / 2; i++) { @@ -204,10 +204,16 @@ NS_LOG_INFO ("Starting simulation....."); Simulator::Run (); + delete[] clientApps; + delete[] udpClient; + delete[] serverApps; + delete[] udpServer; for (int i = 0; i < nbSS; i++) { ss[i] = 0; } + delete[] ss; + bs = 0; Simulator::Destroy ();