From c2b99f6321965b2c5b30a1b72b29119281c2d7e1 Mon Sep 17 00:00:00 2001 From: Chris Xiong Date: Mon, 25 Apr 2016 23:47:43 +0800 Subject: Compile with -fPIC to allow linkage to libraries. Make several math functions static. Elimate several warnings from the compiler. --- include/smelt.hpp | 4 +++- include/smmath.hpp | 8 ++++---- 2 files changed, 7 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/smelt.hpp b/include/smelt.hpp index 90ffc22..3894e34 100644 --- a/include/smelt.hpp +++ b/include/smelt.hpp @@ -74,7 +74,9 @@ typedef bool (*smHook)(); //Wrapper abstract class for a function that can hook into SMELT class smHandler { - public: virtual bool handlerFunc()=0; + public: + virtual ~smHandler(){} + virtual bool handlerFunc()=0; }; //Special FPS modes diff --git a/include/smmath.hpp b/include/smmath.hpp index 5172772..b9763b7 100644 --- a/include/smmath.hpp +++ b/include/smmath.hpp @@ -23,10 +23,10 @@ templateconst T& max(const T& a,const T& b){return a>b?a:b;} class smMath { public: - double deg2rad(double deg){return deg/180.*PI;} - double rad2deg(double rad){return rad/PI*180.;} - double clamprad(double a){while(a<0)a+=2*PI;while(a>2*PI)a-=2*PI;return a;} - double clampdeg(double a){while(a<0)a+=360.;while(a>360)a-=360.;return a;} + static double deg2rad(double deg){return deg/180.*PI;} + static double rad2deg(double rad){return rad/PI*180.;} + static double clamprad(double a){while(a<0)a+=2*PI;while(a>2*PI)a-=2*PI;return a;} + static double clampdeg(double a){while(a<0)a+=360.;while(a>360)a-=360.;return a;} }; class smvec2d { -- cgit v1.2.3