From 1e678932563b9c8ea2ee7296031ddf1acdefc08e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniele=20Bond=C3=AC?= Date: Sat, 29 Feb 2020 22:36:24 +0100 Subject: [PATCH] Fixed deprecation warning about foreach index being implicitly converted from size_t to int --- src/dlangui/graphics/ftfonts.d | 2 +- src/dlangui/widgets/editors.d | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/dlangui/graphics/ftfonts.d b/src/dlangui/graphics/ftfonts.d index b1aed796..6c99a8b9 100644 --- a/src/dlangui/graphics/ftfonts.d +++ b/src/dlangui/graphics/ftfonts.d @@ -538,7 +538,7 @@ class FreeTypeFontManager : FontManager { FontFileItem best = null; int bestScore = 0; string[] faces = face ? split(face, ",") : null; - foreach(int index, FontFileItem item; _fontFiles) { + foreach(size_t index, FontFileItem item; _fontFiles) { int score = 0; int bestFaceMatch = 0; if (faces && face.length) { diff --git a/src/dlangui/widgets/editors.d b/src/dlangui/widgets/editors.d index 534b003c..f1b54033 100644 --- a/src/dlangui/widgets/editors.d +++ b/src/dlangui/widgets/editors.d @@ -3446,8 +3446,9 @@ class EditBox : EditWidgetBase { rc.offset(0, yOffset); Rect[] wrappedSelection; wrappedSelection.length = curSpan.len; - foreach (int i, wrapLineRect; wrappedSelection) + foreach (size_t i_, wrapLineRect; wrappedSelection) { + int i = cast(int)i_; int startingDifference = rc.left - _clientRect.left; wrapLineRect = rc; wrapLineRect.offset(-1 * curSpan.accumulation(i, LineSpan.WrapPointInfo.Width), i * _lineHeight); @@ -3796,8 +3797,9 @@ class EditBox : EditWidgetBase { wrappedLine = _span[i].wrappedContent; int accumulativeLength; CustomCharProps[] wrapProps; - foreach (int q, curWrap; wrappedLine) + foreach (size_t q_, curWrap; wrappedLine) { + int q = cast(int)q_; auto lineOffset = q + i + wrapsUpTo(i + _firstVisibleLine); if (highlight) {