unused variables
authorCraig Dowell <craigdo@ee.washington.edu>
Fri, 29 Jan 2010 22:08:09 -0800
changeset 6036 5d89e247af46
parent 6035 ecd8840c3573
child 6037 fedfb1cedb9b
unused variables
src/helper/internet-stack-helper.cc
src/helper/trace-helper.cc
src/helper/trace-helper.h
src/node/radiotap-header.cc
src/test/perf/perf-pcap.cc
--- a/src/helper/internet-stack-helper.cc	Fri Jan 29 20:08:50 2010 -0800
+++ b/src/helper/internet-stack-helper.cc	Fri Jan 29 22:08:09 2010 -0800
@@ -706,7 +706,7 @@
           // be aggregated to the same node.
           //
           Ptr<Ipv4L3Protocol> ipv4L3Protocol = ipv4->GetObject<Ipv4L3Protocol> ();
-          bool result = ipv4L3Protocol->TraceConnectWithoutContext ("Drop", 
+          bool __attribute__ ((unused)) result = ipv4L3Protocol->TraceConnectWithoutContext ("Drop", 
             MakeBoundCallback (&Ipv4L3ProtocolDropSinkWithoutContext, theStream));
           NS_ASSERT_MSG (result == true, "InternetStackHelper::EanableAsciiIpv4Internal():  "
                          "Unable to connect ipv4L3Protocol \"Drop\"");
@@ -882,7 +882,7 @@
           // be aggregated to the same node.
           //
           Ptr<Ipv6L3Protocol> ipv6L3Protocol = ipv6->GetObject<Ipv6L3Protocol> ();
-          bool result = ipv6L3Protocol->TraceConnectWithoutContext ("Drop", 
+          bool __attribute__ ((unused)) result = ipv6L3Protocol->TraceConnectWithoutContext ("Drop", 
             MakeBoundCallback (&Ipv6L3ProtocolDropSinkWithoutContext, theStream));
           NS_ASSERT_MSG (result == true, "InternetStackHelper::EnableAsciiIpv6Internal():  "
                          "Unable to connect ipv6L3Protocol \"Drop\"");
--- a/src/helper/trace-helper.cc	Fri Jan 29 20:08:50 2010 -0800
+++ b/src/helper/trace-helper.cc	Fri Jan 29 22:08:09 2010 -0800
@@ -186,7 +186,7 @@
   NS_LOG_FUNCTION (filename << filemode);
 
   std::ofstream *ofstream = new std::ofstream;
-  std::ios_base::openmode mode;
+  std::ios_base::openmode mode = std::ios_base::out | std::ios_base::trunc;
 
   if (filemode == "a")
     {
--- a/src/helper/trace-helper.h	Fri Jan 29 20:08:50 2010 -0800
+++ b/src/helper/trace-helper.h	Fri Jan 29 22:08:09 2010 -0800
@@ -96,7 +96,8 @@
 template <typename T> void
 PcapHelper::HookDefaultSink (Ptr<T> object, std::string tracename, Ptr<PcapFileObject> file)
 {
-  bool result = object->TraceConnectWithoutContext (tracename.c_str (), MakeBoundCallback (&DefaultSink, file));
+  bool __attribute__ ((unused)) result = 
+    object->TraceConnectWithoutContext (tracename.c_str (), MakeBoundCallback (&DefaultSink, file));
   NS_ASSERT_MSG (result == true, "PcapHelper::HookDefaultSink():  Unable to hook \"" << tracename << "\"");
 }
 
@@ -231,8 +232,8 @@
 template <typename T> void
 AsciiTraceHelper::HookDefaultEnqueueSinkWithoutContext (Ptr<T> object, std::string tracename, Ptr<OutputStreamObject> file)
 {
-  bool result = object->TraceConnectWithoutContext (tracename, 
-                                                    MakeBoundCallback (&DefaultEnqueueSinkWithoutContext, file));
+  bool __attribute__ ((unused)) result = 
+    object->TraceConnectWithoutContext (tracename, MakeBoundCallback (&DefaultEnqueueSinkWithoutContext, file));
   NS_ASSERT_MSG (result == true, "AsciiTraceHelper::HookDefaultEnqueueSinkWithoutContext():  Unable to hook \"" 
                  << tracename << "\"");
 }
@@ -244,7 +245,8 @@
   std::string tracename, 
   Ptr<OutputStreamObject> stream)
 {
-  bool result = object->TraceConnect (tracename, context, MakeBoundCallback (&DefaultEnqueueSinkWithContext, stream));
+  bool __attribute__ ((unused)) result = 
+    object->TraceConnect (tracename, context, MakeBoundCallback (&DefaultEnqueueSinkWithContext, stream));
   NS_ASSERT_MSG (result == true, "AsciiTraceHelper::HookDefaultEnqueueSinkWithContext():  Unable to hook \"" 
                  << tracename << "\"");
 }
@@ -252,8 +254,8 @@
 template <typename T> void
 AsciiTraceHelper::HookDefaultDropSinkWithoutContext (Ptr<T> object, std::string tracename, Ptr<OutputStreamObject> file)
 {
-  bool result = object->TraceConnectWithoutContext (tracename, 
-                                                    MakeBoundCallback (&DefaultDropSinkWithoutContext, file));
+  bool __attribute__ ((unused)) result = 
+    object->TraceConnectWithoutContext (tracename, MakeBoundCallback (&DefaultDropSinkWithoutContext, file));
   NS_ASSERT_MSG (result == true, "AsciiTraceHelper::HookDefaultDropSinkWithoutContext():  Unable to hook \"" 
                  << tracename << "\"");
 }
@@ -265,7 +267,8 @@
   std::string tracename, 
   Ptr<OutputStreamObject> stream)
 {
-  bool result = object->TraceConnect (tracename, context, MakeBoundCallback (&DefaultDropSinkWithContext, stream));
+  bool __attribute__ ((unused)) result = 
+    object->TraceConnect (tracename, context, MakeBoundCallback (&DefaultDropSinkWithContext, stream));
   NS_ASSERT_MSG (result == true, "AsciiTraceHelper::HookDefaultDropSinkWithContext():  Unable to hook \"" 
                  << tracename << "\"");
 }
@@ -273,8 +276,8 @@
 template <typename T> void
 AsciiTraceHelper::HookDefaultDequeueSinkWithoutContext (Ptr<T> object, std::string tracename, Ptr<OutputStreamObject> file)
 {
-  bool result = object->TraceConnectWithoutContext (tracename, 
-                                                    MakeBoundCallback (&DefaultDequeueSinkWithoutContext, file));
+  bool __attribute__ ((unused)) result = 
+    object->TraceConnectWithoutContext (tracename, MakeBoundCallback (&DefaultDequeueSinkWithoutContext, file));
   NS_ASSERT_MSG (result == true, "AsciiTraceHelper::HookDefaultDequeueSinkWithoutContext():  Unable to hook \"" 
                  << tracename << "\"");
 }
@@ -286,7 +289,8 @@
   std::string tracename, 
   Ptr<OutputStreamObject> stream)
 {
-  bool result = object->TraceConnect (tracename, context, MakeBoundCallback (&DefaultDequeueSinkWithContext, stream));
+  bool __attribute__ ((unused)) result = 
+    object->TraceConnect (tracename, context, MakeBoundCallback (&DefaultDequeueSinkWithContext, stream));
   NS_ASSERT_MSG (result == true, "AsciiTraceHelper::HookDefaultDequeueSinkWithContext():  Unable to hook \"" 
                  << tracename << "\"");
 }
