View | Details | Raw Unified | Return to bug 1170
Collapse All | Expand All

(-)a/examples/energy/energy-model-example.cc (-3 / +4 lines)
 Lines 43-48    Link Here 
43
void
43
void
44
ReceivePacket (Ptr<Socket> socket)
44
ReceivePacket (Ptr<Socket> socket)
45
{
45
{
46
#ifdef NS3_LOG_ENABLE
46
  Ptr<Packet> packet;
47
  Ptr<Packet> packet;
47
  Address from;
48
  Address from;
48
  while (packet = socket->RecvFrom (from))
49
  while (packet = socket->RecvFrom (from))
 Lines 53-63    Link Here 
53
          NS_LOG_UNCOND ("--\nReceived one packet! Socket: "<< iaddr.GetIpv4 ()
54
          NS_LOG_UNCOND ("--\nReceived one packet! Socket: "<< iaddr.GetIpv4 ()
54
                                                            << " port: " << iaddr.GetPort () << " at time = " <<
55
                                                            << " port: " << iaddr.GetPort () << " at time = " <<
55
                         Simulator::Now ().GetSeconds () << "\n--");
56
                         Simulator::Now ().GetSeconds () << "\n--");
56
          //cast iaddr to void, to suppress 'iaddr' set but not used compiler warning
57
          //in optimized builds
58
          (void) iaddr;
59
        }
57
        }
60
    }
58
    }
59
#else
60
  while (socket->Recv ());
61
#endif
61
}
62
}
62
63
63
/**
64
/**
(-)a/examples/routing/manet-routing-compare.cc (-17 / +22 lines)
 Lines 118-123    Link Here 
118
}
118
}
119
119
120
void
120
void
121
PrintReceivedPacket (Ptr<Socket> socket, Ptr<Packet> packet)
122
{
123
#ifdef NS3_LOG_ENABLE
124
  SocketAddressTag tag;
125
  bool found;
126
  found = packet->PeekPacketTag (tag);
127
  if (found)
128
    {
129
      InetSocketAddress addr = InetSocketAddress::ConvertFrom (tag.GetAddress ());
130
      NS_LOG_UNCOND (Simulator::Now ().GetSeconds () <<  " " << socket->GetNode ()->GetId ()
131
                                                     << " received one packet from " << addr.GetIpv4 ());
132
    }
133
  else
134
    {
135
      NS_LOG_UNCOND (Simulator::Now ().GetSeconds () << " " << socket->GetNode ()->GetId ()
136
                                                     << " received one packet!");
137
    }
138
#endif
139
}
140
141
void
121
RoutingExperiment::ReceivePacket (Ptr<Socket> socket)
142
RoutingExperiment::ReceivePacket (Ptr<Socket> socket)
122
{
143
{
123
  Ptr<Packet> packet;
144
  Ptr<Packet> packet;
 Lines 125-147    Link Here 
125
    {
146
    {
126
      bytesTotal += packet->GetSize ();
147
      bytesTotal += packet->GetSize ();
127
      packetsReceived += 1;
148
      packetsReceived += 1;
128
      SocketAddressTag tag;
149
      PrintReceivedPacket (socket, packet);
129
      bool found;
130
      found = packet->PeekPacketTag (tag);
131
      if (found)
132
        {
133
          InetSocketAddress addr = InetSocketAddress::ConvertFrom (tag.GetAddress ());
134
          NS_LOG_UNCOND (Simulator::Now ().GetSeconds () <<  " " << socket->GetNode ()->GetId ()
135
                                                         << " received one packet from " << addr.GetIpv4 ());
136
          //cast addr to void, to suppress 'addr' set but not used
137
          //compiler warning in optimized builds
138
          (void) addr;
139
        }
140
      else
141
        {
142
          NS_LOG_UNCOND (Simulator::Now ().GetSeconds () << " " << socket->GetNode ()->GetId ()
143
                                                         << " received one packet!");
144
        }
145
    }
150
    }
146
}
151
}
147
152
(-)a/examples/stats/wifi-example-apps.h (-2 lines)
 Lines 25-32    Link Here 
25
 *
25
 *
26
 */
26
 */
27
27
28
// #define NS3_LOG_ENABLE // Now defined by Makefile
29
30
#include "ns3/core-module.h"
28
#include "ns3/core-module.h"
31
#include "ns3/network-module.h"
29
#include "ns3/network-module.h"
32
#include "ns3/application.h"
30
#include "ns3/application.h"
(-)a/examples/stats/wifi-example-sim.cc (-2 lines)
 Lines 30-37    Link Here 
30
 * 
30
 * 
31
 */
31
 */
32
32
33
// #define NS3_LOG_ENABLE // Now defined by Makefile
34
35
#include <ctime>
33
#include <ctime>
36
34
37
#include <sstream>
35
#include <sstream>
(-)a/examples/wireless/multirate.cc (-15 / +20 lines)
 Lines 89-95    Link Here 
89
89
90
private:
90
private:
91
91
92
  Vector GetPosition (Ptr<Node> node);
93
  Ptr<Socket> SetupPacketReceive (Ptr<Node> node);
92
  Ptr<Socket> SetupPacketReceive (Ptr<Node> node);
94
  NodeContainer GenerateNeighbors (NodeContainer c, uint32_t senderId);
93
  NodeContainer GenerateNeighbors (NodeContainer c, uint32_t senderId);
95
94
 Lines 181-193    Link Here 
181
  Simulator::Schedule (Seconds (0.1), &Experiment::CheckThroughput, this);
180
  Simulator::Schedule (Seconds (0.1), &Experiment::CheckThroughput, this);
