From 40fc83dfc5ced49ed123c34bd1be8a8ccbab6b0d Mon Sep 17 00:00:00 2001 From: brainstream Date: Sun, 15 Dec 2024 16:16:32 +0400 Subject: [PATCH] Compilation warning fixed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When using Qt's QList as a container, the compiler throws the following warning: warning: comparison of integer expressions of different signedness: ‘size_t’ {aka ‘long unsigned int’} and ‘qsizetype’ {aka ‘long long int’} --- include/mapbox/earcut.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/mapbox/earcut.hpp b/include/mapbox/earcut.hpp index b98508f..7c6b3f2 100644 --- a/include/mapbox/earcut.hpp +++ b/include/mapbox/earcut.hpp @@ -145,9 +145,9 @@ void Earcut::operator()(const Polygon& points) { double x; double y; int threshold = 80; - std::size_t len = 0; + typename Polygon::size_type len = 0; - for (size_t i = 0; threshold >= 0 && i < points.size(); i++) { + for (typename Polygon::size_type i = 0; threshold >= 0 && i < points.size(); i++) { threshold -= static_cast(points[i].size()); len += points[i].size(); }