From 950c31f50d3c2000853e7fb25123dd5ceb3ef1c8 Mon Sep 17 00:00:00 2001 From: Lee Salzman Date: Fri, 22 Aug 2008 20:40:42 +0000 Subject: [PATCH] inline round git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@2354 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/tools.cpp | 2 -- source/src/tools.h | 3 ++- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/source/src/tools.cpp b/source/src/tools.cpp index afad080e..580a981d 100644 --- a/source/src/tools.cpp +++ b/source/src/tools.cpp @@ -277,5 +277,3 @@ bool isbigendian() return !(*((char *)(&one))); } -float round(float x) { return floor(x + 0.5f); } - diff --git a/source/src/tools.h b/source/src/tools.h index 6f9228f0..08e63525 100644 --- a/source/src/tools.h +++ b/source/src/tools.h @@ -49,6 +49,8 @@ static inline T min(T a, T b) return a < b ? a : b; } +static inline float round(float x) { return floor(x + 0.5f); } + #define clamp(a,b,c) (max(b, min(a, c))) #define rnd(max) (rand()%(max)) #define rndreset() (srand(1)) @@ -508,7 +510,6 @@ extern bool cmpb(void *b, int n, enet_uint32 c); extern bool cmpf(char *fn, enet_uint32 c); extern void endianswap(void *, int, int); extern bool isbigendian(); -extern float round(float x); #endif