182
}
181
}
183
182
184
Vector
185
Experiment::GetPosition (Ptr<Node> node)
186
{
187
  Ptr<MobilityModel> mobility = node->GetObject<MobilityModel> ();
188
  return mobility->GetPosition ();
189
}
190
191
/**
183
/**
192
 *
184
 *
193
 * Take the grid map, divide it into 4 quadrants
185
 * Take the grid map, divide it into 4 quadrants
 Lines 309-318    Link Here 
309
    }
301
    }
310
}
302
}
311
303
304
Vector
305
GetPosition (Ptr<Node> node)
306
{
307
  Ptr<MobilityModel> mobility = node->GetObject<MobilityModel> ();
308
  return mobility->GetPosition ();
309
}
310
312
void
311
void
313
Experiment::ApplicationSetup (Ptr<Node> client, Ptr<Node> server, double start, double stop)
312
PrintPosition (Ptr<Node> client, Ptr<Node> server)
314
{
313
{
315
314
#ifdef NS3_LOG_ENABLE
316
  Vector serverPos = GetPosition (server);
315
  Vector serverPos = GetPosition (server);
317
  Vector clientPos = GetPosition (client);
316
  Vector clientPos = GetPosition (client);
318
317
 Lines 333-344    Link Here 
333
                                        << " with ip " << ipv4AddrClient
332
                                        << " with ip " << ipv4AddrClient
334
                                        << " position (" << clientPos.x << "," << clientPos.y << "," << clientPos.z << ")"
333
                                        << " position (" << clientPos.x << "," << clientPos.y << "," << clientPos.z << ")"
335
                                        << "\n");
334
                                        << "\n");
335
#endif
336
}
336
337
337
  //cast serverPos,clientPos,iaddrClient to void, to suppress variable set but not
338
void
338
  //used compiler warning in optimized builds
339
Experiment::ApplicationSetup (Ptr<Node> client, Ptr<Node> server, double start, double stop)
339
  (void) serverPos;
340
{
340
  (void) clientPos;
341
  Ptr<Ipv4> ipv4Server = server->GetObject<Ipv4>();
341
  (void) ipv4AddrClient;
342
343
  Ipv4InterfaceAddress iaddrServer = ipv4Server->GetAddress (1,0);
344
  Ipv4Address ipv4AddrServer = iaddrServer.GetLocal ();
345
346
  PrintPosition (client, server);
342
347
343
  // Equipping the source  node with OnOff Application used for sending 
348
  // Equipping the source  node with OnOff Application used for sending 
344
  OnOffHelper onoff ("ns3::UdpSocketFactory", Address (InetSocketAddress (Ipv4Address ("10.0.0.1"), port)));
349
  OnOffHelper onoff ("ns3::UdpSocketFactory", Address (InetSocketAddress (Ipv4Address ("10.0.0.1"), port)));
(-)a/examples/wireless/wifi-simple-interference.cc (-3 / +2 lines)
 Lines 98-110    Link Here 
98
98
99
void ReceivePacket (Ptr<Socket> socket)
99
void ReceivePacket (Ptr<Socket> socket)
100
{
100
{
101
#ifdef NS3_LOG_ENABLE
101
  Address addr;
102
  Address addr;
102
  socket->GetSockName (addr);
103
  socket->GetSockName (addr);
103
  InetSocketAddress iaddr = InetSocketAddress::ConvertFrom (addr);
104
  InetSocketAddress iaddr = InetSocketAddress::ConvertFrom (addr);
104
  NS_LOG_UNCOND ("Received one packet!  Socket: " << iaddr.GetIpv4 () << " port: " << iaddr.GetPort ());
105
  NS_LOG_UNCOND ("Received one packet!  Socket: " << iaddr.GetIpv4 () << " port: " << iaddr.GetPort ());
105
  //cast iaddr to void, to suppress iaddr set but not used compiler warning
106
#endif
106
  //in optimized builds
107
  (void) iaddr;
108
}
107
}
109
108
110
static void GenerateTraffic (Ptr<Socket> socket, uint32_t pktSize, 
109
static void GenerateTraffic (Ptr<Socket> socket, uint32_t pktSize, 
(-)a/src/applications/model/packet-sink.cc (-7 / +11 lines)
 Lines 151-156    Link Here 
151
    }
151
    }
152
}
152
}
153
153
154
void PrintStats (Address& from, uint32_t packetSize, uint32_t totalRxSize)
155
{
156
#ifdef NS3_LOG_ENABLE
157
  InetSocketAddress address = InetSocketAddress::ConvertFrom (from);
158
  NS_LOG_INFO ("Received " <<  packetSize << " bytes from " <<
159
               address.GetIpv4 () << " [" << address << "]"
160
               << " total Rx " << totalRxSize);
161
#endif
162
}
163
154
void PacketSink::HandleRead (Ptr<Socket> socket)
164
void PacketSink::HandleRead (Ptr<Socket> socket)
155
{
165
{
156
  NS_LOG_FUNCTION (this << socket);
166
  NS_LOG_FUNCTION (this << socket);
 Lines 165-177    Link Here 
165
      if (InetSocketAddress::IsMatchingType (from))
175
      if (InetSocketAddress::IsMatchingType (from))
166
        {
176
        {
167
          m_totalRx += packet->GetSize ();
177
          m_totalRx += packet->GetSize ();
168
          InetSocketAddress address = InetSocketAddress::ConvertFrom (from);
178
          PrintStats(from, packet->GetSize (), m_totalRx);
169
          NS_LOG_INFO ("Received " << packet->GetSize () << " bytes from " <<
170
                       address.GetIpv4 () << " [" << address << "]"
171
                                   << " total Rx " << m_totalRx);
172
          //cast address to void , to suppress 'address' set but not used 
173
          //compiler warning in optimized builds
174
          (void) address;
175
        }
179
        }
176
      m_rxTrace (packet, from);
180
      m_rxTrace (packet, from);
177
    }
181
    }
(-)a/src/applications/model/v4ping.cc (-3 lines)
 Lines 243-251    Link Here 
243
  InetSocketAddress dst = InetSocketAddress (m_remote, 0);
243
  InetSocketAddress dst = InetSocketAddress (m_remote, 0);
244
  status = m_socket->Connect (dst);
244
  status = m_socket->Connect (dst);
245
  NS_ASSERT (status != -1);
245
  NS_ASSERT (status != -1);
246
  //cast status to void, to suppress 'status' set but not used compiler warning
247
  //in optimized builds
248
  (void) status;
249
246
250
  Send ();
247
  Send ();
251
}
248
}
(-)a/src/click/helper/click-internet-stack-helper.cc (-4 / +3 lines)
 Lines 297-303    Link Here 
297
      result = ipv4L3Protocol->TraceConnectWithoutContext ("Rx", MakeCallback (&Ipv4L3ProtocolRxTxSink));
297
      result = ipv4L3Protocol->TraceConnectWithoutContext ("Rx", MakeCallback (&Ipv4L3ProtocolRxTxSink));
298
      NS_ASSERT_MSG (result == true, "ClickInternetStackHelper::EnablePcapIpv4Internal():  "
298
      NS_ASSERT_MSG (result == true, "ClickInternetStackHelper::EnablePcapIpv4Internal():  "
299
                     "Unable to connect ipv4L3Protocol \"Rx\"");
299
                     "Unable to connect ipv4L3Protocol \"Rx\"");
300
      (void) result; //cast to void to suppress variable set but not used compiler warning in optimized builds
301
    }
300
    }
302
301
303
  g_interfaceFileMapIpv4[std::make_pair (ipv4, interface)] = file;
302
  g_interfaceFileMapIpv4[std::make_pair (ipv4, interface)] = file;
 Lines 450-458    Link Here 
450
          // be aggregated to the same node.
449
          // be aggregated to the same node.
451
          //
450
          //
452
          Ptr<Ipv4L3Protocol> ipv4L3Protocol = ipv4->GetObject<Ipv4L3Protocol> ();
451
          Ptr<Ipv4L3Protocol> ipv4L3Protocol = ipv4->GetObject<Ipv4L3Protocol> ();
453
          bool __attribute__ ((unused)) result = ipv4L3Protocol->TraceConnectWithoutContext ("Drop",
452
          bool result = ipv4L3Protocol->TraceConnectWithoutContext ("Drop",
454
                                                                                             MakeBoundCallback (&Ipv4L3ProtocolDropSinkWithoutContext,
453
                                                                    MakeBoundCallback (&Ipv4L3ProtocolDropSinkWithoutContext,
455
                                                                                                                theStream));
454
                                                                                       theStream));
456
          NS_ASSERT_MSG (result == true, "ClickInternetStackHelper::EanableAsciiIpv4Internal():  "
455
          NS_ASSERT_MSG (result == true, "ClickInternetStackHelper::EanableAsciiIpv4Internal():  "
457
                         "Unable to connect ipv4L3Protocol \"Drop\"");
456
                         "Unable to connect ipv4L3Protocol \"Drop\"");
458
        }
457
        }
(-)a/src/click/test/ipv4-click-routing-test.cc (-9 lines)
 Lines 97-105    Link Here 
97
97
98
  ret = simclick_sim_command (click->m_simNode, SIMCLICK_IFID_FROM_NAME, "eth1");
98
  ret = simclick_sim_command (click->m_simNode, SIMCLICK_IFID_FROM_NAME, "eth1");
99
  NS_TEST_EXPECT_MSG_EQ (ret, -1, "No eth1 on node");
99
  NS_TEST_EXPECT_MSG_EQ (ret, -1, "No eth1 on node");
100
101
  // Cast ret to void to work around set-but-unused warnings from compilers
102
  (void) ret;
103
}
100
}
104
101
105
class ClickIpMacAddressFromNameTest : public TestCase
102
class ClickIpMacAddressFromNameTest : public TestCase
 Lines 152-160    Link Here 
152
  NS_TEST_EXPECT_MSG_EQ (strcmp (buf, "00:00:00:00:00:00"), 0, "tun0 has IP 127.0.0.1");
149
  NS_TEST_EXPECT_MSG_EQ (strcmp (buf, "00:00:00:00:00:00"), 0, "tun0 has IP 127.0.0.1");
153
150
154
  delete [] buf;
151
  delete [] buf;
155
156
  // Cast ret to void to work around set-but-unused warnings from compilers
157
  (void) ret;
158
}
152
}
159
153
160
class ClickTrivialTest : public TestCase
154
class ClickTrivialTest : public TestCase
 Lines 197-205    Link Here 
197
  NS_TEST_EXPECT_MSG_EQ (ret, 0, "eth1 does not exist, so return 0");
191
  NS_TEST_EXPECT_MSG_EQ (ret, 0, "eth1 does not exist, so return 0");
198
192
199
  delete [] buf;
193
  delete [] buf;
200
201
  // Cast ret to void to work around set-but-unused warnings from compilers
202
  (void) ret;
203
}
194
}
204
195
205
class ClickIfidFromNameTestSuite : public TestSuite
196
class ClickIfidFromNameTestSuite : public TestSuite
(-)a/src/core/examples/main-callback.cc (-6 / +5 lines)
 Lines 34-42    Link Here 
34
  // invoke cbOne function through callback instance
34
  // invoke cbOne function through callback instance
35
  double retOne;
35
  double retOne;
36
  retOne = one (10.0, 20.0);
36
  retOne = one (10.0, 20.0);
37
  // cast retOne to void, to suppress variable ‘retOne’ set but
37
  // callback returned expected value
38
  // not used compiler warning
38
  NS_ASSERT (retOne == 10.0);
39
  (void) retOne; 
40
39
41
  // return type: int
40
  // return type: int
42
  // first arg type: double
41
  // first arg type: double
 Lines 49-57    Link Here 
49
  // invoke MyCb::cbTwo through callback instance
48
  // invoke MyCb::cbTwo through callback instance
50
  int retTwo;
49
  int retTwo;
51
  retTwo = two (10.0);
50
  retTwo = two (10.0);
52
  // cast retTwo to void, to suppress variable ‘retTwo’ set but
51
  // callback returned expected value
53
  // not used compiler warning
52
  NS_ASSERT (retTwo == -5);
54
  (void) retTwo;
53
55
  two = MakeNullCallback<int, double> ();
54
  two = MakeNullCallback<int, double> ();
56
  // invoking a null callback is just like
55
  // invoking a null callback is just like
57
  // invoking a null function pointer:
56
  // invoking a null function pointer:
(-)a/src/core/model/assert.h (-2 / +13 lines)
 Lines 97-104    Link Here 
97
97
98
#else /* NS3_ASSERT_ENABLE */
98
#else /* NS3_ASSERT_ENABLE */
99
99
100
#define NS_ASSERT(cond)
100
#define NS_ASSERT(condition)                          \
101
#define NS_ASSERT_MSG(cond,msg)
101
  do                                                  \
