From 9eb1d8ffbcc7d5753c0d2f616d53d2384803aa28 Mon Sep 17 00:00:00 2001 From: Jan Beich Date: Mon, 8 Jan 2018 14:23:58 +0000 Subject: [PATCH] graphics/libgltf: unbreak build with Clang 6 (C++14 by default) Shaders.cpp:178:13: error: non-constant-expression cannot be narrowed from type 'size_t' (aka 'unsigned int') to 'GLint' (aka 'int') in initializer list [-Wc++11-narrowing] strlen("#version 130\n"), ^~~~~~~~~~~~~~~~~~~~~~~~ Shaders.cpp:178:13: note: insert an explicit cast to silence this issue strlen("#version 130\n"), ^~~~~~~~~~~~~~~~~~~~~~~~ static_cast( ) Reported by: antoine (via bug 224669) --- graphics/libgltf/files/patch-src_Shaders.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 graphics/libgltf/files/patch-src_Shaders.cpp diff --git a/graphics/libgltf/files/patch-src_Shaders.cpp b/graphics/libgltf/files/patch-src_Shaders.cpp new file mode 100644 index 000000000000..e22d8ea40868 --- /dev/null +++ b/graphics/libgltf/files/patch-src_Shaders.cpp @@ -0,0 +1,19 @@ +Shaders.cpp:178:13: error: non-constant-expression cannot be narrowed from type 'size_t' (aka 'unsigned int') to 'GLint' (aka 'int') in initializer list [-Wc++11-narrowing] + strlen("#version 130\n"), + ^~~~~~~~~~~~~~~~~~~~~~~~ +Shaders.cpp:178:13: note: insert an explicit cast to silence this issue + strlen("#version 130\n"), + ^~~~~~~~~~~~~~~~~~~~~~~~ + static_cast( ) + +--- src/Shaders.cpp.orig 2014-10-01 18:31:43 UTC ++++ src/Shaders.cpp +@@ -175,7 +175,7 @@ bool ShaderProgram::compileShader(const char* pShader, + }; + + const GLint aSizes[] = { +- strlen("#version 130\n"), ++ static_cast(strlen("#version 130\n")), + iGLSize, + }; +