fix optimized build, bug 169
This commit is contained in:
@@ -374,6 +374,9 @@ public:
|
||||
#define LogComponentDisableAll(level)
|
||||
#define LogRegisterTimePrinter(printer)
|
||||
|
||||
#define LogSetTimePrinter(printer)
|
||||
#define LogGetTimePrinter
|
||||
|
||||
#endif /* LOG_ENABLE */
|
||||
|
||||
#endif // __LOG_H__
|
||||
|
||||
@@ -262,12 +262,10 @@ Ipv4AddressGeneratorImpl::AddAllocated (const Ipv4Address address)
|
||||
|
||||
NS_ASSERT_MSG (addr, "Ipv4AddressGeneratorImpl::Add(): "
|
||||
"Allocating the broadcast address is not a good idea");
|
||||
|
||||
std::list<Entry>::iterator i;
|
||||
|
||||
std::list<Entry>::iterator i, j;
|
||||
|
||||
for (i = m_entries.begin (), j = m_entries.begin (), ++j;
|
||||
i != m_entries.end ();
|
||||
++i, ++j)
|
||||
for (i = m_entries.begin (); i != m_entries.end (); ++i)
|
||||
{
|
||||
NS_LOG_LOGIC ("examine entry: " << Ipv4Address ((*i).addrLow) <<
|
||||
" to " << Ipv4Address ((*i).addrHigh));
|
||||
@@ -277,11 +275,12 @@ Ipv4AddressGeneratorImpl::AddAllocated (const Ipv4Address address)
|
||||
//
|
||||
if (addr >= (*i).addrLow && addr <= (*i).addrHigh)
|
||||
{
|
||||
NS_LOG_LOGIC ("Ipv4AddressGeneratorImpl::Add(): Address Collision: " << Ipv4Address (addr));
|
||||
NS_LOG_LOGIC ("Ipv4AddressGeneratorImpl::Add(): "
|
||||
"Address Collision: " << Ipv4Address (addr));
|
||||
if (!m_test)
|
||||
{
|
||||
NS_ASSERT_MSG (0,
|
||||
"Ipv4AddressGeneratorImpl::Add(): Address Collision: " << Ipv4Address (addr));
|
||||
NS_ASSERT_MSG (0, "Ipv4AddressGeneratorImpl::Add(): "
|
||||
"Address Collision: " << Ipv4Address (addr));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -303,6 +302,9 @@ Ipv4AddressGeneratorImpl::AddAllocated (const Ipv4Address address)
|
||||
//
|
||||
if (addr == (*i).addrHigh + 1)
|
||||
{
|
||||
std::list<Entry>::iterator j = i;
|
||||
++j;
|
||||
|
||||
if (j != m_entries.end ())
|
||||
{
|
||||
if (addr == (*j).addrLow)
|
||||
|
||||
@@ -437,7 +437,9 @@ Simulator::GetPriv (void)
|
||||
m_priv = CreateObject<SimulatorPrivate> ();
|
||||
Ptr<Scheduler> scheduler = CreateObject<MapScheduler> ();
|
||||
m_priv->SetScheduler (scheduler);
|
||||
#ifdef NS3_LOG_ENABLE
|
||||
LogSetTimePrinter (&TimePrinter);
|
||||
#endif /* NS3_LOG_ENABLE */
|
||||
}
|
||||
TRACE_S ("priv " << m_priv);
|
||||
return m_priv;
|
||||
@@ -455,7 +457,9 @@ Simulator::Destroy (void)
|
||||
* Simulator::GetPriv will trigger again an infinite recursion until the stack
|
||||
* explodes.
|
||||
*/
|
||||
#ifdef NS3_LOG_ENABLE
|
||||
LogSetTimePrinter (0);
|
||||
#endif /* NS3_LOG_ENABLE */
|
||||
m_priv->Destroy ();
|
||||
m_priv = 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user