[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash/libbase utility.h
From: |
Markus Gothe |
Subject: |
[Gnash-commit] gnash/libbase utility.h |
Date: |
Mon, 27 Aug 2007 22:47:55 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Markus Gothe <nihilus> 07/08/27 22:47:55
Modified files:
libbase : utility.h
Log message:
Clean up.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/libbase/utility.h?cvsroot=gnash&r1=1.29&r2=1.30
Patches:
Index: utility.h
===================================================================
RCS file: /sources/gnash/gnash/libbase/utility.h,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -b -r1.29 -r1.30
--- utility.h 27 Aug 2007 21:15:11 -0000 1.29
+++ utility.h 27 Aug 2007 22:47:54 -0000 1.30
@@ -92,11 +92,8 @@
//
inline float infinite_to_fzero(float x) { return isfinite(x) ? x : 0.0f; }
-inline int iabs(int i) { if (i < 0) return -i; else return i; }
inline int imax(int a, int b) { if (a < b) return b; else return a; }
-inline float fmax(float a, float b) { if (a < b) return b; else return a; }
inline int imin(int a, int b) { if (a < b) return a; else return b; }
-inline float fmin(float a, float b) { if (a < b) return a; else return b; }
inline int iclamp(int i, int min, int max) {
assert( min <= max );
@@ -114,14 +111,13 @@
const float LN_2 = 0.693147180559945f;
// the overridden log(f) will use logf IFF f is a float
#ifndef HAVE_LOG2
-inline float log2(float f) { return std::log(f) / LN_2; }
+inline double log2(double f) { return std::log(f) / LN_2; }
#endif
//exp2 might be missing on Net-/OpenBSD.
#ifndef HAVE_EXP2
-inline float exp2(double x) { return std::pow((double)2, double(x)); }
+inline double exp2(double x) { return std::pow((double)2, double(x)); }
#endif
-inline int fchop( float f ) { return (int) f; } // replace w/ inline
asm if desired
-inline int frnd(float f) { return fchop(f + 0.5f); } // replace with
inline asm if desired
+inline int frnd(float f) { return (int)rint(f + 0.5f); } // replace with
inline asm if desired
// Handy macro to quiet compiler warnings about unused parameters/variables.