From 282949d2203e1011570d4c301895ff00ad674a4c Mon Sep 17 00:00:00 2001 From: Andreas Butti Date: Sat, 16 Feb 2019 22:22:24 +0100 Subject: [PATCH 1/2] Fix init vars (gives error on clang) --- src/gui/Layout.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/Layout.cpp b/src/gui/Layout.cpp index 36be4f49..83b6d710 100644 --- a/src/gui/Layout.cpp +++ b/src/gui/Layout.cpp @@ -205,9 +205,9 @@ void Layout::layoutPages() int rows = mapper.getRows(); int columns = mapper.getColumns(); - int sizeCol[columns] = { }; + int sizeCol[columns] = { 0 }; - int sizeRow[rows] = { }; + int sizeRow[rows] = { 0 }; for (int r = 0; r < rows; r++) { From d977066eee3d7b7f87e8c1c35abef3bbba75652c Mon Sep 17 00:00:00 2001 From: Andreas Butti Date: Sat, 16 Feb 2019 22:29:31 +0100 Subject: [PATCH 2/2] Compile with clang --- src/gui/Layout.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/gui/Layout.cpp b/src/gui/Layout.cpp index 83b6d710..d8b15535 100644 --- a/src/gui/Layout.cpp +++ b/src/gui/Layout.cpp @@ -205,9 +205,12 @@ void Layout::layoutPages() int rows = mapper.getRows(); int columns = mapper.getColumns(); - int sizeCol[columns] = { 0 }; + int sizeCol[columns]; + // Needs dynamic initialisation, else clang will not compile... + memset(sizeCol, 0, columns * sizeof(int)); - int sizeRow[rows] = { 0 }; + int sizeRow[rows]; + memset(sizeRow, 0, rows * sizeof(int)); for (int r = 0; r < rows; r++) {