[poppler] configure.ac splash/SplashMath.h utils/pdftoppm.cc

Albert Astals Cid aacid at kemper.freedesktop.org
Tue Nov 17 11:48:41 PST 2009


 configure.ac        |   60 ++++++++++++++++++++++++++--------------------------
 splash/SplashMath.h |    5 +---
 utils/pdftoppm.cc   |    8 ------
 3 files changed, 33 insertions(+), 40 deletions(-)

New commits:
commit 46380d36f004d71dd2c2e7bc82836af248684b51
Author: Albert Astals Cid <aacid at kde.org>
Date:   Tue Nov 17 20:48:22 2009 +0100

    i didn't want to commit this

diff --git a/configure.ac b/configure.ac
index 8cd5781..0ff2c59 100644
--- a/configure.ac
+++ b/configure.ac
@@ -109,35 +109,6 @@ fi
 dnl ##### Checks for library functions.
 AC_CHECK_FUNCS(popen mkstemp mkstemps)
 
-dnl Test for libopenjpeg
-AC_ARG_ENABLE(libopenjpeg,
-	      AC_HELP_STRING([--disable-libopenjpeg],
-	                     [Don't build against libopenjpeg.]),
-              enable_libopenjpeg=$enableval,
-              enable_libopenjpeg="try")
-if test x$enable_libopenjpeg = xyes; then
-  AC_CHECK_LIB([openjpeg], [opj_cio_open],,
-	       AC_MSG_ERROR("*** libopenjpeg library not found ***"))
-  AC_CHECK_HEADERS([openjpeg.h],,
-		   AC_MSG_ERROR("*** libopenjpeg headers not found ***"))
-elif test x$enable_libopenjpeg = xtry; then
-  AC_CHECK_LIB([openjpeg], [opj_cio_open],
-               [enable_libopenjpeg="yes"],
-	       [enable_libopenjpeg="no"])
-  AC_CHECK_HEADERS([openjpeg.h],,
-		   [enable_libopenjpeg="no"])
-fi
-
-if test x$enable_libopenjpeg = xyes; then
-  LIBOPENJPEG_LIBS="-lopenjpeg"
-  AC_SUBST(LIBOPENJPEG_LIBS)
-  AC_DEFINE(ENABLE_LIBOPENJPEG)
-fi
-
-AM_CONDITIONAL(BUILD_LIBOPENJPEG, test x$enable_libopenjpeg = xyes)
-AH_TEMPLATE([ENABLE_LIBOPENJPEG],
-	    [Use libopenjpeg instead of builtin jpeg2000 decoder.])
-
 dnl ##### Back to C for the library tests.
 AC_LANG_C
 
@@ -179,6 +150,37 @@ AH_TEMPLATE([ENABLE_ZLIB],
 	    [Use zlib instead of builtin zlib decoder.])
 
 
+dnl Test for libopenjpeg
+AC_ARG_ENABLE(libopenjpeg,
+	      AC_HELP_STRING([--disable-libopenjpeg],
+	                     [Don't build against libopenjpeg.]),
+              enable_libopenjpeg=$enableval,
+              enable_libopenjpeg="try")
+if test x$enable_libopenjpeg = xyes; then
+  AC_CHECK_LIB([openjpeg], [opj_cio_open],,
+	       AC_MSG_ERROR("*** libopenjpeg library not found ***"))
+  AC_CHECK_HEADERS([openjpeg.h],,
+		   AC_MSG_ERROR("*** libopenjpeg headers not found ***"))
+elif test x$enable_libopenjpeg = xtry; then
+  AC_CHECK_LIB([openjpeg], [opj_cio_open],
+               [enable_libopenjpeg="yes"],
+	       [enable_libopenjpeg="no"])
+  AC_CHECK_HEADERS([openjpeg.h],,
+		   [enable_libopenjpeg="no"])
+fi
+
+if test x$enable_libopenjpeg = xyes; then
+  LIBOPENJPEG_LIBS="-lopenjpeg"
+  AC_SUBST(LIBOPENJPEG_LIBS)
+  AC_DEFINE(ENABLE_LIBOPENJPEG)
+fi
+
+AM_CONDITIONAL(BUILD_LIBOPENJPEG, test x$enable_libopenjpeg = xyes)
+AH_TEMPLATE([ENABLE_LIBOPENJPEG],
+	    [Use libopenjpeg instead of builtin jpeg2000 decoder.])
+
+
+
 dnl Test for libjpeg
 AC_ARG_ENABLE(libjpeg,
 	      AC_HELP_STRING([--disable-libjpeg],
diff --git a/splash/SplashMath.h b/splash/SplashMath.h
index 3b72f74..7a8c8e3 100644
--- a/splash/SplashMath.h
+++ b/splash/SplashMath.h
@@ -26,8 +26,7 @@ static inline int splashFloor(SplashCoord x) {
   #if USE_FIXEDPOINT
     return FixedPoint::floor(x);
   #else
-    if (x > 0) return (int)x;
-    else return (int)floor(x);
+    return (int)floor(x);
   #endif
 }
 
@@ -43,7 +42,7 @@ static inline int splashRound(SplashCoord x) {
 #if USE_FIXEDPOINT
   return FixedPoint::round(x);
 #else
-  return (int)splashFloor(x + 0.5);
+  return (int)floor(x + 0.5);
 #endif
 }
 
diff --git a/utils/pdftoppm.cc b/utils/pdftoppm.cc
index 4ebf4db..e27aa44 100644
--- a/utils/pdftoppm.cc
+++ b/utils/pdftoppm.cc
@@ -42,8 +42,6 @@
 
 static int firstPage = 1;
 static int lastPage = 0;
-static GBool printOnlyOdd = gFalse;
-static GBool printOnlyEven = gFalse;
 static double resolution = 0.0;
 static double x_resolution = 150.0;
 static double y_resolution = 150.0;
@@ -74,10 +72,6 @@ static const ArgDesc argDesc[] = {
    "first page to print"},
   {"-l",      argInt,      &lastPage,      0,
    "last page to print"},
-  {"-o",      argFlag,      &printOnlyOdd, 0,
-   "print only odd pages"},
-  {"-e",      argFlag,      &printOnlyEven, 0,
-   "print only even pages"},
 
   {"-r",      argFP,       &resolution,    0,
    "resolution, in DPI (default is 150)"},
@@ -290,8 +284,6 @@ int main(int argc, char *argv[]) {
   if (sz != 0) w = h = sz;
   pg_num_len = (int)ceil(log((double)doc->getNumPages()) / log((double)10));
   for (pg = firstPage; pg <= lastPage; ++pg) {
-    if (printOnlyEven && pg % 2 == 0) continue;
-    if (printOnlyOdd && pg % 2 == 1) continue;
     if (useCropBox) {
       pg_w = doc->getPageCropWidth(pg);
       pg_h = doc->getPageCropHeight(pg);


More information about the poppler mailing list