102
    {                                                 \
103
      (void)sizeof (condition);                       \
104
    }                                                 \
105
  while (false)
106
107
#define NS_ASSERT_MSG(condition, message)             \
108
  do                                                  \
109
    {                                                 \
110
      (void)sizeof (condition);                       \
111
    }                                                 \
112
  while (false)
102
113
103
#endif /* NS3_ASSERT_ENABLE */
114
#endif /* NS3_ASSERT_ENABLE */
104
115
(-)a/src/core/model/unused.h (+8 lines)
Line 0    Link Here 
1
#ifndef UNUSED_H
2
#define UNUSED_H
3
4
#ifndef NS_UNUSED
5
# define NS_UNUSED(x) ((void)(x))
6
#endif
7
8
#endif /* UNUSED_H */
(-)a/src/core/wscript (-1 / +2 lines)
 Lines 240-246    Link Here 
240
        'model/vector.h',
240
        'model/vector.h',
241
        'model/default-deleter.h',
241
        'model/default-deleter.h',
242
        'model/fatal-impl.h',
242
        'model/fatal-impl.h',
243
        'model/system-path.h'
243
        'model/system-path.h',
244
        'model/unused.h',
244
        ]
245
        ]
245
246
246
    if sys.platform == 'win32':
247
    if sys.platform == 'win32':
(-)a/src/flow-monitor/model/ipv4-flow-probe.cc (-3 / +1 lines)
 Lines 331-339    Link Here 
331
  bool tagFound;
331
  bool tagFound;
332
  tagFound = ConstCast<Packet> (ipPayload)->RemovePacketTag (fTag);
332
  tagFound = ConstCast<Packet> (ipPayload)->RemovePacketTag (fTag);
333
  NS_ASSERT_MSG (tagFound, "FlowProbeTag is missing");
333
  NS_ASSERT_MSG (tagFound, "FlowProbeTag is missing");
334
  // cast tagFound to void, to suppress 'tagFound' set but not used compiler 
334
335
  // warning in optimized builds
336
  (void) tagFound;
337
  FlowId flowId = fTag.GetFlowId ();
335
  FlowId flowId = fTag.GetFlowId ();
338
  FlowPacketId packetId = fTag.GetPacketId ();
336
  FlowPacketId packetId = fTag.GetPacketId ();
339
  uint32_t size = fTag.GetPacketSize ();
337
  uint32_t size = fTag.GetPacketSize ();
(-)a/src/internet/helper/internet-stack-helper.cc (-10 / +4 lines)
 Lines 492-500    Link Here 
