diff --git a/src/node/onoff-application.cc b/src/node/onoff-application.cc index a4f00621d..a62b9d639 100644 --- a/src/node/onoff-application.cc +++ b/src/node/onoff-application.cc @@ -60,7 +60,7 @@ uint32_t OnOffApplication::g_defaultSize = 512; m_cbrRate(rate), m_pktSize(size), m_residualBits(0), - m_lastStartTime((HighPrecision)0), + m_lastStartTime(0), m_maxBytes(0xffffffff), m_totBytes(0), m_startStopScheduled(false), diff --git a/src/simulator/nstime.h b/src/simulator/nstime.h index cfa07f0eb..464fe58ce 100644 --- a/src/simulator/nstime.h +++ b/src/simulator/nstime.h @@ -308,21 +308,6 @@ class TimeUnit<1> // -*- New methods -*- public: - /** - * \brief String constructor - * Construct TimeUnit<1> object from common time expressions like " - * 1ms" or "10s". Supported units include: - * - s (seconds) - * - ms (milliseconds) - * - us (microseconds) - * - ns (nanoseconds) - * - * There can be no white space between the numerical portion - * and the units. Any otherwise malformed string causes a fatal error to - * occur. - * \param s The string to parse into a TimeUnit<1> - */ - TimeUnit<1>(const std::string& s); /** * \returns an approximation in seconds of the time stored in this * instance. diff --git a/src/simulator/time.cc b/src/simulator/time.cc index bcd7b94e3..7ad27c48b 100644 --- a/src/simulator/time.cc +++ b/src/simulator/time.cc @@ -20,43 +20,9 @@ */ #include "time.h" #include "simulator.h" -#include "ns3/fatal-error.h" namespace ns3 { -TimeUnit<1>::TimeUnit<1>(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::string trailer = s.substr(n, std::string::npos); - if (trailer == std::string("s")) - { - m_data = HighPrecision (r * 1000000000.0); - return; - } - if (trailer == std::string("ms")) - { - m_data = HighPrecision ((int64_t)(r * 1000000), false); - return; - } - if (trailer == std::string("us")) - { - m_data = HighPrecision ((int64_t)(r * 1000), false); - return; - } - if (trailer == std::string("ns")) - { - m_data = HighPrecision ((int64_t)r, false); - return; - } - NS_FATAL_ERROR("Can't Parse Time "<::GetSeconds (void) const {