From 9c7509db4f6d9e9a7180ad0ff7490a85dbcfcd3e Mon Sep 17 00:00:00 2001 From: Khang Ngo Date: Tue, 1 Nov 2016 20:45:57 -0700 Subject: [PATCH] Change SharedPtr to shared_ptr. --- openvdb_points/tools/AttributeArray.h | 12 ++++++------ openvdb_points/tools/AttributeSet.cc | 5 ++--- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/openvdb_points/tools/AttributeArray.h b/openvdb_points/tools/AttributeArray.h index c178fefd4f..f2fd093ac8 100644 --- a/openvdb_points/tools/AttributeArray.h +++ b/openvdb_points/tools/AttributeArray.h @@ -190,8 +190,8 @@ class AttributeArray }; #endif - using Ptr = SharedPtr; - using ConstPtr = SharedPtr; + using Ptr = std::shared_ptr; + using ConstPtr = std::shared_ptr; using FactoryMethod = Ptr (*)(size_t, Index); @@ -434,8 +434,8 @@ template class TypedAttributeArray: public AttributeArray { public: - using Ptr = SharedPtr; - using ConstPtr = SharedPtr; + using Ptr = std::shared_ptr; + using ConstPtr = std::shared_ptr; using ValueType = ValueType_; using Codec = Codec_; @@ -605,7 +605,7 @@ class AttributeHandle { public: using Handle = AttributeHandle; - using Ptr = SharedPtr; + using Ptr = std::shared_ptr; using UniquePtr = std::unique_ptr; protected: @@ -669,7 +669,7 @@ class AttributeWriteHandle : public AttributeHandle; - using Ptr = SharedPtr; + using Ptr = std::shared_ptr; using ScopedPtr = std::unique_ptr; static Ptr create(AttributeArray& array, const bool expand = true); diff --git a/openvdb_points/tools/AttributeSet.cc b/openvdb_points/tools/AttributeSet.cc index c1a9d94b1c..74fcd20381 100644 --- a/openvdb_points/tools/AttributeSet.cc +++ b/openvdb_points/tools/AttributeSet.cc @@ -88,7 +88,6 @@ namespace { AttributeSet::AttributeSet() : mDescr(new Descriptor()) - , mAttrs() { } @@ -136,8 +135,8 @@ size_t AttributeSet::memUsage() const { size_t bytes = sizeof(*this) + mDescr->memUsage(); - for (size_t n = 0, N = mAttrs.size(); n < N; ++n) { - bytes += mAttrs[n]->memUsage(); + for (const auto& attr : mAttrs) { + bytes += attr->memUsage(); } return bytes; }