keep consistency of size_t usage.
authorHermet Park <hermetpark@gmail.com>
Thu, 11 Jul 2019 08:34:14 +0000 (17:34 +0900)
committerJunsuChoi <jsuya.choi@samsung.com>
Thu, 18 Jul 2019 11:04:28 +0000 (20:04 +0900)
src/lottie/lottieitem.cpp
src/lottie/lottieitem.h
src/lottie/lottiekeypath.h
src/lottie/lottieparser.cpp
src/vector/vdrawhelper.cpp
src/vector/vpath.h
src/vector/vrle.cpp

index bec7dd1..7964ab5 100644 (file)
@@ -1095,7 +1095,7 @@ void LOTContentGroupItem::renderList(std::vector<VDrawable *> &list)
 void LOTContentGroupItem::processPaintItems(
     std::vector<LOTPathDataItem *> &list)
 {
-    int curOpCount = list.size();
+    size_t curOpCount = list.size();
     for (auto i = mContents.rbegin(); i != mContents.rend(); ++i) {
         auto content = (*i).get();
         switch (content->type()) {
@@ -1121,7 +1121,7 @@ void LOTContentGroupItem::processPaintItems(
 
 void LOTContentGroupItem::processTrimItems(std::vector<LOTPathDataItem *> &list)
 {
-    int curOpCount = list.size();
+    size_t curOpCount = list.size();
     for (auto i = mContents.rbegin(); i != mContents.rend(); ++i) {
         auto content = (*i).get();
 
@@ -1320,7 +1320,7 @@ void LOTPaintDataItem::renderList(std::vector<VDrawable *> &list)
 }
 
 void LOTPaintDataItem::addPathItems(std::vector<LOTPathDataItem *> &list,
-                                    int                             startOffset)
+                                    size_t                          startOffset)
 {
     std::copy(list.begin() + startOffset, list.end(),
               back_inserter(mPathItems));
@@ -1539,7 +1539,7 @@ void LOTTrimItem::update()
 }
 
 void LOTTrimItem::addPathItems(std::vector<LOTPathDataItem *> &list,
-                               int                             startOffset)
+                               size_t                          startOffset)
 {
     std::copy(list.begin() + startOffset, list.end(),
               back_inserter(mPathItems));
index a363f47..5a65000 100644 (file)
@@ -398,7 +398,7 @@ class LOTPaintDataItem : public LOTContentItem
 {
 public:
    LOTPaintDataItem(bool staticContent);
-   void addPathItems(std::vector<LOTPathDataItem *> &list, int startOffset);
+   void addPathItems(std::vector<LOTPathDataItem *> &list, size_t startOffset);
    void update(int frameNo, const VMatrix &parentMatrix, float parentAlpha, const DirtyFlag &flag) override;
    void renderList(std::vector<VDrawable *> &list) final;
 protected:
@@ -488,7 +488,7 @@ public:
    LOTTrimItem(LOTTrimData *data);
    void update(int frameNo, const VMatrix &parentMatrix, float parentAlpha, const DirtyFlag &flag) final;
    void update();
-   void addPathItems(std::vector<LOTPathDataItem *> &list, int startOffset);
+   void addPathItems(std::vector<LOTPathDataItem *> &list, size_t startOffset);
 private:
    bool pathDirty() const {
        for (auto &i : mPathItems) {
index 527788f..921bcad 100644 (file)
@@ -38,7 +38,7 @@ private:
     bool isGlobstar(uint depth) const {return mKeys[depth] == "**";}
     bool isGlob(uint depth) const {return mKeys[depth] == "*";}
     bool endsWithGlobstar() const { return mKeys.back() == "**"; }
-    uint size() const {return mKeys.size() - 1;}
+    size_t size() const {return mKeys.size() - 1;}
 private:
     std::vector<std::string> mKeys;
 };
index 949283d..4a0df36 100644 (file)
@@ -647,9 +647,9 @@ static std::string convertFromBase64(const std::string &str)
 {
     // usual header look like "data:image/png;base64,"
     // so need to skip till ','.
-    int startIndex = str.find(",", 0);
+    size_t startIndex = str.find(",", 0);
     startIndex += 1;  // skip ","
-    int length = str.length() - startIndex;
+    size_t length = str.length() - startIndex;
 
     const char *b64Data = str.c_str() + startIndex;
 
index bc6b689..e137a35 100644 (file)
@@ -137,9 +137,10 @@ bool VGradientCache::generateGradientColorTable(const VGradientStops &stops,
                                                 float                 opacity,
                                                 uint32_t *colorTable, int size)
 {
-    int                  dist, idist, pos = 0, i;
+    int                  dist, idist, pos = 0;
+    size_t i;
     bool                 alpha = false;
-    int                  stopCount = stops.size();
+    size_t               stopCount = stops.size();
     const VGradientStop *curr, *next, *start;
     uint32_t             curColor, nextColor;
     float                delta, t, incr, fpos;
index 1c4bf0b..ceebd4b 100644 (file)
@@ -107,7 +107,7 @@ private:
         const std::vector<VPointF> &points() const { return m_points; }
         std::vector<VPointF>        m_points;
         std::vector<VPath::Element> m_elements;
-        unsigned int                m_segments;
+        size_t                      m_segments;
         VPointF                     mStartPoint;
         mutable float               mLength{0};
         mutable bool                mLengthDirty{true};
index 988ea3a..ee4135e 100644 (file)
@@ -384,7 +384,7 @@ static void rleIntersectWithRle(VRleHelper *tmp_clip, int clip_offset_x,
                                 VRleHelper *result)
 {
     VRle::Span *out = result->spans;
-    int         available = result->alloc;
+    size_t      available = result->alloc;
     VRle::Span *spans = tmp_obj->spans;
     VRle::Span *end = tmp_obj->spans + tmp_obj->size;
     VRle::Span *clipSpans = tmp_clip->spans;
@@ -459,7 +459,7 @@ static void rleIntersectWithRect(const VRect &clip, VRleHelper *tmp_obj,
                                  VRleHelper *result)
 {
     VRle::Span *out = result->spans;
-    int         available = result->alloc;
+    size_t      available = result->alloc;
     VRle::Span *spans = tmp_obj->spans;
     VRle::Span *end = tmp_obj->spans + tmp_obj->size;
     short       minx, miny, maxx, maxy;