From: subhransu mohanty Date: Mon, 3 Sep 2018 09:10:45 +0000 (+0900) Subject: lottie: modernize using clang-tidy "modernize-use-equals-default" X-Git-Tag: submit/tizen/20180917.042405~41 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F45%2F188245%2F1;p=platform%2Fcore%2Fuifw%2Flottie-player.git lottie: modernize using clang-tidy "modernize-use-equals-default" Change-Id: Ic09bf5651333f63f2603c8e3d9dd8afd4b73c7aa --- diff --git a/src/lottie/lottieitem.h b/src/lottie/lottieitem.h index 83fbda9..0f90c4c 100644 --- a/src/lottie/lottieitem.h +++ b/src/lottie/lottieitem.h @@ -55,7 +55,7 @@ class LOTLayerItem { public: LOTLayerItem(LOTLayerData *layerData); - virtual ~LOTLayerItem(){} + virtual ~LOTLayerItem()= default; int id() const {return mLayerData->id();} int parentId() const {return mLayerData->parentId();} void setParentLayer(LOTLayerItem *parent){mParentLayer = parent;} @@ -169,8 +169,7 @@ class LOTTrimItem; class LOTContentItem { public: - LOTContentItem(){} - virtual ~LOTContentItem(){} + virtual ~LOTContentItem()= default; virtual void update(int frameNo, const VMatrix &parentMatrix, float parentAlpha, const DirtyFlag &flag) = 0; virtual void renderList(std::vector &){} void setParent(LOTContentItem *parent) {mParent = parent;} diff --git a/src/lottie/lottieloader.cpp b/src/lottie/lottieloader.cpp index b97dd68..a948e4a 100644 --- a/src/lottie/lottieloader.cpp +++ b/src/lottie/lottieloader.cpp @@ -8,7 +8,6 @@ using namespace std; class LottieFileCache { public: - ~LottieFileCache(); static LottieFileCache &get() { static LottieFileCache CACHE; @@ -19,12 +18,11 @@ public: void add(std::string &key, std::shared_ptr value); private: - LottieFileCache() {} + LottieFileCache() = default; std::unordered_map> mHash; }; -LottieFileCache::~LottieFileCache() {} std::shared_ptr LottieFileCache::find(std::string &key) { auto search = mHash.find(key); @@ -40,8 +38,6 @@ void LottieFileCache::add(std::string &key, std::shared_ptr value) mHash[key] = value; } -LottieLoader::LottieLoader() {} - bool LottieLoader::load(std::string &path) { LottieFileCache &fileCache = LottieFileCache::get(); diff --git a/src/lottie/lottieloader.h b/src/lottie/lottieloader.h index 0c4367b..e87cd79 100644 --- a/src/lottie/lottieloader.h +++ b/src/lottie/lottieloader.h @@ -8,7 +8,6 @@ class LOTModel; class LottieLoader { public: - LottieLoader(); bool load(std::string &filePath); std::shared_ptr model(); private: diff --git a/src/lottie/lottiemodel.h b/src/lottie/lottiemodel.h index 7d4518e..4abf4e5 100644 --- a/src/lottie/lottiemodel.h +++ b/src/lottie/lottiemodel.h @@ -35,7 +35,7 @@ class LOTMaskData; class LOTDataVisitor { public: - virtual ~LOTDataVisitor() {} + virtual ~LOTDataVisitor() = default; virtual void visit(LOTCompositionData *) = 0; virtual void visit(LOTLayerData *) = 0; virtual void visit(LOTTransformData *) = 0; @@ -269,7 +269,7 @@ public: Repeater }; LOTData(LOTData::Type type): mType(type){} - virtual ~LOTData(){} + virtual ~LOTData()= default; inline LOTData::Type type() const {return mType;} virtual void accept(LOTDataVisitor *){} bool isStatic() const{return mStatic;} diff --git a/src/lottie/rapidjson/document.h b/src/lottie/rapidjson/document.h index aeca757..98c4eb1 100644 --- a/src/lottie/rapidjson/document.h +++ b/src/lottie/rapidjson/document.h @@ -2547,7 +2547,7 @@ public: GenericArray(const GenericArray& rhs) : value_(rhs.value_) {} GenericArray& operator=(const GenericArray& rhs) { value_ = rhs.value_; return *this; } - ~GenericArray() {} + ~GenericArray() = default; SizeType Size() const { return value_.Size(); } SizeType Capacity() const { return value_.Capacity(); } @@ -2602,7 +2602,7 @@ public: GenericObject(const GenericObject& rhs) : value_(rhs.value_) {} GenericObject& operator=(const GenericObject& rhs) { value_ = rhs.value_; return *this; } - ~GenericObject() {} + ~GenericObject() = default; SizeType MemberCount() const { return value_.MemberCount(); } SizeType MemberCapacity() const { return value_.MemberCapacity(); } diff --git a/src/lottie/rapidjson/internal/ieee754.h b/src/lottie/rapidjson/internal/ieee754.h index c2684ba..56b2bb1 100644 --- a/src/lottie/rapidjson/internal/ieee754.h +++ b/src/lottie/rapidjson/internal/ieee754.h @@ -22,7 +22,7 @@ namespace internal { class Double { public: - Double() {} + Double() = default; Double(double d) : d_(d) {} Double(uint64_t u) : u_(u) {} diff --git a/src/vector/vbezier.h b/src/vector/vbezier.h index ccb5733..4323616 100644 --- a/src/vector/vbezier.h +++ b/src/vector/vbezier.h @@ -7,7 +7,7 @@ V_BEGIN_NAMESPACE class VBezier { public: - VBezier() {} + VBezier() = default; VPointF pointAt(float t) const; VBezier onInterval(float t0, float t1) const; float length() const; diff --git a/src/vector/vbrush.h b/src/vector/vbrush.h index 29711f9..f2e6d21 100644 --- a/src/vector/vbrush.h +++ b/src/vector/vbrush.h @@ -17,7 +17,7 @@ public: enum class Type { Linear, Radial }; VGradient(VGradient::Type type); void setStops(const VGradientStops &stops); - VGradient() {} + VGradient() = default; public: static constexpr int colorTableSize = 1024; diff --git a/src/vector/vdrawhelper.h b/src/vector/vdrawhelper.h index bf66854..51a068b 100644 --- a/src/vector/vdrawhelper.h +++ b/src/vector/vdrawhelper.h @@ -103,7 +103,7 @@ struct VGradientData { struct VSpanData { class Pinnable { protected: - ~Pinnable() {} + ~Pinnable() = default; }; enum class Type { None, Solid, LinearGradient, RadialGradient }; diff --git a/src/vector/vpath.cpp b/src/vector/vpath.cpp index 5114603..08e0938 100644 --- a/src/vector/vpath.cpp +++ b/src/vector/vpath.cpp @@ -8,20 +8,6 @@ V_BEGIN_NAMESPACE -VPath::VPathData::VPathData() - : m_points(), m_elements(), m_segments(0), mStartPoint(), mNewSegment(true) -{ -} - -VPath::VPathData::VPathData(const VPathData &o) - : m_points(o.m_points), - m_elements(o.m_elements), - m_segments(o.m_segments), - mStartPoint(o.mStartPoint), - mNewSegment(o.mNewSegment) -{ -} - void VPath::VPathData::transform(const VMatrix &m) { for (auto &i : m_points) { diff --git a/src/vector/vpath.h b/src/vector/vpath.h index 8845b41..24fce59 100644 --- a/src/vector/vpath.h +++ b/src/vector/vpath.h @@ -50,8 +50,6 @@ public: private: struct VPathData { - VPathData(); - VPathData(const VPathData &o); bool isEmpty() const { return m_elements.empty(); } void moveTo(float x, float y); void lineTo(float x, float y);