lottie: Fixed SVACE warning for uninitialized class member variable. 56/196156/3
authorsubhransu mohanty <sub.mohanty@samsung.com>
Mon, 24 Dec 2018 04:57:28 +0000 (13:57 +0900)
committersubhransu mohanty <sub.mohanty@samsung.com>
Mon, 24 Dec 2018 05:52:23 +0000 (14:52 +0900)
Change-Id: I8c633cca49c05295499ef8ec640ec078bba369fd

inc/lottieanimation.h
src/lottie/lottieanimation.cpp
src/lottie/lottieitem.h
src/lottie/lottiemodel.h
src/lottie/lottieparser.cpp
src/vector/vbitmap.h
src/vector/vbrush.h
src/vector/vdebug.h
src/vector/vdrawhelper.cpp
src/vector/vdrawhelper.h

index 4586ac8..829ba1d 100644 (file)
@@ -91,10 +91,10 @@ public:
      */
     Surface() = default;
 private:
-    uint32_t    *mBuffer;
-    size_t       mWidth;
-    size_t       mHeight;
-    size_t       mBytesPerLine;
+    uint32_t    *mBuffer{nullptr};
+    size_t       mWidth{0};
+    size_t       mHeight{0};
+    size_t       mBytesPerLine{0};
 };
 
 class LOT_EXPORT Animation {
index 1f09922..fb5b495 100644 (file)
@@ -90,8 +90,8 @@ struct RenderTask {
     RenderTask() { receiver = sender.get_future(); }
     std::promise<Surface> sender;
     std::future<Surface>  receiver;
-    AnimationImpl     *playerImpl;
-    size_t              frameNo;
+    AnimationImpl     *playerImpl{nullptr};
+    size_t              frameNo{0};
     Surface            surface;
 };
 
index 7a1a5a2..51ced32 100644 (file)
@@ -93,7 +93,7 @@ protected:
    float                                       mCombinedAlpha{0.0};
    int                                         mFrameNo{-1};
    DirtyFlag                                   mDirtyFlag{DirtyFlagBit::All};
-   bool                                        mStatic;
+   bool                                        mStatic{false};
 };
 
 class LOTCompLayerItem: public LOTLayerItem
@@ -109,7 +109,6 @@ protected:
 private:
    std::vector<LOTLayerNode *>                  mLayersCNode;
    std::vector<std::unique_ptr<LOTLayerItem>>   mLayers;
-   int                                          mLastFrame;
 };
 
 class LOTSolidLayerItem: public LOTLayerItem
@@ -333,10 +332,10 @@ protected:
    virtual void updateRenderNode();
    inline float parentAlpha() const {return mParentAlpha;}
 public:
-   float                            mParentAlpha;
+   float                            mParentAlpha{1.0f};
    VPath                            mPath;
    DirtyFlag                        mFlag;
-   int                              mFrameNo;
+   int                              mFrameNo{-1};
    std::vector<LOTPathDataItem *>   mPathItems;
    std::unique_ptr<VDrawable>       mDrawable;
    bool                             mStaticContent;
@@ -353,7 +352,7 @@ protected:
 private:
    LOTFillData             *mData;
    VColor                  mColor;
-   FillRule                mFillRule;
+   FillRule                mFillRule{FillRule::Winding};
 };
 
 class LOTGFillItem : public LOTPaintDataItem
@@ -366,7 +365,7 @@ protected:
 private:
    LOTGFillData                 *mData;
    std::unique_ptr<VGradient>    mGradient;
-   FillRule                      mFillRule;
+   FillRule                      mFillRule{FillRule::Winding};
 };
 
 class LOTStrokeItem : public LOTPaintDataItem
@@ -378,13 +377,13 @@ protected:
    void updateRenderNode() final;
 private:
    LOTStrokeData             *mData;
