svn commit: r459570 - head/graphics/libprojectm/files
Jan Beich
jbeich at FreeBSD.org
Sun Jan 21 02:24:24 UTC 2018
Author: jbeich
Date: Sun Jan 21 02:24:22 2018
New Revision: 459570
URL: https://svnweb.freebsd.org/changeset/ports/459570
Log:
graphics/libprojectm: unbreak build with Clang 6 (C++14 by default)
MilkdropPresetFactory/Parser.cpp:1408:10: error: invalid operands to binary expression ('std::istream' (aka 'basic_istream<char>') and 'nullptr_t')
if (fs == NULL)
~~ ^ ~~~~
Renderer/VideoEcho.cpp:77:30: error: non-constant-expression cannot be narrowed from type 'double' to 'float' in initializer list [-Wc++11-narrowing]
float pointsFlip[4][2] = {{-0.5*flipx, -0.5*flipy},
^~~~~~~~~~
Renderer/VideoEcho.cpp:77:30: note: insert an explicit cast to silence this issue
float pointsFlip[4][2] = {{-0.5*flipx, -0.5*flipy},
^~~~~~~~~~
static_cast<float>( )
Reported by: pkg-fallout
Obtained from: upstream
Added:
head/graphics/libprojectm/files/patch-c++11 (contents, props changed)
Added: head/graphics/libprojectm/files/patch-c++11
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/graphics/libprojectm/files/patch-c++11 Sun Jan 21 02:24:22 2018 (r459570)
@@ -0,0 +1,87 @@
+https://github.com/projectM-visualizer/projectm/commit/92226e25192a
+
+with a fix not yet upstream for
+
+Renderer/VideoEcho.cpp:77:30: error: non-constant-expression cannot be narrowed from type 'double' to 'float' in initializer list [-Wc++11-narrowing]
+ float pointsFlip[4][2] = {{-0.5*flipx, -0.5*flipy},
+ ^~~~~~~~~~
+Renderer/VideoEcho.cpp:77:30: note: insert an explicit cast to silence this issue
+ float pointsFlip[4][2] = {{-0.5*flipx, -0.5*flipy},
+ ^~~~~~~~~~
+ static_cast<float>( )
+
+--- Common.hpp.orig 2009-12-06 01:42:51 UTC
++++ Common.hpp
+@@ -55,7 +55,7 @@ extern FILE *fmemopen(void *buf, size_t len, const cha
+
+ #ifdef LINUX
+ #include <cstdlib>
+-#define projectM_isnan isnan
++#define projectM_isnan std::isnan
+
+ #endif
+
+--- MilkdropPresetFactory/Parser.cpp.orig 2009-12-06 01:42:51 UTC
++++ MilkdropPresetFactory/Parser.cpp
+@@ -1405,7 +1405,7 @@ PerFrameEqn * Parser::parse_implicit_per_frame_eqn(std
+ PerFrameEqn * per_frame_eqn;
+ GenExpr * gen_expr;
+
+- if (fs == NULL)
++ if (fs.fail())
+ return NULL;
+ if (param_string == NULL)
+ return NULL;
+@@ -1560,7 +1560,7 @@ InitCond * Parser::parse_per_frame_init_eqn(std::istre
+
+ if (preset == NULL)
+ return NULL;
+- if (fs == NULL)
++ if (fs.fail())
+ return NULL;
+
+ if ((token = parseToken(fs, name)) != tEq)
+@@ -1874,7 +1874,7 @@ int Parser::parse_shapecode(char * token, std::istream
+ /* Null argument checks */
+ if (preset == NULL)
+ return PROJECTM_FAILURE;
+- if (fs == NULL)
++ if (fs.fail())
+ return PROJECTM_FAILURE;
+ if (token == NULL)
+ return PROJECTM_FAILURE;
+@@ -2165,7 +2165,7 @@ int Parser::parse_wave(char * token, std::istream & f
+
+ if (token == NULL)
+ return PROJECTM_FAILURE;
+- if (fs == NULL)
++ if (fs.fail())
+ return PROJECTM_FAILURE;
+ if (preset == NULL)
+ return PROJECTM_FAILURE;
+@@ -2347,7 +2347,7 @@ int Parser::parse_shape(char * token, std::istream &
+ if (token == NULL)
+
+ return PROJECTM_FAILURE;
+- if (fs == NULL)
++ if (fs.fail())
+ return PROJECTM_FAILURE;
+ if (preset == NULL)
+ return PROJECTM_FAILURE;
+--- Renderer/VideoEcho.cpp.orig 2009-12-06 01:42:51 UTC
++++ Renderer/VideoEcho.cpp
+@@ -74,10 +74,10 @@ void VideoEcho::Draw(RenderContext &context)
+ default: flipx=1;flipy=1; break;
+ }
+
+- float pointsFlip[4][2] = {{-0.5*flipx, -0.5*flipy},
+- {-0.5*flipx, 0.5*flipy},
+- { 0.5*flipx, 0.5*flipy},
+- { 0.5*flipx, -0.5*flipy}};
++ float pointsFlip[4][2] = {{-0.5f*flipx, -0.5f*flipy},
++ {-0.5f*flipx, 0.5f*flipy},
++ { 0.5f*flipx, 0.5f*flipy},
++ { 0.5f*flipx, -0.5f*flipy}};
+
+ glVertexPointer(2,GL_FLOAT,0,pointsFlip);
+ glDrawArrays(GL_TRIANGLE_FAN,0,4);
More information about the svn-ports-all
mailing list