@@ -294,8 +298,8 @@
 template <typename T> void
 AsciiTraceHelper::HookDefaultReceiveSinkWithoutContext (Ptr<T> object, std::string tracename, Ptr<OutputStreamObject> file)
 {
-  bool result = object->TraceConnectWithoutContext (tracename, 
-                                                    MakeBoundCallback (&DefaultReceiveSinkWithoutContext, file));
+  bool __attribute__ ((unused)) result = 
+    object->TraceConnectWithoutContext (tracename, MakeBoundCallback (&DefaultReceiveSinkWithoutContext, file));
   NS_ASSERT_MSG (result == true, "AsciiTraceHelper::HookDefaultReceiveSinkWithoutContext():  Unable to hook \"" 
                  << tracename << "\"");
 }
@@ -307,7 +311,8 @@
   std::string tracename, 
   Ptr<OutputStreamObject> stream)
 {
-  bool result = object->TraceConnect (tracename, context, MakeBoundCallback (&DefaultReceiveSinkWithContext, stream));
+  bool __attribute__ ((unused)) result = 
+    object->TraceConnect (tracename, context, MakeBoundCallback (&DefaultReceiveSinkWithContext, stream));
   NS_ASSERT_MSG (result == true, "AsciiTraceHelper::HookDefaultReceiveSinkWithContext():  Unable to hook \"" 
                  << tracename << "\"");
 }
