[Ns-bugs] [Bug 486] Patches for compilation with icc
code@nsnam.ece.gatech.edu
code at nsnam.ece.gatech.edu
Wed Feb 4 06:50:19 PST 2009
http://www.nsnam.org/bugzilla/show_bug.cgi?id=486
--- Comment #2 from Mathieu Lacage <mathieu.lacage at sophia.inria.fr> 2009-02-04 09:50:19 EDT ---
(From update of attachment 368)
Eh ? The following change can't possibly be right: what is the error message
output by icc ?
>diff -r 3e819441bc75 -r 0ad61c84f3c6 src/core/object.h
>--- a/src/core/object.h Tue Feb 03 06:56:47 2009 -0800
>+++ b/src/core/object.h Wed Feb 04 13:08:04 2009 +0100
>@@ -403,15 +403,15 @@ Ptr<T> CreateObject (const AttributeList
>
> template <typename T>
> Ptr<T>
>-CreateObject (std::string n1 = "", const AttributeValue & v1 = EmptyAttributeValue (),
>- std::string n2 = "", const AttributeValue & v2 = EmptyAttributeValue (),
>- std::string n3 = "", const AttributeValue & v3 = EmptyAttributeValue (),
>- std::string n4 = "", const AttributeValue & v4 = EmptyAttributeValue (),
>- std::string n5 = "", const AttributeValue & v5 = EmptyAttributeValue (),
>- std::string n6 = "", const AttributeValue & v6 = EmptyAttributeValue (),
>- std::string n7 = "", const AttributeValue & v7 = EmptyAttributeValue (),
>- std::string n8 = "", const AttributeValue & v8 = EmptyAttributeValue (),
>- std::string n9 = "", const AttributeValue & v9 = EmptyAttributeValue ())
>+CreateObject (std::string n1 , const AttributeValue & v1,
>+ std::string n2 , const AttributeValue & v2,
>+ std::string n3 , const AttributeValue & v3,
>+ std::string n4 , const AttributeValue & v4,
>+ std::string n5 , const AttributeValue & v5,
>+ std::string n6 , const AttributeValue & v6,
>+ std::string n7 , const AttributeValue & v7,
>+ std::string n8 , const AttributeValue & v8,
>+ std::string n9 , const AttributeValue & v9)
> {
> AttributeList attributes;
> if (n1 == "")
What warning are you fixing below ?
>diff -r 3e819441bc75 -r 0ad61c84f3c6 src/internet-stack/ipv4-l3-protocol.cc
>--- a/src/internet-stack/ipv4-l3-protocol.cc Tue Feb 03 06:56:47 2009 -0800
>+++ b/src/internet-stack/ipv4-l3-protocol.cc Wed Feb 04 13:08:04 2009 +0100
>@@ -1068,8 +1068,8 @@ Ipv4L3Protocol::SetUp (uint32_t i)
> // If interface address and network mask have been set, add a route
> // to the network of the interface (like e.g. ifconfig does on a
> // Linux box)
>- if ((interface->GetAddress ()) != (Ipv4Address ())
>- && (interface->GetNetworkMask ()) != (Ipv4Mask ()))
>+ if ( ! interface->GetAddress ().IsEqual (Ipv4Address ())
>+ && (interface->GetNetworkMask ()) != (Ipv4Mask ()))
> {
> AddNetworkRouteTo (interface->GetAddress ().CombineMask (interface->GetNetworkMask ()),
> interface->GetNetworkMask (), i);
This is not really a warning fix, right ?
>diff -r 3e819441bc75 -r 0ad61c84f3c6 src/node/queue.cc
>--- a/src/node/queue.cc Tue Feb 03 06:56:47 2009 -0800
>+++ b/src/node/queue.cc Wed Feb 04 13:08:04 2009 +0100
>@@ -84,12 +84,12 @@ Queue::Dequeue (void)
>
> if (packet != 0)
> {
>+ NS_ASSERT (m_nBytes >= packet->GetSize ());
>+ NS_ASSERT (m_nPackets > 0);
>+
> m_nBytes -= packet->GetSize ();
> m_nPackets--;
>
>- NS_ASSERT (m_nBytes >= 0);
>- NS_ASSERT (m_nPackets >= 0);
>-
> NS_LOG_LOGIC("m_traceDequeue (packet)");
>
> m_traceDequeue (packet);
What warning are you fixing below ? LLU is not very portable so, adding:
uint64_t pow10 (uint8_t n)
{
NS_ASSERT (n > 0);
uint64_t result = 1;
for (uint8_t i = 0; i < n; i++)
{
result *= 10;
}
return result;
}
would be probably more portable.
>diff -r 3e819441bc75 -r 0ad61c84f3c6 src/simulator/time.cc
>--- a/src/simulator/time.cc Tue Feb 03 06:56:47 2009 -0800
>+++ b/src/simulator/time.cc Wed Feb 04 13:08:04 2009 +0100
>@@ -32,11 +32,11 @@ namespace ns3 {
>
> namespace TimeStepPrecision {
>
>-static const uint64_t MS_FACTOR = (uint64_t)pow(10,3);
>-static const uint64_t US_FACTOR = (uint64_t)pow(10,6);
>-static const uint64_t NS_FACTOR = (uint64_t)pow(10,9);
>-static const uint64_t PS_FACTOR = (uint64_t)pow(10,12);
>-static const uint64_t FS_FACTOR = (uint64_t)pow(10,15);
>+static const uint64_t MS_FACTOR = 1000LLU;
>+static const uint64_t US_FACTOR = 1000000LLU;
>+static const uint64_t NS_FACTOR = 1000000000LLU;
>+static const uint64_t PS_FACTOR = 1000000000000LLU;
>+static const uint64_t FS_FACTOR = 1000000000000000LLU;
> static uint64_t g_tsPrecFactor = NS_FACTOR;
>
> static GlobalValue g_precisionDefaultValue ("TimeStepPrecision",
--
Configure bugmail: http://www.nsnam.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the Ns-bugs
mailing list