fix optimized build
authorTom Henderson <tomh@tomh.org>
Sat, 26 Jan 2008 06:01:45 -0800
changeset 2227 48e8a213a27b
parent 2226 8484f2a3f797
child 2228 3ad777b4c99c
fix optimized build
examples/tcp-large-transfer-errors.cc
examples/tcp-large-transfer.cc
examples/tcp-small-transfer-oneloss.cc
examples/tcp-small-transfer.cc
src/internet-node/tcp-socket.cc
--- a/examples/tcp-large-transfer-errors.cc	Fri Jan 25 15:41:47 2008 -0800
+++ b/examples/tcp-large-transfer-errors.cc	Sat Jan 26 06:01:45 2008 -0800
@@ -70,6 +70,9 @@
 ApplicationTraceSink (const TraceContext &context, Ptr<const Packet> packet,
   const Address &addr)
 {
+// g_log is not declared in optimized builds
+// should convert this to use of some other flag than the logging system
+#ifdef NS3_LOG_ENABLE
   if (!g_log.IsNoneEnabled ()) {
     if (InetSocketAddress::IsMatchingType (addr) )
       {
@@ -89,6 +92,7 @@
         std::cout << std::endl << std::endl;
     }
   }
+#endif
 }
 
 void CloseConnection (Ptr<Socket> localSocket)
--- a/examples/tcp-large-transfer.cc	Fri Jan 25 15:41:47 2008 -0800
+++ b/examples/tcp-large-transfer.cc	Sat Jan 26 06:01:45 2008 -0800
@@ -70,6 +70,9 @@
 ApplicationTraceSink (const TraceContext &context, Ptr<const Packet> packet,
   const Address &addr)
 {
+// g_log is not declared in optimized builds
+// should convert this to use of some other flag than the logging system
+#ifdef NS3_LOG_ENABLE
   if (!g_log.IsNoneEnabled ()) {
     if (InetSocketAddress::IsMatchingType (addr) )
       {
@@ -89,6 +92,7 @@
         std::cout << std::endl << std::endl;
     }
   }
+#endif
 }
 
 void CloseConnection (Ptr<Socket> localSocket)
--- a/examples/tcp-small-transfer-oneloss.cc	Fri Jan 25 15:41:47 2008 -0800
+++ b/examples/tcp-small-transfer-oneloss.cc	Sat Jan 26 06:01:45 2008 -0800
@@ -70,6 +70,9 @@
 ApplicationTraceSink (const TraceContext &context, Ptr<const Packet> packet,
   const Address &addr)
 {
+// g_log is not declared in optimized builds
+// should convert this to use of some other flag than the logging system
+#ifdef NS3_LOG_ENABLE
   if (!g_log.IsNoneEnabled ()) {
     if (InetSocketAddress::IsMatchingType (addr) )
       {
@@ -89,6 +92,7 @@
         std::cout << std::endl << std::endl;
     }
   }
+#endif
 }
 
 void StartFlow(Ptr<Socket> localSocket, uint32_t nBytes, 
--- a/examples/tcp-small-transfer.cc	Fri Jan 25 15:41:47 2008 -0800
+++ b/examples/tcp-small-transfer.cc	Sat Jan 26 06:01:45 2008 -0800
@@ -70,6 +70,9 @@
 ApplicationTraceSink (const TraceContext &context, Ptr<const Packet> packet,
   const Address &addr)
 {
+// g_log is not declared in optimized builds
+// should convert this to use of some other flag than the logging system
+#ifdef NS3_LOG_ENABLE
   if (!g_log.IsNoneEnabled ()) {
     if (InetSocketAddress::IsMatchingType (addr) )
       {
@@ -89,6 +92,7 @@
         std::cout << std::endl << std::endl;
     }
   }
+#endif
 }
 
 void CloseConnection (Ptr<Socket> localSocket)
--- a/src/internet-node/tcp-socket.cc	Fri Jan 25 15:41:47 2008 -0800
+++ b/src/internet-node/tcp-socket.cc	Sat Jan 26 06:01:45 2008 -0800
@@ -910,9 +910,8 @@
     {
       m_retxEvent.Cancel ();
     }
-  uint32_t numberAck = ack - m_highestRxAck; // Number bytes ack'ed
   NS_LOG_LOGIC ("TCP " << this << " NewAck " << ack 
-           << " numberAck " << numberAck);
+           << " numberAck " << (ack - m_highestRxAck)); // Number bytes ack'ed
   m_highestRxAck = ack;         // Note the highest recieved Ack
   if (ack > m_nextTxSequence) 
     {