--- a/src/core/model/cairo-wideint.c +++ a/src/core/model/cairo-wideint.c @@ -313,11 +313,11 @@ den = _cairo_int64_negate (den); uqr = _cairo_uint64_divrem (num, den); if (num_neg) - qr.rem = _cairo_int64_negate ((cairo_int64_t)uqr.rem); //PDB + qr.rem = _cairo_int64_negate ((cairo_int64_t)uqr.rem); //PDB cast else qr.rem = uqr.rem; if (num_neg != den_neg) - qr.quo = (cairo_int64_t) _cairo_int64_negate ((cairo_int64_t)uqr.quo); //PDB + qr.quo = (cairo_int64_t) _cairo_int64_negate ((cairo_int64_t)uqr.quo); //PDB cast else qr.quo = (cairo_int64_t) uqr.quo; return qr; @@ -691,7 +691,7 @@ cairo_uint64_t x = _cairo_uint128_to_uint64 (_cairo_uint128_rsl(num, 32)); /* Initialise the result to indicate overflow. */ - result.quo = _cairo_uint32s_to_uint64 (UINT_MAX, UINT_MAX); //PDB + result.quo = _cairo_uint32s_to_uint64 (UINT_MAX, UINT_MAX); //PDB cast result.rem = den; /* Don't bother if the quotient is going to overflow. */ @@ -758,7 +758,7 @@ /* Add the main term's contribution to quotient. Note B-v = * -v as an uint32 (unless v = 0) */ if (v) - quorem = _cairo_uint64_divrem (_cairo_uint32x32_64_mul (q, -(int32_t)v), den); //PDB + quorem = _cairo_uint64_divrem (_cairo_uint32x32_64_mul (q, -(int32_t)v), den); //PDB cast else quorem = _cairo_uint64_divrem (_cairo_uint32s_to_uint64 (q, 0), den); quotient += _cairo_uint64_to_uint32 (quorem.quo); @@ -807,17 +807,17 @@ uqr = _cairo_uint_96by64_32x64_divrem (num, nonneg_den); if (_cairo_uint64_eq (uqr.rem, _cairo_int64_to_uint64 (nonneg_den))) { /* bail on overflow. */ - qr.quo = _cairo_uint32s_to_uint64 (0x7FFFFFFF, UINT_MAX); //PDB + qr.quo = _cairo_uint32s_to_uint64 (0x7FFFFFFF, UINT_MAX); //PDB cast qr.rem = den; return qr; } if (num_neg) - qr.rem = _cairo_int64_negate ((cairo_int64_t)uqr.rem); //PDB + qr.rem = _cairo_int64_negate ((cairo_int64_t)uqr.rem); //PDB cast else qr.rem = uqr.rem; if (num_neg != den_neg) - qr.quo = _cairo_int64_negate ((cairo_int64_t)uqr.quo); //PDB + qr.quo = _cairo_int64_negate ((cairo_int64_t)uqr.quo); //PDB cast else qr.quo = uqr.quo; return qr; --- a/src/core/model/config.cc +++ a/src/core/model/config.cc @@ -72,7 +72,7 @@ return static_cast(m_objects.size ()); } Ptr -MatchContainer::Get(std::size_t i) const +MatchContainer::Get (std::size_t i) const { NS_LOG_FUNCTION (this << i); return m_objects[i]; @@ -602,9 +602,9 @@ void UnregisterRootNamespaceObject (Ptr obj); /** \copydoc Config::GetRootNamespaceObjectN() */ - std::size_t GetRootNamespaceObjectN(void) const; + std::size_t GetRootNamespaceObjectN (void) const; /** \copydoc Config::GetRootNamespaceObject() */ - Ptr GetRootNamespaceObject(std::size_t i) const; + Ptr GetRootNamespaceObject (std::size_t i) const; private: /** @@ -747,7 +747,7 @@ return static_cast(m_roots.size ()); } Ptr -ConfigImpl::GetRootNamespaceObject(std::size_t i) const +ConfigImpl::GetRootNamespaceObject (std::size_t i) const { NS_LOG_FUNCTION (this << i); return m_roots[i]; --- a/src/core/model/hash-murmur3.cc +++ a/src/core/model/hash-murmur3.cc @@ -493,8 +493,8 @@ h1 += h2; h2 += h1; - ((uint32_t *)out)[0] = static_cast (h1); //PDB - ((uint32_t *)out)[1] = static_cast (h2); //PDB + ((uint32_t *)out)[0] = static_cast (h1); //PDB cast + ((uint32_t *)out)[1] = static_cast (h2); //PDB cast } --- a/src/core/model/object-ptr-container.cc +++ a/src/core/model/object-ptr-container.cc @@ -51,18 +51,17 @@ ObjectPtrContainerValue::GetN (void) const { NS_LOG_FUNCTION (this); - return static_cast(m_objects.size ()); + return m_objects.size (); } Ptr -ObjectPtrContainerValue::Get(std::size_t i) const +ObjectPtrContainerValue::Get (std::size_t i) const { NS_LOG_FUNCTION (this << i); - const unsigned int j = static_cast (i); - Iterator it = m_objects.find (j); + Iterator it = m_objects.find (i); Ptr value = 0; if ( it != m_objects.end () ) { - value = m_objects.find (j)->second; + value = m_objects.find (i)->second; } return value; } @@ -120,11 +119,11 @@ { return false; } - for (uint32_t i = 0; i < n; i++) + for (std::size_t i = 0; i < n; i++) { std::size_t index; Ptr o = DoGet (object, i, &index); - v->m_objects.insert (std::pair > (static_cast (index), o)); + v->m_objects[index] = o; } return true; } --- a/src/core/model/object-ptr-container.h +++ a/src/core/model/object-ptr-container.h @@ -46,7 +46,7 @@ { public: /** Iterator type for traversing this container. */ - typedef std::map >::const_iterator Iterator; + typedef std::map >::const_iterator Iterator; /** Default constructor. */ ObjectPtrContainerValue (); @@ -104,7 +104,7 @@ private: friend class ObjectPtrContainerAccessor; /** The container implementation. */ - std::map > m_objects; + std::map > m_objects; }; /** --- a/src/core/model/random-variable-stream.cc +++ a/src/core/model/random-variable-stream.cc @@ -1488,7 +1488,7 @@ } void -DeterministicRandomVariable::SetValueArray(double* values, std::size_t length) +DeterministicRandomVariable::SetValueArray (double* values, std::size_t length) { NS_LOG_FUNCTION (this << values << length); // Delete any values currently set. --- a/src/core/model/simple-ref-count.h +++ a/src/core/model/simple-ref-count.h @@ -83,7 +83,9 @@ */ SimpleRefCount (const SimpleRefCount &o) : m_count (1) - {NS_UNUSED(o);} + { + NS_UNUSED(o); + } /** * Assignment operator * \param [in] o The object to copy --- a/src/core/model/simulator.h +++ a/src/core/model/simulator.h @@ -185,13 +185,13 @@ static uint32_t GetContext (void); /** - * Context enum values. - * - * \internal - * This enum type is fixed to match the representation size - * of simulation context. - */ - enum : uint32_t { + * Context enum values. + * + * \internal + * This enum type is fixed to match the representation size + * of simulation context. + */ + enum : uint32_t { /** * Flag for events not associated with any particular context. */ --- a/src/core/model/test.h +++ a/src/core/model/test.h @@ -1426,19 +1426,19 @@ * * \returns The new test vector index */ - std::size_t Add(T vector); + std::size_t Add (T vector); /** * \brief Get the total number of test vectors. * \return The number of test vectors */ - std::size_t GetN(void) const; + std::size_t GetN (void) const; /** * \brief Get the i'th test vector * \param [in] i The requested vector index * \return The requested vector */ - T Get(std::size_t i) const; + T Get (std::size_t i) const; private: typedef std::vector TestVector; //!< Container type @@ -1467,7 +1467,7 @@ std::size_t TestVectors::Add (T vector) { - std::size_t index = m_vectors.size(); + std::size_t index = m_vectors.size (); m_vectors.push_back (vector); return index; } @@ -1481,7 +1481,7 @@ template T -TestVectors::Get(std::size_t i) const +TestVectors::Get (std::size_t i) const { NS_ABORT_MSG_UNLESS (m_vectors.size () > i, "TestVectors::Get(): Bad index"); return m_vectors[i]; --- a/src/core/model/type-id.cc +++ a/src/core/model/type-id.cc @@ -171,7 +171,7 @@ * Get the total number of type ids. * \returns The total number. */ - uint16_t GetRegisteredN(void) const; + uint16_t GetRegisteredN (void) const; /** * Get a type id by index. * @@ -213,22 +213,22 @@ * \param [in] i The attribute to manipulate * \param [in] initialValue The new initial value to use for this attribute. */ - void SetAttributeInitialValue(uint16_t uid, - std::size_t i, - Ptr initialValue); + void SetAttributeInitialValue (uint16_t uid, + std::size_t i, + Ptr initialValue); /** * Get the number of attributes. * \param [in] uid The id. * \returns The number of attributes associated to this TypeId */ - std::size_t GetAttributeN(uint16_t uid) const; + std::size_t GetAttributeN (uint16_t uid) const; /** * Get Attribute information by index. * \param [in] uid The id. * \param [in] i Index into attribute array * \returns The information associated to attribute whose index is \p i. */ - struct TypeId::AttributeInformation GetAttribute(uint16_t uid, std::size_t i) const; + struct TypeId::AttributeInformation GetAttribute (uint16_t uid, std::size_t i) const; /** * Record a new TraceSource. * \param [in] uid The id. @@ -256,14 +256,14 @@ * \param [in] uid The id. * \returns The number of trace sources defined in this TypeId. */ - std::size_t GetTraceSourceN(uint16_t uid) const; + std::size_t GetTraceSourceN (uint16_t uid) const; /** * Get the trace source by index. * \param [in] uid The id. * \param [in] i Index into trace source array. * \returns Detailed information about the requested trace source. */ - struct TypeId::TraceSourceInformation GetTraceSource(uint16_t uid, std::size_t i) const; + struct TypeId::TraceSourceInformation GetTraceSource (uint16_t uid, std::size_t i) const; /** * Check if this TypeId should not be listed in documentation. * \param [in] uid The id. @@ -423,7 +423,7 @@ else { // chain old type NS_LOG_LOGIC (IIDL << "Old TypeId '" << hinfo->name << "' getting chained."); - uint16_t oldUid = GetUid(hinfo->hash); + uint16_t oldUid = GetUid (hinfo->hash); m_hashmap.erase (m_hashmap.find (hinfo->hash)); hinfo->hash = hash | HashChainFlag; m_hashmap.insert (std::make_pair (hinfo->hash, oldUid)); @@ -440,14 +440,15 @@ information.hasConstructor = false; information.mustHideFromDocumentation = false; m_information.push_back (information); - uint16_t uid = static_cast (m_information.size()); - NS_ASSERT (uid <= 0xffff); + std::size_t tuid = m_information.size (); + NS_ASSERT (tuid <= 0xffff); + uint16_t uid = static_cast (tuid); // Add to both maps: m_namemap.insert (std::make_pair (name, uid)); m_hashmap.insert (std::make_pair (hash, uid)); NS_LOG_LOGIC (IIDL << uid); - return static_cast(uid); + return static_cast (uid); } struct IidManager::IidInformation * @@ -678,9 +679,9 @@ NS_LOG_LOGIC (IIDL << information->attributes.size () - 1); } void -IidManager::SetAttributeInitialValue(uint16_t uid, - std::size_t i, - Ptr initialValue) +IidManager::SetAttributeInitialValue (uint16_t uid, + std::size_t i, + Ptr initialValue) { NS_LOG_FUNCTION (IID << uid << i << initialValue); struct IidInformation *information = LookupInformation (uid); @@ -695,12 +696,12 @@ { NS_LOG_FUNCTION (IID << uid); struct IidInformation *information = LookupInformation (uid); - std::size_t size = information->attributes.size(); + std::size_t size = information->attributes.size (); NS_LOG_LOGIC (IIDL << size); return size; } struct TypeId::AttributeInformation -IidManager::GetAttribute(uint16_t uid, std::size_t i) const +IidManager::GetAttribute (uint16_t uid, std::size_t i) const { NS_LOG_FUNCTION (IID << uid << i); struct IidInformation *information = LookupInformation (uid); @@ -773,12 +774,12 @@ { NS_LOG_FUNCTION (IID << uid); struct IidInformation *information = LookupInformation (uid); - std::size_t size = information->traceSources.size(); + std::size_t size = information->traceSources.size (); NS_LOG_LOGIC (IIDL << size); return size; } struct TypeId::TraceSourceInformation -IidManager::GetTraceSource(uint16_t uid, std::size_t i) const +IidManager::GetTraceSource (uint16_t uid, std::size_t i) const { NS_LOG_FUNCTION (IID << uid << i); struct IidInformation *information = LookupInformation (uid); @@ -880,9 +881,9 @@ TypeId nextTid = *this; do { tid = nextTid; - for (std::size_t i = 0; i < tid.GetAttributeN(); i++) + for (std::size_t i = 0; i < tid.GetAttributeN (); i++) { - struct TypeId::AttributeInformation tmp = tid.GetAttribute(i); + struct TypeId::AttributeInformation tmp = tid.GetAttribute (i); if (tmp.name == name) { if (tmp.supportLevel == TypeId::SUPPORTED) @@ -1039,8 +1040,8 @@ } bool -TypeId::SetAttributeInitialValue(std::size_t i, - Ptr initialValue) +TypeId::SetAttributeInitialValue (std::size_t i, + Ptr initialValue) { NS_LOG_FUNCTION (this << i << initialValue); IidManager::Get ()->SetAttributeInitialValue (m_tid, i, initialValue); @@ -1068,20 +1069,20 @@ TypeId::GetAttributeN (void) const { NS_LOG_FUNCTION (this); - std::size_t n = IidManager::Get()->GetAttributeN(m_tid); + std::size_t n = IidManager::Get ()->GetAttributeN (m_tid); return n; } struct TypeId::AttributeInformation -TypeId::GetAttribute(std::size_t i) const +TypeId::GetAttribute (std::size_t i) const { NS_LOG_FUNCTION (this << i); - return IidManager::Get ()->GetAttribute(m_tid, i); + return IidManager::Get ()->GetAttribute (m_tid, i); } std::string -TypeId::GetAttributeFullName(std::size_t i) const +TypeId::GetAttributeFullName (std::size_t i) const { NS_LOG_FUNCTION (this << i); - struct TypeId::AttributeInformation info = GetAttribute(i); + struct TypeId::AttributeInformation info = GetAttribute (i); return GetName () + "::" + info.name; } @@ -1092,10 +1093,10 @@ return IidManager::Get ()->GetTraceSourceN (m_tid); } struct TypeId::TraceSourceInformation -TypeId::GetTraceSource(std::size_t i) const +TypeId::GetTraceSource (std::size_t i) const { NS_LOG_FUNCTION (this << i); - return IidManager::Get ()->GetTraceSource(m_tid, i); + return IidManager::Get ()->GetTraceSource (m_tid, i); } TypeId @@ -1141,7 +1142,7 @@ struct TypeId::TraceSourceInformation tmp; do { tid = nextTid; - for (std::size_t i = 0; i < tid.GetTraceSourceN(); i++) + for (std::size_t i = 0; i < tid.GetTraceSourceN (); i++) { tmp = tid.GetTraceSource (i); if (tmp.name == name) --- a/src/core/model/type-id.h +++ a/src/core/model/type-id.h @@ -254,14 +254,14 @@ * \param [in] i Index into attribute array * \returns The information associated to attribute whose index is \p i. */ - struct TypeId::AttributeInformation GetAttribute(std::size_t i) const; + struct TypeId::AttributeInformation GetAttribute (std::size_t i) const; /** * Get the Attribute name by index. * * \param [in] i Index into attribute array * \returns The full name associated to the attribute whose index is \p i. */ - std::string GetAttributeFullName(std::size_t i) const; + std::string GetAttributeFullName (std::size_t i) const; /** * Get the constructor callback. @@ -284,14 +284,14 @@ * * \returns The number of trace sources defined in this TypeId. */ - std::size_t GetTraceSourceN(void) const; + std::size_t GetTraceSourceN (void) const; /** * Get the trace source by index. * * \param [in] i Index into trace source array. * \returns Detailed information about the requested trace source. */ - struct TypeId::TraceSourceInformation GetTraceSource(std::size_t i) const; + struct TypeId::TraceSourceInformation GetTraceSource (std::size_t i) const; /** * Set the parent TypeId. @@ -390,8 +390,8 @@ * \param [in] initialValue The new initial value to use for this attribute. * \returns \c true if the call was successfuly. */ - bool SetAttributeInitialValue(std::size_t i, - Ptr initialValue); + bool SetAttributeInitialValue (std::size_t i, + Ptr initialValue); /** * Record in this TypeId the fact that a new attribute exists. --- a/src/core/test/attribute-test-suite.cc +++ a/src/core/test/attribute-test-suite.cc @@ -264,7 +264,7 @@ int16_t DoGetInt16 (void) const { return m_int16SetGet; } void DoSetInt16 (int16_t v) { m_int16SetGet = v; } std::size_t DoGetVectorN (void) const { return m_vector2.size (); } - Ptr DoGetVector(std::size_t i) const { return m_vector2[i]; } + Ptr DoGetVector (std::size_t i) const { return m_vector2[i]; } bool DoSetIntSrc (int8_t v) { m_intSrc2 = v; return true; } int8_t DoGetIntSrc (void) const { return m_intSrc2; } bool DoSetEnum (Test_e v) { m_enumSetGet = v; return true; } --- a/src/lte/test/lte-test-cell-selection.cc +++ a/src/lte/test/lte-test-cell-selection.cc @@ -154,7 +154,7 @@ { NS_LOG_FUNCTION (this << GetName ()); - Config::SetGlobal ("RngRun", UintegerValue(m_rngRun)); + Config::SetGlobal ("RngRun", UintegerValue (m_rngRun)); Ptr lteHelper = CreateObject (); lteHelper->SetAttribute ("PathlossModel", --- a/src/lte/test/lte-test-phy-error-model.cc +++ a/src/lte/test/lte-test-phy-error-model.cc @@ -166,7 +166,7 @@ Config::SetDefault ("ns3::LteSpectrumPhy::CtrlErrorModelEnabled", BooleanValue (false)); Config::SetDefault ("ns3::LteSpectrumPhy::DataErrorModelEnabled", BooleanValue (true)); Config::SetDefault ("ns3::RrFfMacScheduler::HarqEnabled", BooleanValue (false)); - Config::SetGlobal("RngRun", UintegerValue(m_rngRun)); + Config::SetGlobal ("RngRun", UintegerValue (m_rngRun)); //Disable Uplink Power Control Config::SetDefault ("ns3::LteUePhy::EnableUplinkPowerControl", BooleanValue (false)); @@ -322,7 +322,7 @@ Config::SetDefault ("ns3::LteSpectrumPhy::CtrlErrorModelEnabled", BooleanValue (true)); Config::SetDefault ("ns3::LteSpectrumPhy::DataErrorModelEnabled", BooleanValue (false)); Config::SetDefault ("ns3::RrFfMacScheduler::HarqEnabled", BooleanValue (false)); - Config::SetGlobal ("RngRun", UintegerValue(m_rngRun)); + Config::SetGlobal ("RngRun", UintegerValue (m_rngRun)); //Disable Uplink Power Control Config::SetDefault ("ns3::LteUePhy::EnableUplinkPowerControl", BooleanValue (false)); --- a/src/lte/test/lte-test-rlc-am-e2e.cc +++ a/src/lte/test/lte-test-rlc-am-e2e.cc @@ -133,22 +133,20 @@ { uint16_t numberOfNodes = 1; -#if 0 - LogLevel level = (LogLevel) (LOG_LEVEL_ALL | LOG_PREFIX_TIME | LOG_PREFIX_NODE | LOG_PREFIX_FUNC); - LogComponentEnable ("LteRlcAmE2eTest", level); - LogComponentEnable ("ErrorModel", level); - LogComponentEnable ("LteSimpleHelper", level); - LogComponentEnable ("LteSimpleNetDevice", level); - LogComponentEnable ("SimpleNetDevice", level); - LogComponentEnable ("SimpleChannel", level); - LogComponentEnable ("LteTestEntities", level); - LogComponentEnable ("LtePdcp", level); - LogComponentEnable ("LteRlc", level); - LogComponentEnable ("LteRlcUm", level); - LogComponentEnable ("LteRlcAm", level); -#endif + // LogLevel level = (LogLevel) (LOG_LEVEL_ALL | LOG_PREFIX_TIME | LOG_PREFIX_NODE | LOG_PREFIX_FUNC); + // LogComponentEnable ("LteRlcAmE2eTest", level); + // LogComponentEnable ("ErrorModel", level); + // LogComponentEnable ("LteSimpleHelper", level); + // LogComponentEnable ("LteSimpleNetDevice", level); + // LogComponentEnable ("SimpleNetDevice", level); + // LogComponentEnable ("SimpleChannel", level); + // LogComponentEnable ("LteTestEntities", level); + // LogComponentEnable ("LtePdcp", level); + // LogComponentEnable ("LteRlc", level); + // LogComponentEnable ("LteRlcUm", level); + // LogComponentEnable ("LteRlcAm", level); - Config::SetGlobal ("RngRun", UintegerValue(m_run)); + Config::SetGlobal ("RngRun", UintegerValue (m_run)); Config::SetDefault ("ns3::LteRlcAm::PollRetransmitTimer", TimeValue (MilliSeconds (20))); Config::SetDefault ("ns3::LteRlcAm::ReorderingTimer", TimeValue (MilliSeconds (10))); Config::SetDefault ("ns3::LteRlcAm::StatusProhibitTimer", TimeValue (MilliSeconds (40)));