[Poppler-bugs] [Bug 25578] Seen crahses in Fixed Point

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Mon Jan 4 03:34:07 PST 2010


http://bugs.freedesktop.org/show_bug.cgi?id=25578





--- Comment #9 from Marius Vollmer <marius.vollmer at nokia.com>  2010-01-04 03:34:06 PST ---
Upps, that patch includes the collateral damages to the autocruft.  Here is the
relevant part:

Index: poppler/configure.ac
===================================================================
--- poppler.orig/configure.ac   2009-12-30 15:22:10.000000000 +0200
+++ poppler/configure.ac        2009-12-30 15:22:26.000000000 +0200
@@ -67,6 +67,10 @@
               enable_xpdf_headers="no")
 AM_CONDITIONAL(ENABLE_XPDF_HEADERS, test x$enable_xpdf_headers = xyes)

+AC_ARG_ENABLE(single-precision,
+[  --enable-single-precision     use single precision arithmetic (instead of
double precision)],
+AC_DEFINE(USE_FLOAT,      [1], [Use single precision arithmetic]))
+
 AC_ARG_ENABLE(fixedpoint,
 [  --enable-fixedpoint     use fixed point (instead of floating point)
arithmetic],
 AC_DEFINE(USE_FIXEDPOINT, [1], [Use fixed point arithmetic]))
Index: poppler/splash/SplashTypes.h
===================================================================
--- poppler.orig/splash/SplashTypes.h   2009-12-30 15:23:53.000000000 +0200
+++ poppler/splash/SplashTypes.h        2009-12-30 15:24:01.000000000 +0200
@@ -33,8 +33,12 @@
 #include "goo/FixedPoint.h"
 typedef FixedPoint SplashCoord;
 #else
+#if USE_FLOAT
+typedef float SplashCoord;
+#else
 typedef double SplashCoord;
 #endif
+#endif

 //------------------------------------------------------------------------
 // antialiasing
Index: poppler/splash/SplashMath.h
===================================================================
--- poppler.orig/splash/SplashMath.h    2009-12-30 15:25:05.000000000 +0200
+++ poppler/splash/SplashMath.h 2009-12-30 15:27:53.000000000 +0200
@@ -18,48 +18,72 @@
 #if USE_FIXEDPOINT
   return FixedPoint::abs(x);
 #else
+#if USE_FLOAT
+  return fabsf(x);
+#else
   return fabs(x);
 #endif
+#endif
 }

 static inline int splashFloor(SplashCoord x) {
   #if USE_FIXEDPOINT
     return FixedPoint::floor(x);
   #else
+  #if USE_FLOAT
+    return (int)floorf(x);
+  #else
     return (int)floor(x);
   #endif
+  #endif
 }

 static inline int splashCeil(SplashCoord x) {
 #if USE_FIXEDPOINT
   return FixedPoint::ceil(x);
 #else
+#if USE_FLOAT
+  return (int)ceilf(x);
+#else
   return (int)ceil(x);
 #endif
+#endif
 }

 static inline int splashRound(SplashCoord x) {
 #if USE_FIXEDPOINT
   return FixedPoint::round(x);
 #else
+#if USE_FLOAT
+  return (int)floorf(x + 0.5);
+#else
   return (int)floor(x + 0.5);
 #endif
+#endif
 }

 static inline SplashCoord splashSqrt(SplashCoord x) {
 #if USE_FIXEDPOINT
   return FixedPoint::sqrt(x);
 #else
+#if USE_FLOAT
+  return sqrtf(x);
+#else
   return sqrt(x);
 #endif
+#endif
 }

 static inline SplashCoord splashPow(SplashCoord x, SplashCoord y) {
 #if USE_FIXEDPOINT
   return FixedPoint::pow(x, y);
 #else
+#if USE_FLOAT
+  return powf(x, y);
+#else
   return pow(x, y);
 #endif
+#endif
 }

 static inline SplashCoord splashDist(SplashCoord x0, SplashCoord y0,
@@ -81,8 +105,12 @@
     return dya * FixedPoint::sqrt(dxa / dya + 1);
   }
 #else
+#if USE_FLOAT
+  return sqrtf(dx * dx + dy * dy);
+#else
   return sqrt(dx * dx + dy * dy);
 #endif
+#endif
 }

 #endif


-- 
Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the Poppler-bugs mailing list