summaryrefslogtreecommitdiff
path: root/sci-mathematics/mathmod/files/mathmod-13.0-fix_comparison.patch
blob: 53a74cef6f0523c4586dbfc7afce7ce432fddf1a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
backport https://github.com/parisolab/mathmod/commit/ddf9239f10fb0e07603297c06a23b7adeae8e323.patch
see also https://github.com/parisolab/mathmod/issues/303
fix comparison for clang
--- a/ui_modules/mathmod.cpp
+++ b/ui_modules/mathmod.cpp
@@ -1665,7 +1665,7 @@ void MathMod::CopyData(ObjectProperties *scene)
     {
         glBindBuffer(GL_ARRAY_BUFFER, vbo[0]);
         glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, vbo[1]);
-        if(scene->VertxNumber>previousVertxNumber>0)
+        if((scene->VertxNumber>previousVertxNumber) && (scene->VertxNumber>0))
         {
             glBufferData(GL_ARRAY_BUFFER, sizeof(GL_FLOAT)*10*(scene->VertxNumber+(12+60+36)), scene->ArrayNorVer_localPt, GL_STATIC_DRAW);
             previousVertxNumber = scene->VertxNumber;
@@ -1676,7 +1676,8 @@ void MathMod::CopyData(ObjectProperties *scene)
             previousVertxNumber = scene->VertxNumber;
         }
 
-        if((scene->PolyNumber + scene->NbPolygnNbVertexPtMinSize)>previousPolyNumberNbPolygnNbVertexPtMin)
+        if(((scene->PolyNumber + scene->NbPolygnNbVertexPtMinSize)>previousPolyNumberNbPolygnNbVertexPtMin) &&
+            ((scene->PolyNumber + scene->NbPolygnNbVertexPtMinSize)>0))
         {
             glBufferData(GL_ELEMENT_ARRAY_BUFFER,sizeof(GLuint)*(scene->PolyNumber + scene->NbPolygnNbVertexPtMinSize), scene->PolyIndices_localPt, GL_STATIC_DRAW);
             previousPolyNumberNbPolygnNbVertexPtMin =  (scene->PolyNumber + scene->NbPolygnNbVertexPtMinSize);