Fix Svace issue for 64bit 81/283881/1
authorEunki, Hong <eunkiki.hong@samsung.com>
Fri, 4 Nov 2022 14:43:25 +0000 (23:43 +0900)
committerEunki, Hong <eunkiki.hong@samsung.com>
Fri, 4 Nov 2022 14:43:25 +0000 (23:43 +0900)
Solve some convert from size_t to uint32_t case.

Change-Id: I486feb48eab38201aaae3bf9f2aadc0414789a5d
Signed-off-by: Eunki, Hong <eunkiki.hong@samsung.com>
dali/internal/event/actors/actor-coords.cpp
dali/public-api/rendering/texture-set.cpp
dali/public-api/rendering/texture-set.h

index 4ee6566..d1a70db 100644 (file)
@@ -502,9 +502,12 @@ Matrix CalculateActorWorldTransform(const Actor& actor)
 
   Matrix  worldMatrix;
   Vector3 localPosition;
+
   // descentList is leaf first, so traverse from root (end) to leaf (beginning)
-  for(unsigned int i(descentList.size() - 1); i < descentList.size(); --i)
+  const size_t descentCount = descentList.size();
+  for(size_t iter = 0u; iter < descentCount; ++iter)
   {
+    auto       i                       = descentCount - iter - 1u;
     Vector3    anchorPoint             = descentList[i].GetProperty<Vector3>(Dali::Actor::Property::ANCHOR_POINT);
     Vector3    parentOrigin            = descentList[i].GetProperty<Vector3>(Dali::Actor::Property::PARENT_ORIGIN);
     bool       positionUsesAnchorPoint = descentList[i].GetProperty<bool>(Dali::Actor::Property::POSITION_USES_ANCHOR_POINT);
@@ -589,9 +592,11 @@ Vector4 CalculateActorWorldColor(const Actor& actor)
     currentActor = currentActor.GetParent();
   } while(inheritance != Dali::ColorMode::USE_OWN_COLOR && currentActor);
 
-  Vector4 worldColor;
-  for(unsigned int i(descentList.size() - 1); i < descentList.size(); --i)
+  Vector4      worldColor;
+  const size_t descentCount = descentList.size();
+  for(size_t iter = 0u; iter < descentCount; ++iter)
   {
+    auto i = descentCount - iter - 1u;
     if(inheritanceModeList[i] == USE_OWN_COLOR || i == descentList.size() - 1)
     {
       worldColor = descentList[i].GetProperty<Vector4>(Dali::Actor::Property::COLOR);
index 6f9fa6b..b59d0bc 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -86,7 +86,7 @@ Sampler TextureSet::GetSampler(size_t index) const
   return Dali::Sampler(samplerPtr);
 }
 
-size_t TextureSet::GetTextureCount() const
+uint32_t TextureSet::GetTextureCount() const
 {
   return GetImplementation(*this).GetTextureCount();
 }
index abdce8c..f1525e6 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TEXTURE_SET_H
 
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -154,7 +154,7 @@ public:
    * @SINCE_1_1.43
    * @return The number of textures in the TextureSet
    */
-  size_t GetTextureCount() const;
+  uint32_t GetTextureCount() const;
 
 public:
   /**