From a29736e309ee7d0b8ca588674024c2deb6923090 Mon Sep 17 00:00:00 2001 From: Neil Date: Wed, 27 Mar 2019 07:48:45 +1100 Subject: Use size_t for consistency and to avoid casts. --- gtk/PlatGTK.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gtk/PlatGTK.cxx b/gtk/PlatGTK.cxx index 0701eb7a1..40e87c428 100644 --- a/gtk/PlatGTK.cxx +++ b/gtk/PlatGTK.cxx @@ -823,7 +823,7 @@ void SurfaceImpl::MeasureWidths(Font &font_, std::string_view text, XYPOSITION * } } if (positionsCalculated < 1 ) { - const int lenPositions = static_cast(text.length()); + const size_t lenPositions = text.length(); // Either 8-bit or DBCS conversion failed so treat as 8-bit. SetConverter(PFont(font_)->characterSet); const bool rtlCheck = PFont(font_)->characterSet == SC_CHARSET_HEBREW || @@ -833,7 +833,7 @@ void SurfaceImpl::MeasureWidths(Font &font_, std::string_view text, XYPOSITION * utfForm = UTF8FromLatin1(text); } pango_layout_set_text(layout, utfForm.c_str(), utfForm.length()); - int i = 0; + size_t i = 0; int clusterStart = 0; // Each 8-bit input character may take 1 or 2 bytes in UTF-8 // and groups of up to 3 may be represented as ligatures. @@ -847,7 +847,7 @@ void SurfaceImpl::MeasureWidths(Font &font_, std::string_view text, XYPOSITION * int widthLayout = 0; pango_layout_get_size(layout, &widthLayout, NULL); XYPOSITION widthTotal = doubleFromPangoUnits(widthLayout); - for (int bytePos=0; bytePos(i) == text.length()); + PLATFORM_ASSERT(i == text.length()); } } } -- cgit v1.2.3