diff --git a/src/common/buffer.h b/src/common/buffer.h index b86d0a49c..245f31ea8 100644 --- a/src/common/buffer.h +++ b/src/common/buffer.h @@ -536,6 +536,7 @@ private: #ifdef BUFFER_USE_INLINE #include "ns3/assert.h" +#include namespace ns3 { diff --git a/src/common/data-rate.cc b/src/common/data-rate.cc index e7727dda0..61d6f6550 100644 --- a/src/common/data-rate.cc +++ b/src/common/data-rate.cc @@ -29,7 +29,10 @@ DoParse (const std::string s, uint64_t *v) std::string::size_type n = s.find_first_not_of("0123456789."); if (n != std::string::npos) { // Found non-numeric - double r = ::atof(s.substr(0, n).c_str()); + std::istringstream iss; + iss.str (s.substr(0, n)); + double r; + iss >> r; std::string trailer = s.substr(n, std::string::npos); if (trailer == "bps") { @@ -117,7 +120,9 @@ DoParse (const std::string s, uint64_t *v) } return true; } - *v = ::atoll(s.c_str()); + std::istringstream iss; + iss.str (s); + iss >> *v; return true; } diff --git a/src/common/tag-list.cc b/src/common/tag-list.cc index 6af8ec7a9..4f8fdaf92 100644 --- a/src/common/tag-list.cc +++ b/src/common/tag-list.cc @@ -20,6 +20,7 @@ #include "tag-list.h" #include "ns3/log.h" #include +#include NS_LOG_COMPONENT_DEFINE ("TagList"); diff --git a/src/contrib/config-store.cc b/src/contrib/config-store.cc index 55f9d7070..d4250bb50 100644 --- a/src/contrib/config-store.cc +++ b/src/contrib/config-store.cc @@ -8,6 +8,7 @@ #include #include #include +#include NS_LOG_COMPONENT_DEFINE ("ConfigStore"); diff --git a/src/core/callback.h b/src/core/callback.h index 40afbd1a6..9d72aeb84 100644 --- a/src/core/callback.h +++ b/src/core/callback.h @@ -25,6 +25,7 @@ #include "fatal-error.h" #include "empty.h" #include "type-traits.h" +#include namespace ns3 { diff --git a/src/core/double.h b/src/core/double.h index 1ed54ecdd..d21b97847 100644 --- a/src/core/double.h +++ b/src/core/double.h @@ -23,6 +23,7 @@ #include "attribute.h" #include "attribute-helper.h" #include +#include namespace ns3 { diff --git a/src/core/integer.h b/src/core/integer.h index 8ac78e47d..2bb8125a9 100644 --- a/src/core/integer.h +++ b/src/core/integer.h @@ -23,6 +23,7 @@ #include "attribute.h" #include "attribute-helper.h" #include +#include namespace ns3 { diff --git a/src/core/uinteger.h b/src/core/uinteger.h index c67709272..881f103bf 100644 --- a/src/core/uinteger.h +++ b/src/core/uinteger.h @@ -23,6 +23,7 @@ #include "attribute.h" #include "attribute-helper.h" #include +#include namespace ns3 { diff --git a/src/devices/wifi/status-code.h b/src/devices/wifi/status-code.h index e7daf9e26..cbeffc570 100644 --- a/src/devices/wifi/status-code.h +++ b/src/devices/wifi/status-code.h @@ -21,6 +21,7 @@ #define STATUS_CODE_H #include +#include #include "ns3/buffer.h" namespace ns3 { diff --git a/src/devices/wifi/supported-rates.h b/src/devices/wifi/supported-rates.h index 417390f1a..0e52cbe50 100644 --- a/src/devices/wifi/supported-rates.h +++ b/src/devices/wifi/supported-rates.h @@ -21,6 +21,7 @@ #define SUPPORTED_RATES_H #include +#include #include "ns3/buffer.h" namespace ns3 { diff --git a/src/helper/internet-stack-helper.cc b/src/helper/internet-stack-helper.cc index 8b6661bfb..792f6e528 100644 --- a/src/helper/internet-stack-helper.cc +++ b/src/helper/internet-stack-helper.cc @@ -26,6 +26,7 @@ #include "ns3/packet-socket-factory.h" #include "ns3/config.h" #include "ns3/simulator.h" +#include namespace ns3 { diff --git a/src/helper/olsr-helper.h b/src/helper/olsr-helper.h index f481fe110..cce8e4aea 100644 --- a/src/helper/olsr-helper.h +++ b/src/helper/olsr-helper.h @@ -39,7 +39,7 @@ public: */ void SetAgent (std::string tid, std::string n0 = "", const AttributeValue &v0 = EmptyAttributeValue (), - std::string n1 = "", const AttributeValue &v2 = EmptyAttributeValue (), + 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 (), diff --git a/src/internet-stack/sgi-hashmap.h b/src/internet-stack/sgi-hashmap.h index 375d25fee..642fb5f5b 100644 --- a/src/internet-stack/sgi-hashmap.h +++ b/src/internet-stack/sgi-hashmap.h @@ -20,8 +20,14 @@ namespace sgi = std; // GCC 3.0 namespace sgi = ::__gnu_cxx; // GCC 3.1 and later #endif #else // gcc 4.x and later + #if __GNUC_MINOR__ < 3 #include - namespace sgi = ::__gnu_cxx; +namespace sgi = ::__gnu_cxx; + #else +#undef __DEPRECATED + #include +namespace sgi = ::__gnu_cxx; + #endif #endif #endif #else // ... there are other compilers, right? diff --git a/src/node/address.cc b/src/node/address.cc index 365161e63..a9f679c63 100644 --- a/src/node/address.cc +++ b/src/node/address.cc @@ -1,5 +1,6 @@ #include "ns3/assert.h" #include "address.h" +#include #include #include diff --git a/src/node/mac48-address.cc b/src/node/mac48-address.cc index 9683f80d1..6dbb8d312 100644 --- a/src/node/mac48-address.cc +++ b/src/node/mac48-address.cc @@ -22,6 +22,7 @@ #include "ns3/assert.h" #include #include +#include namespace ns3 { diff --git a/src/node/mac64-address.cc b/src/node/mac64-address.cc index 13c4913eb..666397624 100644 --- a/src/node/mac64-address.cc +++ b/src/node/mac64-address.cc @@ -22,6 +22,7 @@ #include "ns3/assert.h" #include #include +#include namespace ns3 { diff --git a/src/node/socket.cc b/src/node/socket.cc index 52f691c57..d133e936f 100644 --- a/src/node/socket.cc +++ b/src/node/socket.cc @@ -25,6 +25,7 @@ #include "node.h" #include "socket.h" #include "socket-factory.h" +#include NS_LOG_COMPONENT_DEFINE ("Socket"); diff --git a/src/routing/global-routing/global-route-manager-impl.cc b/src/routing/global-routing/global-route-manager-impl.cc index bf40994b0..8230c2a7f 100644 --- a/src/routing/global-routing/global-route-manager-impl.cc +++ b/src/routing/global-routing/global-route-manager-impl.cc @@ -1425,6 +1425,7 @@ GlobalRouteManagerImpl::SPFVertexAddParent (SPFVertex* v) #include "ns3/test.h" #include "ns3/simulator.h" +#include // for rand () namespace ns3 { diff --git a/src/simulator/time.cc b/src/simulator/time.cc index a25770277..ba36543e6 100644 --- a/src/simulator/time.cc +++ b/src/simulator/time.cc @@ -72,7 +72,10 @@ TimeUnit<1>::TimeUnit(const std::string& s) std::string::size_type n = s.find_first_not_of("0123456789."); if (n != std::string::npos) { // Found non-numeric - double r = atof(s.substr(0, n).c_str()); + std::istringstream iss; + iss.str (s.substr(0, n)); + double r; + iss >> r; std::string trailer = s.substr(n, std::string::npos); if (trailer == std::string("s")) { @@ -113,7 +116,11 @@ TimeUnit<1>::TimeUnit(const std::string& s) } //else //they didn't provide units, assume seconds - m_data = HighPrecision (atof(s.c_str()) * TimeStepPrecision::g_tsPrecFactor); + std::istringstream iss; + iss. str (s); + double v; + iss >> v; + m_data = HighPrecision (v * TimeStepPrecision::g_tsPrecFactor); } double diff --git a/utils/bench-packets.cc b/utils/bench-packets.cc index 22643a52c..5ea80088e 100644 --- a/utils/bench-packets.cc +++ b/utils/bench-packets.cc @@ -23,6 +23,7 @@ #include #include #include +#include // for exit () using namespace ns3; @@ -261,7 +262,9 @@ int main (int argc, char *argv[]) if (strncmp ("--n=", argv[0],strlen ("--n=")) == 0) { char const *nAscii = argv[0] + strlen ("--n="); - n = atoi (nAscii); + std::istringstream iss; + iss.str (nAscii); + iss >> n; } argc--; argv++; diff --git a/utils/bench-simulator.cc b/utils/bench-simulator.cc index 6b9eb2c2b..6480ab5f5 100644 --- a/utils/bench-simulator.cc +++ b/utils/bench-simulator.cc @@ -23,6 +23,7 @@ #include #include #include +#include using namespace ns3; diff --git a/utils/replay-simulation.cc b/utils/replay-simulation.cc index 1ce94dab9..33a81a398 100644 --- a/utils/replay-simulation.cc +++ b/utils/replay-simulation.cc @@ -24,6 +24,7 @@ #include #include #include +#include using namespace ns3;