From 001c1c06fcc3f296699a791212ba7ea0292a72cf Mon Sep 17 00:00:00 2001 From: Hermet Park Date: Wed, 23 Aug 2023 12:46:48 +0900 Subject: [PATCH] sw_engine: --compiler warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ../src/lib/sw_engine/tvgSwShape.cpp:232:28: warning: comparison of integer expressions of different signedness: ‘int’ and ‘uint32_t’ {aka ‘unsigned int’} [-Wsign-compare] 232 | for (auto i = 0; i < dash.cnt; ++i) patternLength += pattern[i]; | ~~^~~~~~~~~~ ../src/lib/sw_engine/tvgSwShape.cpp:239:28: warning: comparison of integer expressions of different signedness: ‘int’ and ‘uint32_t’ {aka ‘unsigned int’} [-Wsign-compare] 239 | for (auto i = 0; i < dash.cnt * (1 + isOdd); ++i, ++offIdx) { --- src/lib/sw_engine/tvgSwShape.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/sw_engine/tvgSwShape.cpp b/src/lib/sw_engine/tvgSwShape.cpp index 0ba16d3d..f4bcd4a6 100644 --- a/src/lib/sw_engine/tvgSwShape.cpp +++ b/src/lib/sw_engine/tvgSwShape.cpp @@ -229,14 +229,14 @@ static SwOutline* _genDashOutline(const RenderShape* rshape, const Matrix* trans auto patternLength = 0.0f; uint32_t offIdx = 0; if (fabsf(offset) > FLT_EPSILON) { - for (auto i = 0; i < dash.cnt; ++i) patternLength += pattern[i]; + for (size_t i = 0; i < dash.cnt; ++i) patternLength += pattern[i]; bool isOdd = dash.cnt % 2; if (isOdd) patternLength *= 2; if (offset < 0) offset = patternLength + fmod(offset, patternLength); else offset = fmod(offset, patternLength); - for (auto i = 0; i < dash.cnt * (1 + isOdd); ++i, ++offIdx) { + for (size_t i = 0; i < dash.cnt * (1 + isOdd); ++i, ++offIdx) { auto curPattern = pattern[i % dash.cnt]; if (offset < curPattern) break; offset -= curPattern;