From 488fd88ce124df1226e55a3c6ce635914af3e6cc Mon Sep 17 00:00:00 2001 From: Hermet Park Date: Mon, 10 Mar 2025 14:09:05 +0900 Subject: [PATCH] lottie: --compiler warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In member function ‘constexpr LottieGenericProperty, float>& LottieGenericProperty, float>::ope> inlined from ‘LottieFloat& LottieStroke::dashValue()’ at ../src/loaders/lottie/tvgLottieModel.h:60:104, inlined from ‘void LottieParser::parseStrokeDash(LottieStroke*)’ at ../src/loaders/lottie/tvgLottieParser.cpp:623:82: ../src/loaders/lottie/tvgLottieProperty.h:297:8: warning: ‘.LottieGenericProperty, float>::value’ may be used> 297 | struct LottieGenericProperty : LottieProperty | ^~~~~~~~~~~~~~~~~~~~~ ../src/loaders/lottie/tvgLottieModel.h: In member function ‘void LottieParser::parseStrokeDash(LottieStroke*)’: ../src/loaders/lottie/tvgLottieModel.h:60:104: note: ‘’ declared here 60 | for (uint8_t i = 0; i < dashattr->size; ++i) newValues[i] = LottieFloat(dashattr->values[i]); | --- src/loaders/lottie/tvgLottieModel.h | 4 +++- src/loaders/lottie/tvgLottieProperty.h | 11 +++-------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/loaders/lottie/tvgLottieModel.h b/src/loaders/lottie/tvgLottieModel.h index 73921970..b3e1a022 100644 --- a/src/loaders/lottie/tvgLottieModel.h +++ b/src/loaders/lottie/tvgLottieModel.h @@ -57,7 +57,9 @@ struct LottieStroke if (dashattr->size + 1 > dashattr->allocated) { dashattr->allocated = dashattr->size + 2; auto newValues = new LottieFloat[dashattr->allocated]; - for (uint8_t i = 0; i < dashattr->size; ++i) newValues[i] = LottieFloat(dashattr->values[i]); + for (uint8_t i = 0; i < dashattr->size; ++i) { + newValues[i].copy(dashattr->values[i]); + } delete[] dashattr->values; dashattr->values = newValues; } diff --git a/src/loaders/lottie/tvgLottieProperty.h b/src/loaders/lottie/tvgLottieProperty.h index a7073eda..138d977f 100644 --- a/src/loaders/lottie/tvgLottieProperty.h +++ b/src/loaders/lottie/tvgLottieProperty.h @@ -177,6 +177,9 @@ struct LottieProperty bool copy(LottieProperty* rhs, bool shallow) { + type = rhs->type; + ix = rhs->ix; + if (!rhs->exp) return false; if (shallow) { exp = rhs->exp; @@ -306,8 +309,6 @@ struct LottieGenericProperty : LottieProperty LottieGenericProperty(const LottieGenericProperty& rhs) { copy(const_cast&>(rhs)); - type = rhs.type; - ix = rhs.ix; } ~LottieGenericProperty() @@ -622,8 +623,6 @@ struct LottieColorStop : LottieProperty LottieColorStop(const LottieColorStop& rhs) { copy(const_cast(rhs)); - type = rhs.type; - ix = rhs.ix; } ~LottieColorStop() @@ -803,8 +802,6 @@ struct LottieTextDoc : LottieProperty LottieTextDoc(const LottieTextDoc& rhs) { copy(const_cast(rhs)); - type = rhs.type; - ix = rhs.ix; } ~LottieTextDoc() @@ -922,8 +919,6 @@ struct LottieBitmap : LottieProperty LottieBitmap(const LottieBitmap& rhs) { copy(const_cast(rhs)); - type = rhs.type; - ix = rhs.ix; } ~LottieBitmap()