Add parenthesis in while (packet = socket->Recv ()) to make clang++ (LLVM) happy

This commit is contained in:
Gustavo J. A. M. Carneiro
2012-02-22 13:50:26 +00:00
parent 3b42fe426d
commit 255e15cd28
6 changed files with 6 additions and 6 deletions

View File

@@ -59,7 +59,7 @@ ReceivePacket (Ptr<Socket> socket)
{
Ptr<Packet> packet;
Address from;
while (packet = socket->RecvFrom (from))
while ((packet = socket->RecvFrom (from)))
{
if (packet->GetSize () > 0)
{

View File

@@ -143,7 +143,7 @@ void
RoutingExperiment::ReceivePacket (Ptr<Socket> socket)
{
Ptr<Packet> packet;
while (packet = socket->Recv ())
while ((packet = socket->Recv ()))
{
bytesTotal += packet->GetSize ();
packetsReceived += 1;

View File

@@ -240,7 +240,7 @@ Receiver::Receive (Ptr<Socket> socket)
Ptr<Packet> packet;
Address from;
while (packet = socket->RecvFrom (from)) {
while ((packet = socket->RecvFrom (from))) {
if (InetSocketAddress::IsMatchingType (from)) {
NS_LOG_INFO ("Received " << packet->GetSize () << " bytes from " <<
InetSocketAddress::ConvertFrom (from).GetIpv4 ());

View File

@@ -163,7 +163,7 @@ void
Experiment::ReceivePacket (Ptr<Socket> socket)
{
Ptr<Packet> packet;
while (packet = socket->Recv ())
while ((packet = socket->Recv ()))
{
bytesTotal += packet->GetSize ();
}

View File

@@ -94,7 +94,7 @@ void
Experiment::ReceivePacket (Ptr<Socket> socket)
{
Ptr<Packet> packet;
while (packet = socket->Recv ())
while ((packet = socket->Recv ()))
{
m_bytesTotal += packet->GetSize ();
}

View File

@@ -81,7 +81,7 @@ void
Experiment::ReceivePacket (Ptr<Socket> socket)
{
Ptr<Packet> packet;
while (packet = socket->Recv ())
while ((packet = socket->Recv ()))
{
m_pktsTotal++;
}