492
      result = ipv4L3Protocol->TraceConnectWithoutContext ("Rx", MakeCallback (&Ipv4L3ProtocolRxTxSink));
492
      result = ipv4L3Protocol->TraceConnectWithoutContext ("Rx", MakeCallback (&Ipv4L3ProtocolRxTxSink));
493
      NS_ASSERT_MSG (result == true, "InternetStackHelper::EnablePcapIpv4Internal():  "
493
      NS_ASSERT_MSG (result == true, "InternetStackHelper::EnablePcapIpv4Internal():  "
494
                     "Unable to connect ipv4L3Protocol \"Rx\"");
494
                     "Unable to connect ipv4L3Protocol \"Rx\"");
495
      // cast result to void, to suppress ‘result’ set but not used compiler-warning
496
      // for optimized builds
497
      (void) result;
498
    }
495
    }
499
496
500
  g_interfaceFileMapIpv4[std::make_pair (ipv4, interface)] = file;
497
  g_interfaceFileMapIpv4[std::make_pair (ipv4, interface)] = file;
 Lines 587-595    Link Here 
587
      result = ipv6L3Protocol->TraceConnectWithoutContext ("Rx", MakeCallback (&Ipv6L3ProtocolRxTxSink));
584
      result = ipv6L3Protocol->TraceConnectWithoutContext ("Rx", MakeCallback (&Ipv6L3ProtocolRxTxSink));
588
      NS_ASSERT_MSG (result == true, "InternetStackHelper::EnablePcapIpv6Internal():  "
585
      NS_ASSERT_MSG (result == true, "InternetStackHelper::EnablePcapIpv6Internal():  "
589
                     "Unable to connect ipv6L3Protocol \"Rx\"");
586
                     "Unable to connect ipv6L3Protocol \"Rx\"");
590
      // cast found to void, to suppress ‘result’ set but not used compiler-warning
591
      // for optimized builds
592
      (void) result;
593
    }
587
    }
594
588
595
  g_interfaceFileMapIpv6[std::make_pair (ipv6, interface)] = file;
589
  g_interfaceFileMapIpv6[std::make_pair (ipv6, interface)] = file;
 Lines 822-829    Link Here 
822
          // be aggregated to the same node.
816
          // be aggregated to the same node.
823
          //
817
          //
824
          Ptr<Ipv4L3Protocol> ipv4L3Protocol = ipv4->GetObject<Ipv4L3Protocol> ();
818
          Ptr<Ipv4L3Protocol> ipv4L3Protocol = ipv4->GetObject<Ipv4L3Protocol> ();
825
          bool __attribute__ ((unused)) result = ipv4L3Protocol->TraceConnectWithoutContext ("Drop", 
819
          bool result = ipv4L3Protocol->TraceConnectWithoutContext ("Drop",
826
                                                                                             MakeBoundCallback (&Ipv4L3ProtocolDropSinkWithoutContext, theStream));
820
                                                                    MakeBoundCallback (&Ipv4L3ProtocolDropSinkWithoutContext, theStream));
827
          NS_ASSERT_MSG (result == true, "InternetStackHelper::EnableAsciiIpv4Internal():  "
821
          NS_ASSERT_MSG (result == true, "InternetStackHelper::EnableAsciiIpv4Internal():  "
828
                         "Unable to connect ipv4L3Protocol \"Drop\"");
822
                         "Unable to connect ipv4L3Protocol \"Drop\"");
