From 4de47bdbebf5e3dd2c781583fa6a28f3b5c08fc7 Mon Sep 17 00:00:00 2001 From: Joachim Schoeberl Date: Fri, 15 Aug 2014 14:46:26 +0000 Subject: [PATCH] fixed some warnings --- libsrc/gprim/geom3d.cpp | 13 +++++++++++++ libsrc/meshing/meshclass.cpp | 2 +- libsrc/meshing/topology.cpp | 1 - libsrc/visualization/mvdraw.cpp | 16 +++++++++------- libsrc/visualization/vsmesh.cpp | 20 ++++---------------- libsrc/visualization/vssolution.cpp | 4 ++-- ng/ngappinit.cpp | 15 +-------------- 7 files changed, 30 insertions(+), 41 deletions(-) diff --git a/libsrc/gprim/geom3d.cpp b/libsrc/gprim/geom3d.cpp index 04ecd137..cb1f92c2 100644 --- a/libsrc/gprim/geom3d.cpp +++ b/libsrc/gprim/geom3d.cpp @@ -400,6 +400,14 @@ void Transpose (Vec3d & v1, Vec3d & v2, Vec3d & v3) } +/* + gcc4.8.3 warning: array subscript is above array bounds [-Warray-bounds] + */ +#ifdef __GNUC__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Warray-bounds" +#endif + int SolveLinearSystem (const Vec3d & col1, const Vec3d & col2, const Vec3d & col3, const Vec3d & rhs, Vec3d & sol) @@ -519,6 +527,11 @@ int SolveLinearSystem (const Vec3d & col1, const Vec3d & col2, */ } +#ifdef __GNUC__ +#pragma GCC diagnostic pop +#endif + + int SolveLinearSystemLS (const Vec3d & col1, const Vec3d & col2, diff --git a/libsrc/meshing/meshclass.cpp b/libsrc/meshing/meshclass.cpp index 94d0e3bb..79ac1545 100644 --- a/libsrc/meshing/meshclass.cpp +++ b/libsrc/meshing/meshclass.cpp @@ -1592,7 +1592,7 @@ namespace netgen surfelementht -> Set (i3, sei); // war das wichtig ??? sel.GetIndex()); } - int np = GetNP(); + // int np = GetNP(); if (dimension == 3) { diff --git a/libsrc/meshing/topology.cpp b/libsrc/meshing/topology.cpp index 06b68d00..b3596089 100644 --- a/libsrc/meshing/topology.cpp +++ b/libsrc/meshing/topology.cpp @@ -372,7 +372,6 @@ namespace netgen static int timer2a = NgProfiler::CreateTimer ("topology::buildfacesa"); static int timer2b = NgProfiler::CreateTimer ("topology::buildfacesb"); static int timer2c = NgProfiler::CreateTimer ("topology::buildfacesc"); - static int timer2d = NgProfiler::CreateTimer ("topology::buildfacesd"); NgProfiler::RegionTimer reg2 (timer2); if (id == 0) diff --git a/libsrc/visualization/mvdraw.cpp b/libsrc/visualization/mvdraw.cpp index 489592d6..cec04277 100644 --- a/libsrc/visualization/mvdraw.cpp +++ b/libsrc/visualization/mvdraw.cpp @@ -584,7 +584,9 @@ namespace netgen glDisable (GL_TEXTURE_1D); glEnable (GL_COLOR_MATERIAL); - GLfloat textcol[3] = { 1 - backcolor, 1 - backcolor, 1 - backcolor }; + GLfloat textcol[3] = { GLfloat(1 - backcolor), + GLfloat(1 - backcolor), + GLfloat(1 - backcolor) }; glColor3fv (textcol); glPushAttrib (GL_LIST_BIT); @@ -638,9 +640,9 @@ namespace netgen glPolygonMode (GL_FRONT_AND_BACK, GL_LINE); - GLfloat textcol[3] = { 1 - backcolor, - 1 - backcolor, - 1 - backcolor }; + GLfloat textcol[3] = { GLfloat(1 - backcolor), + GLfloat(1 - backcolor), + GLfloat(1 - backcolor) }; glColor3fv (textcol); glLineWidth (1.0f); @@ -710,9 +712,9 @@ namespace netgen glDisable (GL_LIGHTING); glEnable (GL_COLOR_MATERIAL); - GLfloat textcol[3] = { 1 - backcolor, - 1 - backcolor, - 1 - backcolor }; + GLfloat textcol[3] = { GLfloat(1 - backcolor), + GLfloat(1 - backcolor), + GLfloat(1 - backcolor) }; glColor3fv (textcol); glLineWidth (1.0f); diff --git a/libsrc/visualization/vsmesh.cpp b/libsrc/visualization/vsmesh.cpp index ecb88749..1c18c905 100644 --- a/libsrc/visualization/vsmesh.cpp +++ b/libsrc/visualization/vsmesh.cpp @@ -411,9 +411,9 @@ namespace netgen vispar.drawelementnumbers) { // glEnable (GL_COLOR_MATERIAL); - GLfloat textcol[3] = { 1 - backcolor, - 1 - backcolor, - 1 - backcolor }; + GLfloat textcol[3] = { float(1-backcolor), + float(1-backcolor), + float(1-backcolor) }; glColor3fv (textcol); glNormal3d (0, 0, 1); glPushAttrib (GL_LIST_BIT); @@ -1816,16 +1816,6 @@ namespace netgen */ }; - static float tetcols_ghost[4][4]; - - for (int j = 0; j < 4; j++) - { - for (int i = 0; i < 3; i++) - tetcols_ghost[j][i] = tetcols[j][i]; - tetcols_ghost[j][3] = 0.3; - } - - CurvedElements & curv = mesh->GetCurvedElements(); @@ -3099,10 +3089,8 @@ namespace netgen MouseDblClickSelect(px,py,clipplane,backcolor,transformationmat,center,rad, filledlist,selelement,selface,seledge,selpoint,selpoint2,locpi); - - - GLdouble modelview[16], projection[16]; + GLdouble /* modelview[16], */ projection[16]; GLint viewport[4]; GLdouble result[3]; diff --git a/libsrc/visualization/vssolution.cpp b/libsrc/visualization/vssolution.cpp index 4c031c75..0bc3a50b 100644 --- a/libsrc/visualization/vssolution.cpp +++ b/libsrc/visualization/vssolution.cpp @@ -3678,7 +3678,7 @@ namespace netgen { 1, 2 }, { 1, 3 }, { 2, 3 } }; double edgelam[6]; - Point<3> edgep[6]; + // Point<3> edgep[6]; double nodevali[4]; int cntce; @@ -4540,7 +4540,7 @@ namespace netgen for (int i = 0; i < vssolution.soldata.Size(); i++) { - if ( (strlen (vssolution.soldata[i]->name) == pointpos-1) && + if ( (strlen (vssolution.soldata[i]->name) == size_t(pointpos-1)) && (strncmp (vssolution.soldata[i]->name, scalname, pointpos-1) == 0) ) { vssolution.scalfunction = i; diff --git a/ng/ngappinit.cpp b/ng/ngappinit.cpp index 1cb553ce..95c1f71b 100644 --- a/ng/ngappinit.cpp +++ b/ng/ngappinit.cpp @@ -430,25 +430,12 @@ int Tcl_AppInit(Tcl_Interp * interp) // from the ngsolve shared library #ifdef LINKMKL - -typedef long int integer; -#define F77_FUNC(func) func ## _ -extern "C" integer F77_FUNC(pardisoinit) - (void *, integer *, integer *, integer *, double *, integer *); - - extern "C" double ddot_(int *n, double *dx, int *incx, double *dy, int *incy); - -int mkldummy() +void mkldummy() { int n = 1, one = 1; double a = 1, b = 1; ddot_(&n, &a, &one, &b, &one); - /* - void * p; - integer li; - F77_FUNC(pardisoinit) (p, &li, &li, &li, &a, &li); - */ } #endif