[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash libbase/utility.h testsuite/MovieTester.c...
From: |
Benjamin Wolsey |
Subject: |
[Gnash-commit] gnash libbase/utility.h testsuite/MovieTester.c... |
Date: |
Sat, 17 May 2008 08:43:27 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Benjamin Wolsey <bwy> 08/05/17 08:43:27
Modified files:
libbase : utility.h
testsuite : MovieTester.cpp MovieTester.h
Log message:
* libbase/utility.h: drop LN_2, log2, trunc replacements as they
aren't used anywhere in the code. Move exp2 define to
MovieTester.cpp as it's only used there.
* testsuite/MovieTester.{cpp,h}: add inline exp2 function in
case
it's missing.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/libbase/utility.h?cvsroot=gnash&r1=1.50&r2=1.51
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/MovieTester.cpp?cvsroot=gnash&r1=1.71&r2=1.72
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/MovieTester.h?cvsroot=gnash&r1=1.37&r2=1.38
Patches:
Index: libbase/utility.h
===================================================================
RCS file: /sources/gnash/gnash/libbase/utility.h,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -b -r1.50 -r1.51
--- libbase/utility.h 10 May 2008 11:05:28 -0000 1.50
+++ libbase/utility.h 17 May 2008 08:43:22 -0000 1.51
@@ -117,21 +117,7 @@
inline float flerp(float a, float b, float f) { return (b - a) * f + a; }
-//This is from C99.
-const float LN_2 = 0.693147180559945f;
-// the overridden log(f) will use logf IFF f is a float
-#ifndef HAVE_LOG2
-inline double log2(double f) { return std::log(f) / LN_2; }
-#endif
-//exp2 might be missing on Net-/OpenBSD.
-#ifndef HAVE_EXP2
-inline double exp2(double x) { return std::pow((double)2, double(x)); }
-#endif
inline int frnd(float f) { return (int)(f + 0.5f); } // replace with
inline asm if desired
-#ifndef HAVE_TRUNC
-inline double trunc(double x) { return (x < 0 ? -(std::floor(-x)) :
std::floor(x)); }
-#endif
-
/// \brief
/// Return the smallest multiple of given base greater or equal
Index: testsuite/MovieTester.cpp
===================================================================
RCS file: /sources/gnash/gnash/testsuite/MovieTester.cpp,v
retrieving revision 1.71
retrieving revision 1.72
diff -u -b -r1.71 -r1.72
--- testsuite/MovieTester.cpp 29 Apr 2008 09:20:14 -0000 1.71
+++ testsuite/MovieTester.cpp 17 May 2008 08:43:24 -0000 1.72
@@ -44,7 +44,7 @@
#include <cstdio>
#include <string>
#include <memory> // for auto_ptr
-#include <cmath> // for ceil and exp2
+#include <cmath> // for ceil and (possibly) exp2
#include <iostream>
#define SHOW_INVALIDATED_BOUNDS_ON_ADVANCE 1
Index: testsuite/MovieTester.h
===================================================================
RCS file: /sources/gnash/gnash/testsuite/MovieTester.h,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -b -r1.37 -r1.38
--- testsuite/MovieTester.h 13 Mar 2008 11:23:16 -0000 1.37
+++ testsuite/MovieTester.h 17 May 2008 08:43:25 -0000 1.38
@@ -21,6 +21,10 @@
#ifndef _GNASH_MOVIETESTER_H
#define _GNASH_MOVIETESTER_H
+#ifdef HAVE_CONFIG_H
+# include "gnashconfig.h" // For exp2 test
+#endif
+
#include "Range2d.h"
#include "gnash.h" // for namespace key
#include "sound_handler.h" // for creating the "test" sound handlers
@@ -32,6 +36,7 @@
#include <memory> // for auto_ptr
#include <string>
#include <boost/shared_ptr.hpp>
+#include <cmath>
#define check_pixel(x, y, radius, color, tolerance) \
{\
@@ -343,6 +348,12 @@
//std::auto_ptr<VirtualClock> _clock;
};
+// exp2 isn't part of standard C++, so is defined here in case the compiler
+// doesn't supply it (e.g. in BSD)
+#ifndef HAVE_EXP2
+inline double exp2(double x) { return std::pow((double)2, double(x)); }
+#endif
+
} // namespace gnash
#endif // _GNASH_MOVIETESTER_H
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] gnash libbase/utility.h testsuite/MovieTester.c...,
Benjamin Wolsey <=