829
          result = ipv4L3Protocol->TraceConnectWithoutContext ("Tx", 
823
          result = ipv4L3Protocol->TraceConnectWithoutContext ("Tx", 
 Lines 1103-1110    Link Here 
1103
          // be aggregated to the same node.
1097
          // be aggregated to the same node.
1104
          //
1098
          //
1105
          Ptr<Ipv6L3Protocol> ipv6L3Protocol = ipv6->GetObject<Ipv6L3Protocol> ();
1099
          Ptr<Ipv6L3Protocol> ipv6L3Protocol = ipv6->GetObject<Ipv6L3Protocol> ();
1106
          bool __attribute__ ((unused)) result = ipv6L3Protocol->TraceConnectWithoutContext ("Drop", 
1100
          bool result = ipv6L3Protocol->TraceConnectWithoutContext ("Drop",
1107
                                                                                             MakeBoundCallback (&Ipv6L3ProtocolDropSinkWithoutContext, theStream));
1101
                                                                    MakeBoundCallback (&Ipv6L3ProtocolDropSinkWithoutContext, theStream));
1108
          NS_ASSERT_MSG (result == true, "InternetStackHelper::EnableAsciiIpv6Internal():  "
1102
          NS_ASSERT_MSG (result == true, "InternetStackHelper::EnableAsciiIpv6Internal():  "
1109
                         "Unable to connect ipv6L3Protocol \"Drop\"");
1103
                         "Unable to connect ipv6L3Protocol \"Drop\"");
1110
          result = ipv6L3Protocol->TraceConnectWithoutContext ("Tx", 
1104
          result = ipv6L3Protocol->TraceConnectWithoutContext ("Tx", 
(-)a/src/internet/model/ipv6-l3-protocol.cc (-2 lines)
 Lines 969-977    Link Here 
969
      if (ipv6Extension)
969
      if (ipv6Extension)
970
        {
970
        {
971
          uint8_t nextHeaderStep = 0;
971
          uint8_t nextHeaderStep = 0;
972
#ifdef NS3_ASSERT_ENABLE
973
          uint8_t curHeader = nextHeader;
972
          uint8_t curHeader = nextHeader;
974
#endif
975
          nextHeaderStep = ipv6Extension->Process (p, nextHeaderPosition, ip, dst, &nextHeader, isDropped);
973
          nextHeaderStep = ipv6Extension->Process (p, nextHeaderPosition, ip, dst, &nextHeader, isDropped);
976
          nextHeaderPosition += nextHeaderStep;
974
          nextHeaderPosition += nextHeaderStep;
977
975
(-)a/src/internet/model/nsc-tcp-socket-impl.cc (-3 lines)
 Lines 449-457    Link Here 
449
      bool found;
449
      bool found;
450
      found = packet->PeekPacketTag (tag);
450
      found = packet->PeekPacketTag (tag);
451
      NS_ASSERT (found);
451
      NS_ASSERT (found);
452
      // cast found to void, to suppress 'found' set but not used
453
      // compiler warning in optimized builds
454
      (void) found;
455
      fromAddress = tag.GetAddress ();
452
      fromAddress = tag.GetAddress ();
456
    }
453
    }
457
  return packet;
454
  return packet;
(-)a/src/internet/model/udp-socket-impl.cc (-3 lines)
 Lines 547-555    Link Here 
547
      bool found;
547
      bool found;
548
      found = packet->PeekPacketTag (tag);
548
      found = packet->PeekPacketTag (tag);
549
      NS_ASSERT (found);
549
      NS_ASSERT (found);
550
      //cast found to void, to suppress 'found' set but not used,compiler warning
551
      //in optimized builds
552
      (void) found;
553
      fromAddress = tag.GetAddress ();
550
      fromAddress = tag.GetAddress ();
554
    }
551
    }
555
  return packet;
552
  return packet;
(-)a/src/internet/test/ipv4-fragmentation-test.cc (-1 lines)
 Lines 20-26    Link Here 
20
/**
20
/**
21
 * This is the test code for ipv4-l3protocol.cc (only the fragmentation and reassembly part).
21
 * This is the test code for ipv4-l3protocol.cc (only the fragmentation and reassembly part).
22
 */
22
 */
23
#define NS3_LOG_ENABLE 1
24
23
25
#include "ns3/test.h"
24
#include "ns3/test.h"
26
#include "ns3/config.h"
25
#include "ns3/config.h"
(-)a/src/internet/test/ipv4-header-test.cc (-3 / +4 lines)
 Lines 99-113    Link Here 
99
99
100
void Ipv4HeaderTest::ReceivePkt (Ptr<Socket> socket)
100
void Ipv4HeaderTest::ReceivePkt (Ptr<Socket> socket)
101
{
101
{
102
#ifdef NS3_ASSERT_ENABLE
102
  uint32_t availableData;
103
  uint32_t availableData;
103
  availableData = socket->GetRxAvailable ();
104
  availableData = socket->GetRxAvailable ();
104
  m_receivedPacket = socket->Recv (2, MSG_PEEK);
105
  m_receivedPacket = socket->Recv (2, MSG_PEEK);
105
  NS_ASSERT (m_receivedPacket->GetSize () == 2);
106
  NS_ASSERT (m_receivedPacket->GetSize () == 2);
107
#endif
106
  m_receivedPacket = socket->Recv (std::numeric_limits<uint32_t>::max (), 0);
108
  m_receivedPacket = socket->Recv (std::numeric_limits<uint32_t>::max (), 0);
109
#ifdef NS3_ASSERT_ENABLE
107
  NS_ASSERT (availableData == m_receivedPacket->GetSize ());
110
  NS_ASSERT (availableData == m_receivedPacket->GetSize ());
108
  //cast availableData to void, to suppress 'availableData' set but not used
111
#endif
109
  //compiler warning
110
  (void) availableData;
111
  m_receivedPacket->PeekHeader (m_receivedHeader);
112
  m_receivedPacket->PeekHeader (m_receivedHeader);
112
}
113
}
113
114
(-)a/src/internet/test/ipv4-raw-test.cc (-6 / +8 lines)
 Lines 108-135    Link Here 
108
108
109
void Ipv4RawSocketImplTest::ReceivePkt (Ptr<Socket> socket)
109
void Ipv4RawSocketImplTest::ReceivePkt (Ptr<Socket> socket)
110
{
110
{
111
#ifdef NS3_ASSERT_ENABLE
111
  uint32_t availableData;
112
  uint32_t availableData;
112
  availableData = socket->GetRxAvailable ();
113
  availableData = socket->GetRxAvailable ();
113
  m_receivedPacket = socket->Recv (2, MSG_PEEK);
114
  m_receivedPacket = socket->Recv (2, MSG_PEEK);
114
  NS_ASSERT (m_receivedPacket->GetSize () == 2);
115
  NS_ASSERT (m_receivedPacket->GetSize () == 2);
116
#endif
115
  m_receivedPacket = socket->Recv (std::numeric_limits<uint32_t>::max (), 0);
117
  m_receivedPacket = socket->Recv (std::numeric_limits<uint32_t>::max (), 0);
118
#ifdef NS3_ASSERT_ENABLE
116
  NS_ASSERT (availableData == m_receivedPacket->GetSize ());
119
  NS_ASSERT (availableData == m_receivedPacket->GetSize ());
117
  //cast availableData to void, to suppress 'availableData' set but not used
120
#endif
118
  //compiler warning
119
  (void) availableData;
120
}
121
}
121
122
122
void Ipv4RawSocketImplTest::ReceivePkt2 (Ptr<Socket> socket)
123
void Ipv4RawSocketImplTest::ReceivePkt2 (Ptr<Socket> socket)
123
{
124
{
125
#ifdef NS3_ASSERT_ENABLE
124
  uint32_t availableData;
126
  uint32_t availableData;
125
  availableData = socket->GetRxAvailable ();
127
  availableData = socket->GetRxAvailable ();
126
  m_receivedPacket2 = socket->Recv (2, MSG_PEEK);
128
  m_receivedPacket2 = socket->Recv (2, MSG_PEEK);
127
  NS_ASSERT (m_receivedPacket2->GetSize () == 2);
129
  NS_ASSERT (m_receivedPacket2->GetSize () == 2);
130
#endif
128
  m_receivedPacket2 = socket->Recv (std::numeric_limits<uint32_t>::max (), 0);
131
  m_receivedPacket2 = socket->Recv (std::numeric_limits<uint32_t>::max (), 0);
132
#ifdef NS3_ASSERT_ENABLE
129
  NS_ASSERT (availableData == m_receivedPacket2->GetSize ());
133
  NS_ASSERT (availableData == m_receivedPacket2->GetSize ());
130
  //cast availableData to void, to suppress 'availableData' set but not used
134
#endif
131
  //compiler warning
132
  (void) availableData;
133
}
135
}
134
136
135
void
137
void
(-)a/src/internet/test/udp-test.cc (-9 / +12 lines)
 Lines 90-102    Link Here 
90
90
91
void UdpSocketLoopbackTest::ReceivePkt (Ptr<Socket> socket)
91
void UdpSocketLoopbackTest::ReceivePkt (Ptr<Socket> socket)
92
{
92
{
93
#ifdef NS3_ASSERT_ENABLE
93
  uint32_t availableData;
94
  uint32_t availableData;
94
  availableData = socket->GetRxAvailable ();
95
  availableData = socket->GetRxAvailable ();
96
#endif
95
  m_receivedPacket = socket->Recv (std::numeric_limits<uint32_t>::max (), 0);
97
  m_receivedPacket = socket->Recv (std::numeric_limits<uint32_t>::max (), 0);
98
#ifdef NS3_ASSERT_ENABLE
96
  NS_ASSERT (availableData == m_receivedPacket->GetSize ());
99
  NS_ASSERT (availableData == m_receivedPacket->GetSize ());
97
  //cast availableData to void, to suppress 'availableData' set but not used
100
#endif
98
  //compiler warning
99
  (void) availableData;
100
}
101
}
101
102
102
void
103
void
 Lines 151-174    Link Here 
151
152
152
void UdpSocketImplTest::ReceivePkt (Ptr<Socket> socket)
153
void UdpSocketImplTest::ReceivePkt (Ptr<Socket> socket)
153
{
154
{
155
#ifdef NS3_ASSERT_ENABLE
154
  uint32_t availableData;
156
  uint32_t availableData;
155
  availableData = socket->GetRxAvailable ();
157
  availableData = socket->GetRxAvailable ();
158
#endif
156
  m_receivedPacket = socket->Recv (std::numeric_limits<uint32_t>::max (), 0);
159
  m_receivedPacket = socket->Recv (std::numeric_limits<uint32_t>::max (), 0);
160
#ifdef NS3_ASSERT_ENABLE
157
  NS_ASSERT (availableData == m_receivedPacket->GetSize ());
161
  NS_ASSERT (availableData == m_receivedPacket->GetSize ());
158
  //cast availableData to void, to suppress 'availableData' set but not used
162
#endif
159
  //compiler warning
160
  (void) availableData;
161
}
163
}
162
164
163
void UdpSocketImplTest::ReceivePkt2 (Ptr<Socket> socket)
165
void UdpSocketImplTest::ReceivePkt2 (Ptr<Socket> socket)
164
{
166
{
167
#ifdef NS3_ASSERT_ENABLE
165
  uint32_t availableData;
168
  uint32_t availableData;
166
  availableData = socket->GetRxAvailable ();
169
  availableData = socket->GetRxAvailable ();
170
#endif
167
  m_receivedPacket2 = socket->Recv (std::numeric_limits<uint32_t>::max (), 0);
171
  m_receivedPacket2 = socket->Recv (std::numeric_limits<uint32_t>::max (), 0);
172
#ifdef NS3_ASSERT_ENABLE
168
  NS_ASSERT (availableData == m_receivedPacket2->GetSize ());
173
  NS_ASSERT (availableData == m_receivedPacket2->GetSize ());
169
  //cast availableData to void, to suppress 'availableData' set but not used
174
#endif
170
  //compiler warning
171
  (void) availableData;
172
}
175
}
173
176
174
void
177
void
(-)a/src/mobility/helper/ns2-mobility-helper.cc (-2 / +2 lines)
 Lines 42-47    Link Here 
42
#include <sstream>
42
#include <sstream>
43
#include <map>
43
#include <map>
44
#include "ns3/log.h"
44
#include "ns3/log.h"
45
#include "ns3/unused.h"
45
#include "ns3/simulator.h"
46
#include "ns3/simulator.h"
46
#include "ns3/node-list.h"
47
#include "ns3/node-list.h"
47
#include "ns3/node.h"
48
#include "ns3/node.h"
 Lines 446-453    Link Here 
446
{
447
{
447
  char *endp;
448
  char *endp;
448
  double v = strtod (s.c_str (), &endp); // declared with warn_unused_result
449
  double v = strtod (s.c_str (), &endp); // declared with warn_unused_result
449
  //cast v to void, to suppress v set but not used compiler warning
450
  NS_UNUSED (v); // suppress "set but not used" compiler warning
450
  (void) v;
451
  return endp == s.c_str () + s.size ();
451
  return endp == s.c_str () + s.size ();
452
}
452
}
453
453
(-)a/src/network/helper/trace-helper.h (-9 / +9 lines)
 Lines 94-100    Link Here 
94
template <typename T> void
94
template <typename T> void
95
PcapHelper::HookDefaultSink (Ptr<T> object, std::string tracename, Ptr<PcapFileWrapper> file)
95
PcapHelper::HookDefaultSink (Ptr<T> object, std::string tracename, Ptr<PcapFileWrapper> file)
96
{
96
{
97
  bool __attribute__ ((unused)) result = 
97
  bool result =
98
    object->TraceConnectWithoutContext (tracename.c_str (), MakeBoundCallback (&DefaultSink, file));
98
    object->TraceConnectWithoutContext (tracename.c_str (), MakeBoundCallback (&DefaultSink, file));
99
  NS_ASSERT_MSG (result == true, "PcapHelper::HookDefaultSink():  Unable to hook \"" << tracename << "\"");
99
  NS_ASSERT_MSG (result == true, "PcapHelper::HookDefaultSink():  Unable to hook \"" << tracename << "\"");
100
}
100
}
 Lines 231-237    Link Here 
231
template <typename T> void
231
template <typename T> void
232
AsciiTraceHelper::HookDefaultEnqueueSinkWithoutContext (Ptr<T> object, std::string tracename, Ptr<OutputStreamWrapper> file)
232
AsciiTraceHelper::HookDefaultEnqueueSinkWithoutContext (Ptr<T> object, std::string tracename, Ptr<OutputStreamWrapper> file)
233
{
233
{
234
  bool __attribute__ ((unused)) result = 
234
  bool result =
235
    object->TraceConnectWithoutContext (tracename, MakeBoundCallback (&DefaultEnqueueSinkWithoutContext, file));
235
    object->TraceConnectWithoutContext (tracename, MakeBoundCallback (&DefaultEnqueueSinkWithoutContext, file));
236
  NS_ASSERT_MSG (result == true, "AsciiTraceHelper::HookDefaultEnqueueSinkWithoutContext():  Unable to hook \"" 
236
  NS_ASSERT_MSG (result == true, "AsciiTraceHelper::HookDefaultEnqueueSinkWithoutContext():  Unable to hook \"" 
237
                 << tracename << "\"");
237
                 << tracename << "\"");
 Lines 244-250    Link Here 
244
  std::string tracename, 
244
  std::string tracename, 
245
  Ptr<OutputStreamWrapper> stream)
245
  Ptr<OutputStreamWrapper> stream)
246
{
246
{
247
  bool __attribute__ ((unused)) result = 
247
  bool result =
248
    object->TraceConnect (tracename, context, MakeBoundCallback (&DefaultEnqueueSinkWithContext, stream));
248
    object->TraceConnect (tracename, context, MakeBoundCallback (&DefaultEnqueueSinkWithContext, stream));
249
  NS_ASSERT_MSG (result == true, "AsciiTraceHelper::HookDefaultEnqueueSinkWithContext():  Unable to hook \"" 
249
  NS_ASSERT_MSG (result == true, "AsciiTraceHelper::HookDefaultEnqueueSinkWithContext():  Unable to hook \"" 
250
                 << tracename << "\"");
250
                 << tracename << "\"");
 Lines 253-259    Link Here 
253
template <typename T> void
253
template <typename T> void
254
AsciiTraceHelper::HookDefaultDropSinkWithoutContext (Ptr<T> object, std::string tracename, Ptr<OutputStreamWrapper> file)
254
AsciiTraceHelper::HookDefaultDropSinkWithoutContext (Ptr<T> object, std::string tracename, Ptr<OutputStreamWrapper> file)
255
{
255
{
256
  bool __attribute__ ((unused)) result = 
256
  bool result =
257
    object->TraceConnectWithoutContext (tracename, MakeBoundCallback (&DefaultDropSinkWithoutContext, file));
257
    object->TraceConnectWithoutContext (tracename, MakeBoundCallback (&DefaultDropSinkWithoutContext, file));
258
  NS_ASSERT_MSG (result == true, "AsciiTraceHelper::HookDefaultDropSinkWithoutContext():  Unable to hook \"" 
258
  NS_ASSERT_MSG (result == true, "AsciiTraceHelper::HookDefaultDropSinkWithoutContext():  Unable to hook \"" 
259
                 << tracename << "\"");
259
                 << tracename << "\"");
 Lines 266-272    Link Here 
266
  std::string tracename, 
266
  std::string tracename, 
267
  Ptr<OutputStreamWrapper> stream)
267
  Ptr<OutputStreamWrapper> stream)
268
{
268
{
269
  bool __attribute__ ((unused)) result = 
269
  bool result =
270
    object->TraceConnect (tracename, context, MakeBoundCallback (&DefaultDropSinkWithContext, stream));
270
    object->TraceConnect (tracename, context, MakeBoundCallback (&DefaultDropSinkWithContext, stream));
271
  NS_ASSERT_MSG (result == true, "AsciiTraceHelper::HookDefaultDropSinkWithContext():  Unable to hook \"" 
271
  NS_ASSERT_MSG (result == true, "AsciiTraceHelper::HookDefaultDropSinkWithContext():  Unable to hook \"" 
272
                 << tracename << "\"");
272
                 << tracename << "\"");
 Lines 275-281    Link Here 
275
template <typename T> void
275
template <typename T> void
276
AsciiTraceHelper::HookDefaultDequeueSinkWithoutContext (Ptr<T> object, std::string tracename, Ptr<OutputStreamWrapper> file)
276
AsciiTraceHelper::HookDefaultDequeueSinkWithoutContext (Ptr<T> object, std::string tracename, Ptr<OutputStreamWrapper> file)
277
{
277
{
278
  bool __attribute__ ((unused)) result = 
278
  bool result =
279
    object->TraceConnectWithoutContext (tracename, MakeBoundCallback (&DefaultDequeueSinkWithoutContext, file));
279
    object->TraceConnectWithoutContext (tracename, MakeBoundCallback (&DefaultDequeueSinkWithoutContext, file));
280
  NS_ASSERT_MSG (result == true, "AsciiTraceHelper::HookDefaultDequeueSinkWithoutContext():  Unable to hook \"" 
280
  NS_ASSERT_MSG (result == true, "AsciiTraceHelper::HookDefaultDequeueSinkWithoutContext():  Unable to hook \"" 
281
                 << tracename << "\"");
281
                 << tracename << "\"");
 Lines 288-294    Link Here 
288
  std::string tracename, 
288
  std::string tracename, 
289
  Ptr<OutputStreamWrapper> stream)
289
  Ptr<OutputStreamWrapper> stream)
290
{
290
{
291
  bool __attribute__ ((unused)) result = 
291
  bool result =
292
    object->TraceConnect (tracename, context, MakeBoundCallback (&DefaultDequeueSinkWithContext, stream));
292
    object->TraceConnect (tracename, context, MakeBoundCallback (&DefaultDequeueSinkWithContext, stream));
293
  NS_ASSERT_MSG (result == true, "AsciiTraceHelper::HookDefaultDequeueSinkWithContext():  Unable to hook \"" 
293
  NS_ASSERT_MSG (result == true, "AsciiTraceHelper::HookDefaultDequeueSinkWithContext():  Unable to hook \"" 
294
                 << tracename << "\"");
294
                 << tracename << "\"");
 Lines 297-303    Link Here 
297
template <typename T> void
297
template <typename T> void
298
AsciiTraceHelper::HookDefaultReceiveSinkWithoutContext (Ptr<T> object, std::string tracename, Ptr<OutputStreamWrapper> file)
298
AsciiTraceHelper::HookDefaultReceiveSinkWithoutContext (Ptr<T> object, std::string tracename, Ptr<OutputStreamWrapper> file)
299
{
299
{
300
  bool __attribute__ ((unused)) result = 
300
  bool result =
301
    object->TraceConnectWithoutContext (tracename, MakeBoundCallback (&DefaultReceiveSinkWithoutContext, file));
301
    object->TraceConnectWithoutContext (tracename, MakeBoundCallback (&DefaultReceiveSinkWithoutContext, file));
302
  NS_ASSERT_MSG (result == true, "AsciiTraceHelper::HookDefaultReceiveSinkWithoutContext():  Unable to hook \"" 
302
  NS_ASSERT_MSG (result == true, "AsciiTraceHelper::HookDefaultReceiveSinkWithoutContext():  Unable to hook \"" 
303
                 << tracename << "\"");
303
                 << tracename << "\"");
 Lines 310-316    Link Here 
310
  std::string tracename, 
310
  std::string tracename, 
311
  Ptr<OutputStreamWrapper> stream)
311
  Ptr<OutputStreamWrapper> stream)
312
{
312
{
313
  bool __attribute__ ((unused)) result = 
313
  bool result =
314
    object->TraceConnect (tracename, context, MakeBoundCallback (&DefaultReceiveSinkWithContext, stream));
314
    object->TraceConnect (tracename, context, MakeBoundCallback (&DefaultReceiveSinkWithContext, stream));
315
  NS_ASSERT_MSG (result == true, "AsciiTraceHelper::HookDefaultReceiveSinkWithContext():  Unable to hook \"" 
315
  NS_ASSERT_MSG (result == true, "AsciiTraceHelper::HookDefaultReceiveSinkWithContext():  Unable to hook \"" 
316
                 << tracename << "\"");
316
                 << tracename << "\"");
(-)a/src/network/model/socket.cc (-3 lines)
 Lines 314-322    Link Here 
314
            }
314
            }
315
        }
315
        }
316
      NS_ASSERT_MSG (found, "Socket cannot be bound to a NetDevice not existing on the Node");
316
      NS_ASSERT_MSG (found, "Socket cannot be bound to a NetDevice not existing on the Node");
317
      //cast found to void, to suppress 'found' set but not used compiler warning
318
      //in optimized builds
319
      (void) found;
320
    }
317
    }
321
  m_boundnetdevice = netdevice;
318
  m_boundnetdevice = netdevice;
322
  return;
319
  return;
(-)a/src/network/utils/packet-socket.cc (-3 lines)
 Lines 441-449    Link Here 
441
      bool found;
441
      bool found;
442
      found = packet->PeekPacketTag (tag);
442
      found = packet->PeekPacketTag (tag);
443
      NS_ASSERT (found);
443
      NS_ASSERT (found);
444
      //cast found to void, to suppress 'found' set but not used compiler warning
445
      //in optimized builds
446
      (void) found;
447
      fromAddress = tag.GetAddress ();
444
      fromAddress = tag.GetAddress ();
448
    }
445
    }
449
  return packet;
446
  return packet;
(-)a/src/network/utils/radiotap-header.cc (-2 / +5 lines)
 Lines 134-141    Link Here 
134
{
134
{
135
  NS_LOG_FUNCTION (this);
135
  NS_LOG_FUNCTION (this);
136
136
137
  uint8_t __attribute__ ((unused)) tmp = start.ReadU8 (); // major version of radiotap header
137
#ifdef NS3_ASSERT_ENABLE
138
  NS_ASSERT_MSG (tmp == 0x00, "RadiotapHeader::Deserialize(): Unexpected major version");
138
  NS_ASSERT_MSG (start.ReadU8 () == 0x00, "RadiotapHeader::Deserialize(): Unexpected major version"); // major version of radiotap header
139
#else
140
  start.Next (); // major version of radiotap header
141
#endif
139
  start.ReadU8 (); // pad field
142
  start.ReadU8 (); // pad field
140
143
141
  m_length = start.ReadU16 (); // entire length of radiotap data + header
144
  m_length = start.ReadU16 (); // entire length of radiotap data + header
(-)a/src/test/ns3wifi/wifi-interference-test-suite.cc (-3 / +2 lines)
 Lines 80-92    Link Here 
80
void 
80
void 
81
WifiInterferenceTestCase::ReceivePacket (Ptr<Socket> socket)
81
WifiInterferenceTestCase::ReceivePacket (Ptr<Socket> socket)
82
{
82
{
83
#ifdef NS3_LOG_ENABLE
83
  Address addr;
84
  Address addr;
84
  socket->GetSockName (addr);
85
  socket->GetSockName (addr);
85
  InetSocketAddress iaddr = InetSocketAddress::ConvertFrom (addr);
86
  InetSocketAddress iaddr = InetSocketAddress::ConvertFrom (addr);
86
  NS_LOG_UNCOND ("Received one packet!  Socket: " << iaddr.GetIpv4 () << " port: " << iaddr.GetPort ());
87
  NS_LOG_UNCOND ("Received one packet!  Socket: " << iaddr.GetIpv4 () << " port: " << iaddr.GetPort ());
87
  //cast iaddr to void, to suppress 'iaddr' set but not used compiler warning 
88
#endif
88
  //in optimized builds
89
  (void) iaddr;
90
}
89
}
91
90
92
void 
91
void 
(-)a/src/topology-read/model/rocketfuel-topology-reader.cc (-12 / +15 lines)
 Lines 25-30    Link Here 
25
#include <regex.h>
25
#include <regex.h>
26
26
27
#include "ns3/log.h"
27
#include "ns3/log.h"
28
#include "ns3/unused.h"
28
#include "rocketfuel-topology-reader.h"
29
#include "rocketfuel-topology-reader.h"
29
30
30
namespace ns3 {
31
namespace ns3 {
 Lines 76-81    Link Here 
76
int nodesNumber = 0;
77
int nodesNumber = 0;
77
std::map<std::string, Ptr<Node> > nodeMap;
78
std::map<std::string, Ptr<Node> > nodeMap;
78
79
80
void
81
PrintNodeInfo (std::string & uid, std::string & loc, bool dns, bool bb,
82
               std::vector <std::string>::size_type neighListSize,
83
               std::string & name, int radius)
84
{
85
  /* uid @loc [+] [bb] (num_neigh) [&ext] -> <nuid-1> <nuid-2> ... {-euid} ... =name[!] rn */
86
  NS_LOG_INFO ("Load Node[" << uid << "]: location: " << loc << " dns: " << dns
87
                            << " bb: " << bb << " neighbors: " << neighListSize
88
                            << "(" << "%d" << ") externals: \"%s\"(%d) "
89
                            << "name: " << name << " radius: " << radius);
90
}
91
79
NodeContainer
92
NodeContainer
80
RocketfuelTopologyReader::GenerateFromMapsFile (int argc, char *argv[])
93
RocketfuelTopologyReader::GenerateFromMapsFile (int argc, char *argv[])
81
{
94
{
 Lines 150-165    Link Here 
150
      return nodes;
163
      return nodes;
151
    }
164
    }
152
165
153
  /* uid @loc [+] [bb] (num_neigh) [&ext] -> <nuid-1> <nuid-2> ... {-euid} ... =name[!] rn */
166
  PrintNodeInfo (uid, loc, dns, bb, neigh_list.size (), name, radius);
154
  NS_LOG_INFO ("Load Node[" << uid << "]: location: " << loc << " dns: " << dns
155
                            << " bb: " << bb << " neighbors: " << neigh_list.size ()
156
                            << "(" << "%d" << ") externals: \"%s\"(%d) "
157
                            << "name: " << name << " radius: " << radius);
158
159
  //cast bb and dns to void, to suppress variable set but not used compiler warning
160
  //in optimized builds
161
  (void) bb;
162
  (void) dns;
163
167
164
  // Create node and link
168
  // Create node and link
165
  if (!uid.empty ())
169
  if (!uid.empty ())
 Lines 209-216    Link Here 
209
  sname = argv[0];
213
  sname = argv[0];
210
  tname = argv[1];
214
  tname = argv[1];
211
  double v = strtod (argv[2], &endptr); // weight
215
  double v = strtod (argv[2], &endptr); // weight
212
  // cast v to void , to suppress 'v' set but not used compiler warning
216
  NS_UNUSED (v); // suppress "set but not used" compiler warning in optimized builds
213
  (void) v;
214
  if (*endptr != '\0')
217
  if (*endptr != '\0')
215
    {
218
    {
216
      NS_LOG_WARN ("invalid weight: " << argv[2]);
219
      NS_LOG_WARN ("invalid weight: " << argv[2]);
(-)a/src/wifi/model/wifi-information-element.cc (-3 lines)
 Lines 55-63    Link Here 
55
  // This IE was not optional, so confirm that we did actually
55
  // This IE was not optional, so confirm that we did actually
56
  // deserialise something.
56
  // deserialise something.
57
  NS_ASSERT (i.GetDistanceFrom (start) != 0);
57
  NS_ASSERT (i.GetDistanceFrom (start) != 0);
58
  // cast start to void, to suppress ‘start’ set but not used
59
  // compiler warning in optimized builds
60
  (void) start;
61
  return i;
58
  return i;
62
}
59
}
63
60
(-)a/src/wifi/model/wifi-remote-station-manager.cc (-6 lines)
 Lines 368-376    Link Here 
368
      bool found;
368
      bool found;
369
      found = ConstCast<Packet> (packet)->PeekPacketTag (tag);
369
      found = ConstCast<Packet> (packet)->PeekPacketTag (tag);
370
      NS_ASSERT (found);
370
      NS_ASSERT (found);
371
      // cast found to void, to suppress 'found' set but not used
372
      // compiler warning
373
      (void) found;
374
      return tag.GetDataMode ();
371
      return tag.GetDataMode ();
375
    }
372
    }
376
  return DoGetDataMode (Lookup (address, header), fullPacketSize);
373
  return DoGetDataMode (Lookup (address, header), fullPacketSize);
 Lines 386-394    Link Here 
386
      bool found;
383
      bool found;
387
      found = ConstCast<Packet> (packet)->PeekPacketTag (tag);
384
      found = ConstCast<Packet> (packet)->PeekPacketTag (tag);
388
      NS_ASSERT (found);
385
      NS_ASSERT (found);
389
      // cast found to void, to suppress 'found' set but not used
390
      // compiler warning
391
      (void) found;
392
      return tag.GetRtsMode ();
386
      return tag.GetRtsMode ();
393
    }
387
    }
394
  return DoGetRtsMode (Lookup (address, header));
388
  return DoGetRtsMode (Lookup (address, header));

Return to bug 1170