From 60d0abcc543f87fb43db1b0e104696f441991719 Mon Sep 17 00:00:00 2001 From: Eric Bechet <eric.bechet@ulg.ac.be> Date: Sat, 4 Jun 2016 14:56:56 +0000 Subject: [PATCH] removed bunch of warnings --- Common/onelab.h | 5 ++++- Fltk/FlGui.cpp | 2 +- Fltk/drawContextFltkStringTexture.cpp | 2 +- Geo/discreteDiskFace.cpp | 2 +- Graphics/drawGlyph.cpp | 4 ++-- Graphics/gl2ps.cpp | 2 +- Mesh/tetgenBR.cxx | 7 +++++-- Mesh/yamakawa.cpp | 8 ++++---- Parser/Gmsh.yy.cpp | 2 +- 9 files changed, 20 insertions(+), 14 deletions(-) diff --git a/Common/onelab.h b/Common/onelab.h index e0950bef64..a92413ae92 100644 --- a/Common/onelab.h +++ b/Common/onelab.h @@ -1277,7 +1277,10 @@ namespace onelab{ void runNonBlockingSubClient(const std::string &name, const std::string &command) { if(!_gmshClient){ - system(command.c_str()); + int res=system(command.c_str()); + if (res) + {// error + } return; } std::string msg = name + parameter::charSep() + command; diff --git a/Fltk/FlGui.cpp b/Fltk/FlGui.cpp index a9fac7ffd4..9e8aaaadeb 100644 --- a/Fltk/FlGui.cpp +++ b/Fltk/FlGui.cpp @@ -370,7 +370,7 @@ FlGui::FlGui(int argc, char **argv) // nothing to do here #else fl_open_display(); - static char *gmsh32x32 = + static const char *gmsh32x32 = "\x00\x00\x00\x00\x00\x80\x01\x00\x00\x40\x03\x00\ \x00\x40\x03\x00\x00\x20\x07\x00\x00\x20\x07\x00\ \x00\x10\x0f\x00\x00\x10\x0f\x00\x00\x08\x1f\x00\ diff --git a/Fltk/drawContextFltkStringTexture.cpp b/Fltk/drawContextFltkStringTexture.cpp index 81b90ca173..432a5cbaa5 100644 --- a/Fltk/drawContextFltkStringTexture.cpp +++ b/Fltk/drawContextFltkStringTexture.cpp @@ -145,7 +145,7 @@ void drawContextFltkStringTexture::drawString(const char *str) glGetFloatv(GL_CURRENT_RASTER_POSITION, pos); glGetFloatv(GL_CURRENT_COLOR, color); queueString::element elem = {str, pos[0], pos[1], pos[2], color[0], color[1], color[2], color[3], - _currentFontSize, _currentFontId, getStringWidth(str) + 1, getStringHeight()}; + _currentFontSize, _currentFontId, (int)getStringWidth(str) + 1, getStringHeight()}; _queue->append(elem); } diff --git a/Geo/discreteDiskFace.cpp b/Geo/discreteDiskFace.cpp index ba646261cf..6ee019066e 100644 --- a/Geo/discreteDiskFace.cpp +++ b/Geo/discreteDiskFace.cpp @@ -651,7 +651,7 @@ void discreteDiskFace::putOnView(bool Xu, bool Ux) char mybuffer [64]; - FILE *view_u, *view_v, *UVx, *UVy, *UVz; + FILE *view_u=NULL, *view_v=NULL, *UVx=NULL, *UVy=NULL, *UVz=NULL; diff --git a/Graphics/drawGlyph.cpp b/Graphics/drawGlyph.cpp index a748158b29..20647370e5 100644 --- a/Graphics/drawGlyph.cpp +++ b/Graphics/drawGlyph.cpp @@ -264,7 +264,7 @@ void drawContext::drawEllipse(double x, double y, double z, float v0[3], float v v0[0], v0[1], v0[2], .0f, v1[0], v1[1], v1[2], .0f, v0[1]*v1[2]-v0[2]*v1[1], v0[2]*v1[0]-v0[0]*v1[2], v0[0]*v1[1]-v0[1]*v1[0], .0f, - x, y, z, 1.f + (GLfloat)x, (GLfloat)y, (GLfloat)z, 1.f }; glMultMatrixf(m); glCallList(_displayLists + 2); @@ -281,7 +281,7 @@ void drawContext::drawEllipsoid(double x, double y, double z, float v0[3], float v0[0], v0[1], v0[2], .0f, v1[0], v1[1], v1[2], .0f, v2[0], v2[1], v2[2], .0f, - x, y, z, 1.f + (GLfloat)x, (GLfloat)y, (GLfloat)z, 1.f }; glMultMatrixf(m); glCallList(_displayLists + 0); diff --git a/Graphics/gl2ps.cpp b/Graphics/gl2ps.cpp index c6c6d41141..b23e449134 100644 --- a/Graphics/gl2ps.cpp +++ b/Graphics/gl2ps.cpp @@ -2244,7 +2244,7 @@ static void gl2psParseFeedbackBuffer(GLint used) GLushort pattern = 0; GLboolean boundary; GLint i, sizeoffloat, count, v, vtot, offset = 0, factor = 0, auxindex = 0; - GLfloat lwidth = 1.0F, psize = 1.0F, ofactor, ounits; + GLfloat lwidth = 1.0F, psize = 1.0F, ofactor=1.0F, ounits=1.0F; GLfloat *current; GL2PSvertex vertices[3]; GL2PSprimitive *prim; diff --git a/Mesh/tetgenBR.cxx b/Mesh/tetgenBR.cxx index be00762e76..e8eecc4aa6 100644 --- a/Mesh/tetgenBR.cxx +++ b/Mesh/tetgenBR.cxx @@ -12476,7 +12476,7 @@ int tetgenmesh::add_steinerpt_in_segment(face* misseg, int searchlevel) enum interresult dir; REAL P[3], Q[3], tp, tq; REAL len, smlen = 0, split = 0, split_q = 0; - int success; + int success=0; int i; startpt = sorg(*misseg); @@ -12625,7 +12625,10 @@ int tetgenmesh::add_steinerpt_in_segment(face* misseg, int searchlevel) st_volref_count++; } if (steinerleft > 0) steinerleft--; - + if (!success){ + // error + } + return 1; } diff --git a/Mesh/yamakawa.cpp b/Mesh/yamakawa.cpp index 6eabdaf276..fc7e695bce 100644 --- a/Mesh/yamakawa.cpp +++ b/Mesh/yamakawa.cpp @@ -1456,7 +1456,7 @@ void Recombinator::pattern1(GRegion* gr){ void Recombinator::pattern2(GRegion* gr){ size_t i; - int index1,index2,index3,index4; + int index1=0,index2=0,index3=0,index4=0; double quality; MElement* element; MVertex *a,*b,*c,*d; @@ -1510,7 +1510,7 @@ void Recombinator::pattern2(GRegion* gr){ void Recombinator::pattern3(GRegion* gr){ size_t i; - int index1,index2,index3,index4; + int index1=0,index2=0,index3=0,index4=0; bool c1,c2,c3,c4,c5; bool c6,c7,c8,c9,c10; double quality; @@ -6937,7 +6937,7 @@ void Recombinator_Graph::pattern1(GRegion* gr){ void Recombinator_Graph::pattern2(GRegion* gr){ int size_init = hex_to_tet.size(); size_t i; - int index1,index2,index3,index4; + int index1=0,index2=0,index3=0,index4=0; double quality; MElement* element; MVertex *a,*b,*c,*d; @@ -6989,7 +6989,7 @@ void Recombinator_Graph::pattern2(GRegion* gr){ void Recombinator_Graph::pattern3(GRegion* gr){ int size_init = hex_to_tet.size(); size_t i; - int index1,index2,index3,index4; + int index1=0,index2=0,index3=0,index4=0; bool c1,c2,c3,c4,c5; bool c6,c7,c8,c9,c10; double quality; diff --git a/Parser/Gmsh.yy.cpp b/Parser/Gmsh.yy.cpp index f53a180bb3..e132ded53f 100644 --- a/Parser/Gmsh.yy.cpp +++ b/Parser/Gmsh.yy.cpp @@ -3253,7 +3253,7 @@ YY_BUFFER_STATE gmsh_yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes YY_BUFFER_STATE b; char *buf; yy_size_t n; - int i; + yy_size_t i; /* Get memory for full buffer, including space for trailing EOB's. */ n = _yybytes_len + 2; -- GitLab