--- a/src/node/radiotap-header.cc	Fri Jan 29 20:08:50 2010 -0800
+++ b/src/node/radiotap-header.cc	Fri Jan 29 22:08:09 2010 -0800
@@ -132,7 +132,7 @@
 {
   NS_LOG_FUNCTION (this);
     
-  uint8_t tmp = start.ReadU8 (); // major version of radiotap header
+  uint8_t __attribute__ ((unused)) tmp = start.ReadU8 (); // major version of radiotap header
   NS_ASSERT_MSG (tmp == 0x00, "RadiotapHeader::Deserialize(): Unexpected major version");
   start.ReadU8 (); // pad field
   
--- a/src/test/perf/perf-pcap.cc	Fri Jan 29 20:08:50 2010 -0800
+++ b/src/test/perf/perf-pcap.cc	Fri Jan 29 22:08:09 2010 -0800
@@ -25,7 +25,7 @@
 
 using namespace ns3;
 
-NS_LOG_COMPONENT_DEFINE ("PerfPcap");
+//NS_LOG_COMPONENT_DEFINE ("PerfPcap");
 
 bool g_passheader = true;
 bool g_addheader = true;
@@ -87,10 +87,10 @@
 
       Ptr<Packet> p = Create<Packet> (1024);
 
-      //      NS_LOG_UNCOND ("timing old style pcap file write of 1K packet");
-      //      NS_LOG_UNCOND ("g_addheader = " << g_addheader);
-      //      NS_LOG_UNCOND ("g_passheader = " << g_passheader);
-      //      NS_LOG_UNCOND ("n = " << n);
+      //NS_LOG_UNCOND ("timing old style pcap file write of 1K packet");
+      //NS_LOG_UNCOND ("g_addheader = " << g_addheader);
+      //NS_LOG_UNCOND ("g_passheader = " << g_passheader);
+      //NS_LOG_UNCOND ("n = " << n);
 
       SystemWallClockMs ms;
       ms.Start ();
@@ -116,10 +116,10 @@
 
       Ptr<Packet> p = Create<Packet> (1024);
 
-      NS_LOG_UNCOND ("timing new style pcap file write of 1K packet");
-      NS_LOG_UNCOND ("g_addheader = " << g_addheader);
-      NS_LOG_UNCOND ("g_passheader = " << g_passheader);
-      NS_LOG_UNCOND ("n = " << n);
+      //NS_LOG_UNCOND ("timing new style pcap file write of 1K packet");
+      //NS_LOG_UNCOND ("g_addheader = " << g_addheader);
+      //NS_LOG_UNCOND ("g_passheader = " << g_passheader);
+      //NS_LOG_UNCOND ("n = " << n);
 
       SystemWallClockMs ms;
       ms.Start ();
@@ -132,5 +132,5 @@
       et = ms.End ();
     }
 
-  //  NS_LOG_UNCOND ("elapsed time = " << et);
+  //NS_LOG_UNCOND ("elapsed time = " << et);
 }