From 9c2c6a6fbbfe873ce570600ac2a276794095f185 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniele=20Bond=C3=AC?= Date: Sat, 29 Feb 2020 22:25:16 +0100 Subject: [PATCH 1/5] Fixed deprecation warning about union fields initialization --- src/dlangui/dom/cssparser.d | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dlangui/dom/cssparser.d b/src/dlangui/dom/cssparser.d index a64c75f0..2331f1b6 100644 --- a/src/dlangui/dom/cssparser.d +++ b/src/dlangui/dom/cssparser.d @@ -81,7 +81,6 @@ struct CSSToken { string text; string dimensionUnit; union { - bool typeFlagId; // true if identifier is valid ID struct { long intValue = 0; // for number and dimension double doubleValue = 0; // for number and dimension @@ -91,6 +90,7 @@ struct CSSToken { uint unicodeRangeStart; // for unicodeRange (initialized to 0 via intValue=0) uint unicodeRangeEnd; // for unicodeRange (initialized to 0 via intValue=0) } + bool typeFlagId; // true if identifier is valid ID } } From 1c592c4664ae3e80b0f204492a33ca2a1e4910a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniele=20Bond=C3=AC?= Date: Sat, 29 Feb 2020 22:31:18 +0100 Subject: [PATCH 2/5] Fixed deprecation warning about Nullable's alias this --- src/dlangui/dialogs/filedlg.d | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dlangui/dialogs/filedlg.d b/src/dlangui/dialogs/filedlg.d index c3b04465..395398f6 100644 --- a/src/dlangui/dialogs/filedlg.d +++ b/src/dlangui/dialogs/filedlg.d @@ -374,7 +374,7 @@ class FileDialog : Dialog, CustomGridCellAdapter { return "----.--.-- --:--"; } else { //date = "%04d.%02d.%02d %02d:%02d:%02d".format(ts.year, ts.month, ts.day, ts.hour, ts.minute, ts.second); - return "%04d.%02d.%02d %02d:%02d".format(ts.year, ts.month, ts.day, ts.hour, ts.minute); + return "%04d.%02d.%02d %02d:%02d".format(ts.get.year, ts.get.month, ts.get.day, ts.get.hour, ts.get.minute); } } 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 3/5] 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) { From e9b0a20482ea067ccf406aa2f6f13619aecbf388 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniele=20Bond=C3=AC?= Date: Sat, 29 Feb 2020 22:40:20 +0100 Subject: [PATCH 4/5] Fixed deprecation warning about variable shadowing --- src/dlangui/graphics/scene/scene3d.d | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dlangui/graphics/scene/scene3d.d b/src/dlangui/graphics/scene/scene3d.d index 98194dd3..acb3ea1f 100644 --- a/src/dlangui/graphics/scene/scene3d.d +++ b/src/dlangui/graphics/scene/scene3d.d @@ -120,7 +120,7 @@ bool visit(Node3d node, bool delegate(Node3d node) visitor) { if (res) return true; foreach(child; node.children) { - bool res = visit(child, visitor); + res = visit(child, visitor); if (res) return true; } From bbfb1ce96fd0cf736b6ada2108e3b824e98c73b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniele=20Bond=C3=AC?= Date: Sat, 29 Feb 2020 22:59:18 +0100 Subject: [PATCH 5/5] Fixed passing argument to to!string (it cannot handle inout args - bug in phobos?) --- src/dlangui/core/settings.d | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dlangui/core/settings.d b/src/dlangui/core/settings.d index 6f287fd9..ef9d5b6d 100644 --- a/src/dlangui/core/settings.d +++ b/src/dlangui/core/settings.d @@ -498,7 +498,7 @@ final class Setting { case UINTEGER: return to!string(_store.uinteger); case FLOAT: - return to!string(_store.floating); + return to!string(cast(double)_store.floating); case TRUE: return "true"; case FALSE: @@ -519,7 +519,7 @@ final class Setting { case UINTEGER: return to!string(_store.uinteger); case FLOAT: - return to!string(_store.floating); + return to!string(cast(double)_store.floating); case TRUE: return "true"; case FALSE: