opnsense-ports/graphics/libprojectm/files/patch-c++11
Franco Fichtner 2f3d17fbcd */*: sync with upstream
Taken from: HardenedBSD
2018-01-21 14:23:44 +01:00

87 lines
2.8 KiB
Text

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);