fix compilation for optimized builds
authorMathieu Lacage <mathieu.lacage@sophia.inria.fr>
Thu, 29 Mar 2007 13:24:22 +0200
changeset 392 69bfc24000ba
parent 391 0b920298da18
child 393 18ed386bee75
fix compilation for optimized builds
samples/main-p2p-net-device-if.cc
src/devices/p2p/p2p-net-device.cc
--- a/samples/main-p2p-net-device-if.cc	Thu Mar 29 13:20:27 2007 +0200
+++ b/samples/main-p2p-net-device-if.cc	Thu Mar 29 13:24:22 2007 +0200
@@ -180,7 +180,8 @@
 
   NS_DEBUG_UNCOND("Adding ARP Interface to InternetNode a");
   ArpIpv4Interface* arpipv4interfacep = new ArpIpv4Interface(&a, &neta);
-  uint32_t indexA = (&a)->GetIpv4 ()->AddInterface (arpipv4interfacep);
+  uint32_t indexA;
+  indexA = (&a)->GetIpv4 ()->AddInterface (arpipv4interfacep);
   NS_DEBUG_UNCOND("Adding Interface " << indexA);
 
 
@@ -200,7 +201,8 @@
 
   NS_DEBUG_UNCOND("Adding ARP Interface to InternetNode b");
   ArpIpv4Interface* arpipv4interfacepb = new ArpIpv4Interface(&b, &netb);
-  uint32_t indexB = (&b)->GetIpv4 ()->AddInterface (arpipv4interfacepb);
+  uint32_t indexB;
+  indexB = (&b)->GetIpv4 ()->AddInterface (arpipv4interfacepb);
   NS_DEBUG_UNCOND("Adding Interface " << indexB);
 
 
--- a/src/devices/p2p/p2p-net-device.cc	Thu Mar 29 13:20:27 2007 +0200
+++ b/src/devices/p2p/p2p-net-device.cc	Thu Mar 29 13:24:22 2007 +0200
@@ -240,7 +240,8 @@
   NS_ASSERT(m_txMachineState == BUSY && "Must be BUSY if transmitting");
   m_txMachineState = GAP;
   Packet p;
-  bool found = m_queue->Dequeue (p);
+  bool found;
+  found = m_queue->Dequeue (p);
   NS_ASSERT(found && "Packet must be on queue if transmitted");
   NS_DEBUG ("PointToPointNetDevice::TransmitCompleteEvent (): Pkt UID is " << 
             p.GetUid () << ")");
@@ -275,7 +276,8 @@
   else
     {
       Packet p;
-      bool found = m_queue->Peek (p);
+      bool found;
+      found = m_queue->Peek (p);
       NS_ASSERT(found && "IsEmpty false but no Packet on queue?");
       TransmitStart (p);
     }