From af30472a7b942c031e723f960daec69a9035db4a Mon Sep 17 00:00:00 2001 From: Andrey Penechko Date: Tue, 17 Feb 2015 02:45:22 +0200 Subject: [PATCH] Fix appending string to dchar[]. Fix C-style arrays. --- src/dlangui/core/events.d | 4 ++-- src/dlangui/graphics/colors.d | 8 ++++---- src/dlangui/graphics/fonts.d | 2 +- src/dlangui/platforms/windows/win32fonts.d | 6 +++--- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/dlangui/core/events.d b/src/dlangui/core/events.d index 4320fed5..0346cc23 100644 --- a/src/dlangui/core/events.d +++ b/src/dlangui/core/events.d @@ -279,9 +279,9 @@ class Action { } dstring accel = acceleratorText; if (accel.length > 0) { - buf ~= " ("; + buf ~= " ("d; buf ~= accel; - buf ~= ")"; + buf ~= ")"d; } return cast(dstring)buf; } diff --git a/src/dlangui/graphics/colors.d b/src/dlangui/graphics/colors.d index eb16f5fd..fc301fb8 100644 --- a/src/dlangui/graphics/colors.d +++ b/src/dlangui/graphics/colors.d @@ -53,10 +53,10 @@ uint blendARGB(uint dst, uint src, uint alpha) { return (r << 16) | (g << 8) | b; } -//immutable int COMPONENT_OFFSET_BGR[3] = [2, 1, 0]; -immutable int COMPONENT_OFFSET_BGR[3] = [2, 1, 0]; -//immutable int COMPONENT_OFFSET_BGR[3] = [1, 2, 0]; -immutable int COMPONENT_OFFSET_RGB[3] = [0, 1, 2]; +//immutable int[3] COMPONENT_OFFSET_BGR = [2, 1, 0]; +immutable int[3] COMPONENT_OFFSET_BGR = [2, 1, 0]; +//immutable int[3] COMPONENT_OFFSET_BGR = [1, 2, 0]; +immutable int[3] COMPONENT_OFFSET_RGB = [0, 1, 2]; immutable int COMPONENT_OFFSET_ALPHA = 3; int subpixelComponentIndex(int x0, SubpixelRenderingMode mode) { switch (mode) { diff --git a/src/dlangui/graphics/fonts.d b/src/dlangui/graphics/fonts.d index cf06bb52..dbad91b6 100644 --- a/src/dlangui/graphics/fonts.d +++ b/src/dlangui/graphics/fonts.d @@ -738,7 +738,7 @@ struct glyph_gamma_table(int maxv = 65) return _map[src]; } private: - ubyte _map[maxv]; + ubyte[maxv] _map; double _gamma = 1.0; }; diff --git a/src/dlangui/platforms/windows/win32fonts.d b/src/dlangui/platforms/windows/win32fonts.d index 49a214a8..a1f9735e 100644 --- a/src/dlangui/platforms/windows/win32fonts.d +++ b/src/dlangui/platforms/windows/win32fonts.d @@ -100,9 +100,9 @@ struct lcd_distribution_lut(int maxv = 65) } private: - ubyte m_primary[maxv]; - ubyte m_secondary[maxv]; - ubyte m_tertiary[maxv]; + ubyte[maxv] m_primary; + ubyte[maxv] m_secondary; + ubyte[maxv] m_tertiary; }; private __gshared lcd_distribution_lut!65 lut;