-   CapStyle                  mCap;
-   JoinStyle                 mJoin;
-   float                     mMiterLimit;
+   CapStyle                  mCap{CapStyle::Flat};
+   JoinStyle                 mJoin{JoinStyle::Miter};
+   float                     mMiterLimit{0};
    VColor                    mColor;
-   float                     mWidth;
+   float                     mWidth{0};
    float                     mDashArray[6];
-   int                       mDashArraySize;
+   int                       mDashArraySize{0};
 };
 
 class LOTGStrokeItem : public LOTPaintDataItem
@@ -397,13 +396,13 @@ protected:
 private:
    LOTGStrokeData               *mData;
    std::unique_ptr<VGradient>    mGradient;
-   CapStyle                      mCap;
-   JoinStyle                     mJoin;
-   float                         mMiterLimit;
+   CapStyle                      mCap{CapStyle::Flat};
+   JoinStyle                     mJoin{JoinStyle::Miter};
+   float                         mMiterLimit{0};
    VColor                        mColor;
-   float                         mWidth;
+   float                         mWidth{0};
    float                         mDashArray[6];
-   int                           mDashArraySize;
+   int                           mDashArraySize{0};
 };
 
 
index a939979..c9e0c23 100644 (file)
@@ -260,7 +260,7 @@ public:
     }
 public:
     T                                 mValue;
-    int                               mPropertyIndex; /* "ix" */
+    int                               mPropertyIndex{0}; /* "ix" */
     std::unique_ptr<LOTAnimInfo<T>>   mAnimInfo;
 };
 
@@ -354,13 +354,13 @@ public:
 
     MatteType            mMatteType{MatteType::None};
     VRect                mBound;
-    LayerType            mLayerType; //lottie layer type  (solid/shape/precomp)
+    LayerType            mLayerType{LayerType::Null}; //lottie layer type  (solid/shape/precomp)
     int                  mParentId{-1}; // Lottie the id of the parent in the composition
     int                  mId{-1};  // Lottie the group id  used for parenting.
     long                 mInFrame{0};
     long                 mOutFrame{0};
     long                 mStartFrame{0};
-    LottieBlendMode      mBlendMode;
+    LottieBlendMode      mBlendMode{LottieBlendMode::Normal};
     float                mTimeStreatch{1.0f};
     std::string          mPreCompRefId;
     LOTAnimatable<float> mTimeRemap;  /* "tm" */
@@ -372,7 +372,7 @@ public:
     bool                 mRoot{false};
     bool                 mAutoOrient{false};
     std::vector<std::shared_ptr<LOTMaskData>>  mMasks;
-    LOTCompositionData   *mCompRef;
+    LOTCompositionData   *mCompRef{nullptr};
 };
 
 class LOTCompositionData : public LOTData
@@ -402,7 +402,7 @@ public:
     VSize                mSize;
     long                 mStartFrame{0};
     long                 mEndFrame{0};
-    float                mFrameRate;
+    float                mFrameRate{60};
     LottieBlendMode      mBlendMode;
     std::shared_ptr<LOTLayerData> mRootLayer;
     std::unordered_map<std::string,
@@ -506,8 +506,8 @@ public:
     LOTAnimatable<LottieColor>        mColor;      /* "c" */
     LOTAnimatable<int>                mOpacity{100};    /* "o" */
     LOTAnimatable<float>              mWidth{0};      /* "w" */
-    CapStyle                          mCapStyle;   /* "lc" */
-    JoinStyle                         mJoinStyle;  /* "lj" */
+    CapStyle                          mCapStyle{CapStyle::Flat};   /* "lc" */
+    JoinStyle                         mJoinStyle{JoinStyle::Miter};  /* "lj" */
     float                             mMeterLimit{0}; /* "ml" */
     LOTDashProperty                   mDash;
     bool                              mEnabled{true}; /* "fillEnabled" */
@@ -579,7 +579,7 @@ public:
 private:
     void populate(VGradientStops &stops, int frameNo);
 public:
-    int                                 mGradientType;        /* "t" Linear=1 , Radial = 2*/
+    int                                 mGradientType{1};        /* "t" Linear=1 , Radial = 2*/
     LOTAnimatable<VPointF>              mStartPoint;          /* "s" */
     LOTAnimatable<VPointF>              mEndPoint;            /* "e" */
     LOTAnimatable<float>                mHighlightLength{0};     /* "h" */
@@ -611,8 +611,8 @@ public:
     int getDashInfo(int frameNo, float *array) const;
 public:
     LOTAnimatable<float>           mWidth;       /* "w" */
-    CapStyle                       mCapStyle;    /* "lc" */
-    JoinStyle                      mJoinStyle;   /* "lj" */
+    CapStyle                       mCapStyle{CapStyle::Flat};    /* "lc" */
+    JoinStyle                      mJoinStyle{JoinStyle::Miter};   /* "lj" */
     float                          mMeterLimit{0};  /* "ml" */
     LOTDashProperty                mDash;
 };
index 91e9f39..3474691 100644 (file)
@@ -250,8 +250,8 @@ public:
 
 protected:
     std::shared_ptr<LOTCompositionData>        mComposition;
-    LOTCompositionData *                       compRef;
-    LOTLayerData *                             curLayerRef;
+    LOTCompositionData *                       compRef{nullptr};
+    LOTLayerData *                             curLayerRef{nullptr};
     std::vector<std::shared_ptr<LOTLayerData>> mLayersToUpdate;
     void                                       SkipOut(int depth);
 };
index a5223d9..717e415 100644 (file)
@@ -37,7 +37,7 @@ public:
 private:
     void         detach();
     void         cleanUp(VBitmapData *x);
-    VBitmapData *d;
+    VBitmapData *d{nullptr};
 };
 
 V_END_NAMESPACE
index 9a31715..46433df 100644 (file)
@@ -65,7 +65,7 @@ public:
 public:
     VBrush::Type     mType{Type::NoBrush};
     VColor           mColor;
-    const VGradient *mGradient;
+    const VGradient *mGradient{nullptr};
 };
 
 V_END_NAMESPACE
index c1ae239..1b089e1 100644 (file)
@@ -78,8 +78,8 @@ private:
     void stringify(std::ostream& os, char* start, char const* const end);
 
 private:
-    size_t                  m_bytes_used;
-    size_t                  m_buffer_size;
+    size_t                  m_bytes_used{0};
+    size_t                  m_buffer_size{0};
     std::unique_ptr<char[]> m_heap_buffer;
     bool                    m_logAll;
     char m_stack_buffer[256 - sizeof(bool) - 2 * sizeof(size_t) -
index 2deb2aa..d48ecda 100644 (file)
@@ -10,7 +10,7 @@ public:
         inline CacheInfo(VGradientStops s) : stops(std::move(s)) {}
         uint32_t       buffer32[VGradient::colorTableSize];
         VGradientStops stops;
-        bool           alpha;
+        bool           alpha{true};
     };
 
     typedef std::unordered_multimap<uint64_t, std::shared_ptr<const CacheInfo>>
index 51a068b..51d6db3 100644 (file)
@@ -75,15 +75,15 @@ public:
     int bytesPerLine() const { return mBytesPerLine; }
     int bytesPerPixel() const { return mBytesPerPixel; }
 
-    VBitmap::Format           mFormat;
+    VBitmap::Format           mFormat{VBitmap::Format::ARGB32_Premultiplied};
     VPainter::CompositionMode mCompositionMode;
 
 private:
-    int    mWidth;
-    int    mHeight;
-    int    mBytesPerLine;
-    int    mBytesPerPixel;
-    uchar *mBuffer;
+    int    mWidth{0};
+    int    mHeight{0};
+    int    mBytesPerLine{0};
+    int    mBytesPerPixel{0};
+    uchar *mBuffer{nullptr};
 };
 
 struct VGradientData {