From bfbe3c986a94b7dfc4d66e2aad5d2037b9833d4c Mon Sep 17 00:00:00 2001 From: subhransu mohanty Date: Tue, 21 Aug 2018 13:21:16 +0900 Subject: [PATCH] lottie: fixed warnings generated by '-Wextra' flag. Change-Id: I73c122f61e628bdbdb6ab98bb68b7d32ab9f4ec0 --- inc/lotplayer.h | 2 +- src/lottie/lottieitem.cpp | 20 ++++++++++---------- src/lottie/lottieitem.h | 6 +++--- src/lottie/lottiemodel.cpp | 6 +++--- src/vector/vdrawhelper.cpp | 6 +++--- src/vector/vpoint.h | 4 ++-- src/vector/vrect.h | 8 ++++---- 7 files changed, 26 insertions(+), 26 deletions(-) diff --git a/inc/lotplayer.h b/inc/lotplayer.h index 4fa589f..66fabf8 100644 --- a/inc/lotplayer.h +++ b/inc/lotplayer.h @@ -33,7 +33,7 @@ public: bool renderSync(float pos, LOTBuffer buffer, bool forceRender = false); private: - _LOT_PLAYER_DECLARE_PRIVATE(LOTPlayer); + _LOT_PLAYER_DECLARE_PRIVATE(LOTPlayer) }; } // namespace lotplayer diff --git a/src/lottie/lottieitem.cpp b/src/lottie/lottieitem.cpp index 3c262e5..dc0f2b4 100644 --- a/src/lottie/lottieitem.cpp +++ b/src/lottie/lottieitem.cpp @@ -126,7 +126,7 @@ bool LOTCompItem::render(const LOTBuffer &buffer) } void LOTMaskItem::update(int frameNo, const VMatrix &parentMatrix, - float parentAlpha, const DirtyFlag &flag) + float parentAlpha, const DirtyFlag &/*flag*/) { if (mData->mShape.isStatic()) { if (mLocalPath.isEmpty()) { @@ -846,8 +846,8 @@ void LOTGFillItem::updateContent(int frameNo) mFillRule = mData->fillRule(); } -void LOTGFillItem::updateRenderNode(LOTPathDataItem *pathNode, - VDrawable *drawable, bool sameParent) +void LOTGFillItem::updateRenderNode(LOTPathDataItem */*pathNode*/, + VDrawable *drawable, bool /*sameParent*/) { drawable->setBrush(VBrush(mGradient.get())); drawable->setFillRule(mFillRule); @@ -925,8 +925,8 @@ void LOTGStrokeItem::updateContent(int frameNo) } } -void LOTGStrokeItem::updateRenderNode(LOTPathDataItem *pathNode, - VDrawable *drawable, bool sameParent) +void LOTGStrokeItem::updateRenderNode(LOTPathDataItem */*pathNode*/, + VDrawable *drawable, bool /*sameParent*/) { float scale = getScale(mParentMatrix); drawable->setBrush(VBrush(mGradient.get())); @@ -941,19 +941,19 @@ void LOTGStrokeItem::updateRenderNode(LOTPathDataItem *pathNode, LOTTrimItem::LOTTrimItem(LOTTrimData *data) : mData(data) {} -void LOTTrimItem::update(int frameNo, const VMatrix &parentMatrix, - float parentAlpha, const DirtyFlag &flag) +void LOTTrimItem::update(int /*frameNo*/, const VMatrix &/*parentMatrix*/, + float /*parentAlpha*/, const DirtyFlag &/*flag*/) { } LOTRepeaterItem::LOTRepeaterItem(LOTRepeaterData *data) : mData(data) {} -void LOTRepeaterItem::update(int frameNo, const VMatrix &parentMatrix, - float parentAlpha, const DirtyFlag &flag) +void LOTRepeaterItem::update(int /*frameNo*/, const VMatrix &/*parentMatrix*/, + float /*parentAlpha*/, const DirtyFlag &/*flag*/) { } -void LOTRepeaterItem::renderList(std::vector &list) {} +void LOTRepeaterItem::renderList(std::vector &/*list*/) {} void LOTDrawable::sync() { diff --git a/src/lottie/lottieitem.h b/src/lottie/lottieitem.h index 6dc0385..5271cdd 100644 --- a/src/lottie/lottieitem.h +++ b/src/lottie/lottieitem.h @@ -62,7 +62,7 @@ public: void setPrecompLayer(LOTLayerItem *precomp){mPrecompLayer = precomp;} virtual void update(int frameNo, const VMatrix &parentMatrix, float parentAlpha); VMatrix matrix(int frameNo) const; - virtual void renderList(std::vector &list){} + virtual void renderList(std::vector &){} virtual void updateStaticProperty(); virtual void render(VPainter *painter, const VRle &mask, const VRle &inheritMatte, LOTLayerItem *matteSource); bool hasMatte() { if (mLayerData->mMatteType == MatteType::None) return false; return true; } @@ -181,7 +181,7 @@ public: LOTContentItem(){} virtual ~LOTContentItem(){} virtual void update(int frameNo, const VMatrix &parentMatrix, float parentAlpha, const DirtyFlag &flag) = 0; - virtual void renderList(std::vector &list){} + virtual void renderList(std::vector &){} }; class LOTContentGroupItem: public LOTContentItem @@ -304,7 +304,7 @@ public: private: void updatePath(VPath& path, int frameNo) final; LOTShapeData *mData; - bool hasChanged(int frameNo) final { return true; } + bool hasChanged(int) final { return true; } }; class LOTPolystarItem: public LOTPathDataItem diff --git a/src/lottie/lottiemodel.cpp b/src/lottie/lottiemodel.cpp index c119950..2e48fac 100644 --- a/src/lottie/lottiemodel.cpp +++ b/src/lottie/lottiemodel.cpp @@ -5,10 +5,10 @@ class LottieRepeaterProcesser : public LOTDataVisitor { public: LottieRepeaterProcesser() : mRepeaterFound(false) {} - void visit(LOTCompositionData *obj) {} - void visit(LOTLayerData *obj) {} + void visit(LOTCompositionData *) {} + void visit(LOTLayerData *) {} void visit(LOTTransformData *) {} - void visit(LOTShapeGroupData *obj) {} + void visit(LOTShapeGroupData *) {} void visit(LOTShapeData *) {} void visit(LOTRectData *) {} void visit(LOTEllipseData *) {} diff --git a/src/vector/vdrawhelper.cpp b/src/vector/vdrawhelper.cpp index ee421e0..315b59b 100644 --- a/src/vector/vdrawhelper.cpp +++ b/src/vector/vdrawhelper.cpp @@ -452,7 +452,7 @@ void fetch_radial_gradient(uint32_t *buffer, const Operator *op, } static inline Operator getOperator(const VSpanData * data, - const VRle::Span *spans, int spanCount) + const VRle::Span *, int) { Operator op; bool solidSource = false; @@ -542,8 +542,8 @@ static void blendGradientARGB(int count, const VRle::Span *spans, } } -void VSpanData::setup(const VBrush &brush, VPainter::CompositionMode mode, - int alpha) +void VSpanData::setup(const VBrush &brush, VPainter::CompositionMode /*mode*/, + int /*alpha*/) { switch (brush.type()) { case VBrush::Type::NoBrush: diff --git a/src/vector/vpoint.h b/src/vector/vpoint.h index fea5603..2ee01f0 100644 --- a/src/vector/vpoint.h +++ b/src/vector/vpoint.h @@ -22,7 +22,7 @@ public: { return VPointF(p1.mx + p2.mx, p1.my + p2.my); } - inline friend const bool fuzzyCompare(const VPointF &p1, const VPointF &p2); + inline friend bool fuzzyCompare(const VPointF &p1, const VPointF &p2); inline friend VDebug & operator<<(VDebug &os, const VPointF &o); friend inline VPointF operator-(const VPointF &p1, const VPointF &p2); @@ -36,7 +36,7 @@ private: float my; }; -inline const bool fuzzyCompare(const VPointF &p1, const VPointF &p2) +inline bool fuzzyCompare(const VPointF &p1, const VPointF &p2) { return (vCompare(p1.mx, p2.mx) && vCompare(p1.my, p2.my)); } diff --git a/src/vector/vrect.h b/src/vector/vrect.h index 0a2efdd..eea0b81 100644 --- a/src/vector/vrect.h +++ b/src/vector/vrect.h @@ -175,10 +175,10 @@ public: inline void setHeight(float h) { y2 = y1 + h; } inline void translate(float dx, float dy) { - x1 -= dx; - x2 -= dx; - y1 -= dx; - y2 -= dx; + x1 += dx; + y1 += dy; + x2 += dx; + y2 += dy; } private: -- 2.34.1