From b853f99b28fb54e10c13a6ba070f7f7110bd4bcf Mon Sep 17 00:00:00 2001 From: Lukas Werling Date: Mon, 20 Jun 2016 16:08:37 +0200 Subject: [PATCH] Fix -Wc++11-narrowing error in clang --- src/editor/C4EditCursor.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/editor/C4EditCursor.cpp b/src/editor/C4EditCursor.cpp index c0a015815..329229072 100644 --- a/src/editor/C4EditCursor.cpp +++ b/src/editor/C4EditCursor.cpp @@ -905,7 +905,12 @@ void C4EditCursor::DrawSelectMark(C4Facet &cgo, FLOAT_RECT frame, float width, u const float EDGE_WIDTH = 2.f; - unsigned char c[4] = { (color >> 16) & 0xff, (color >> 8) & 0xff , (color >> 0) & 0xff , (color >> 24) & 0xff }; + unsigned char c[4] = { + static_cast((color >> 16) & 0xff), + static_cast((color >> 8) & 0xff), + static_cast((color >> 0) & 0xff), + static_cast((color >> 24) & 0xff) + }; const C4BltVertex vertices[] = { { 0.f, 0.f, { c[0], c[1], c[2], c[3] }, frame.left + EDGE_WIDTH, frame.top, 0.f }, @@ -1526,4 +1531,4 @@ bool C4EditCursor::IsHoveringTransformMarker() const return true; } return false; -} \ No newline at end of file +}