From f9f321ca8470f18a8e16b56a9e7b787ee3fc4ca4 Mon Sep 17 00:00:00 2001 From: Daniel Richard G Date: Mon, 2 Dec 2013 01:22:35 -0500 Subject: [PATCH] Warning fixes --- src/glhelper.cpp | 2 +- src/mouse.cpp | 4 ++-- src/solvespace.h | 4 ++++ src/ttf.cpp | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/glhelper.cpp b/src/glhelper.cpp index 35ef228a..830882a0 100644 --- a/src/glhelper.cpp +++ b/src/glhelper.cpp @@ -90,7 +90,7 @@ void ssglWriteText(const char *str, double h, Vector t, Vector u, Vector v, Vector p = t; p = p.Plus(u.ScaledBy((xo + x)*scale)); p = p.Plus(v.ScaledBy((yo + y)*scale)); - if(prevp.x != VERY_POSITIVE) { + if(EXACT(prevp.x != VERY_POSITIVE)) { fn(fndata, prevp, p); } prevp = p; diff --git a/src/mouse.cpp b/src/mouse.cpp index ca9e90f7..13994186 100644 --- a/src/mouse.cpp +++ b/src/mouse.cpp @@ -1270,7 +1270,7 @@ void GraphicsWindow::SpaceNavigatorMoved(double tx, double ty, double tz, // but it's given with respect to screen projection frame aa = aa.ScaleOutOfCsys(projRight, projUp, out); double aam = aa.Magnitude(); - if(aam != 0.0) aa = aa.WithMagnitude(1); + if(aam > 0.0) aa = aa.WithMagnitude(1); // This can either transform our view, or transform an imported part. GroupSelection(); @@ -1313,7 +1313,7 @@ void GraphicsWindow::SpaceNavigatorMoved(double tx, double ty, double tz, offset = offset.Plus(projUp.ScaledBy(ty/scale)); scale *= exp(0.001*tz); - if(aam != 0.0) { + if(aam > 0.0) { projRight = projRight.RotatedAbout(aa, -aam); projUp = projUp. RotatedAbout(aa, -aam); NormalizeProjectionVectors(); diff --git a/src/solvespace.h b/src/solvespace.h index 63a355f9..73ca7764 100644 --- a/src/solvespace.h +++ b/src/solvespace.h @@ -506,6 +506,10 @@ public: FILE *f; Vector ptMin, ptMax; + // This quells the Clang++ warning "'VectorFileWriter' has virtual + // functions but non-virtual destructor" + virtual ~VectorFileWriter() {} + static double MmToPts(double mm); static VectorFileWriter *ForFile(char *file); diff --git a/src/ttf.cpp b/src/ttf.cpp index 21f5643f..b0a673f4 100644 --- a/src/ttf.cpp +++ b/src/ttf.cpp @@ -109,7 +109,7 @@ void TtfFont::LoadGlyph(int index) { int16_t xMax = (int16_t)GetUSHORT(); int16_t yMax = (int16_t)GetUSHORT(); - if(useGlyph['A'] == index) { + if(useGlyph[(int)'A'] == index) { scale = (1024*1024) / yMax; }