From d429540a477d6b3b385302336a870fb7a8fb43b0 Mon Sep 17 00:00:00 2001 From: Joachim Schoeberl Date: Tue, 25 Jul 2023 23:03:58 +0200 Subject: [PATCH] fix warnings --- libsrc/csg/vscsg.cpp | 4 ++-- libsrc/meshing/topology.cpp | 5 +++-- ng/Togl2.1/togl.c | 2 ++ ng/Togl2.1/toglProcAddr.c | 3 +++ 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/libsrc/csg/vscsg.cpp b/libsrc/csg/vscsg.cpp index ed511e79..be91902f 100644 --- a/libsrc/csg/vscsg.cpp +++ b/libsrc/csg/vscsg.cpp @@ -343,7 +343,7 @@ namespace netgen const Point3d p = Center (p1, p2); glRasterPos3d (p.X(), p.Y(), p.Z()); - sprintf (buf, "%d", seg.edgenr); + snprintf (buf, sizeof(buf), "%d", seg.edgenr); // glCallLists (GLsizei(strlen (buf)), GL_UNSIGNED_BYTE, buf); MyOpenGLText (buf); } @@ -418,7 +418,7 @@ namespace netgen const Point3d & p = mesh->Point(i); glRasterPos3d (p.X(), p.Y(), p.Z()); - sprintf (buf, "%d", int(i)); + snprintf (buf, sizeof(buf), "%d", int(i)); // glCallLists (GLsizei(strlen (buf)), GL_UNSIGNED_BYTE, buf); MyOpenGLText (buf); } diff --git a/libsrc/meshing/topology.cpp b/libsrc/meshing/topology.cpp index 00108838..e154f77e 100644 --- a/libsrc/meshing/topology.cpp +++ b/libsrc/meshing/topology.cpp @@ -2228,7 +2228,7 @@ namespace netgen void MeshTopology :: GetFaceEdges (int fnr, NgArray & fedges, bool withorientation) const { NgArrayMem pi(4); - NgArrayMem eledges; + // NgArrayMem eledges; fedges.SetSize (0); GetFaceVertices(fnr, pi); @@ -2279,7 +2279,8 @@ namespace netgen { const ELEMENT_EDGE * fa_ref_edges = GetEdges1 (GetFaceType(fnr)); fedges.SetSize(nfa_ref_edges); - GetElementEdges (els[i]+1, eledges); + // GetElementEdges (els[i]+1, eledges); + auto eledges = GetEdges (els[i]); for (int j = 0; j < eledges.Size(); j++) { diff --git a/ng/Togl2.1/togl.c b/ng/Togl2.1/togl.c index 35ab8356..78faa6c1 100644 --- a/ng/Togl2.1/togl.c +++ b/ng/Togl2.1/togl.c @@ -22,6 +22,8 @@ # endif #endif +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + #define USE_TOGL_STUB_PROCS #include "togl.h" diff --git a/ng/Togl2.1/toglProcAddr.c b/ng/Togl2.1/toglProcAddr.c index 2e72fbea..500ffa1b 100644 --- a/ng/Togl2.1/toglProcAddr.c +++ b/ng/Togl2.1/toglProcAddr.c @@ -10,6 +10,9 @@ * See the LICENSE file for copyright details. */ +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + + #include "togl.h" #if defined(TOGL_OSMESA) || defined(TOGL_WGL)