diff --git a/samples/main-p2p-net-device-if.cc b/samples/main-p2p-net-device-if.cc index 4d1c895d9..5f75228b4 100644 --- a/samples/main-p2p-net-device-if.cc +++ b/samples/main-p2p-net-device-if.cc @@ -180,7 +180,8 @@ int main (int argc, char *argv[]) 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 @@ int main (int argc, char *argv[]) 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); diff --git a/src/devices/p2p/p2p-net-device.cc b/src/devices/p2p/p2p-net-device.cc index fb6938d9f..00afd9752 100644 --- a/src/devices/p2p/p2p-net-device.cc +++ b/src/devices/p2p/p2p-net-device.cc @@ -240,7 +240,8 @@ PointToPointNetDevice::TransmitCompleteEvent (void) 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 @@ PointToPointNetDevice::TransmitReadyEvent (void) 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); }