Commit e38ffea6 authored by Adrian Johnson's avatar Adrian Johnson

Fix some -Wundef warnings

parent 9bb84057
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
#include <config.h> #include <config.h>
#if USE_FIXEDPOINT #ifdef USE_FIXEDPOINT
#ifdef USE_GCC_PRAGMAS #ifdef USE_GCC_PRAGMAS
#pragma implementation #pragma implementation
......
...@@ -127,7 +127,7 @@ extern XpdfPluginVecTable xpdfPluginVecTable; ...@@ -127,7 +127,7 @@ extern XpdfPluginVecTable xpdfPluginVecTable;
GlobalParams *globalParams = NULL; GlobalParams *globalParams = NULL;
#if ENABLE_RELOCATABLE && defined(_WIN32) #if defined(ENABLE_RELOCATABLE) && defined(_WIN32)
/* search for data relative to where we are installed */ /* search for data relative to where we are installed */
......
...@@ -67,10 +67,10 @@ ...@@ -67,10 +67,10 @@
#include "Catalog.h" #include "Catalog.h"
#include "Page.h" #include "Page.h"
#include "Stream.h" #include "Stream.h"
#if ENABLE_ZLIB #ifdef ENABLE_ZLIB
# include "FlateEncoder.h" # include "FlateEncoder.h"
#endif #endif
#if ENABLE_ZLIB_UNCOMPRESS #ifdef ENABLE_ZLIB_UNCOMPRESS
# include "FlateStream.h" # include "FlateStream.h"
#endif #endif
#include "Annot.h" #include "Annot.h"
...@@ -78,7 +78,7 @@ ...@@ -78,7 +78,7 @@
#include "PreScanOutputDev.h" #include "PreScanOutputDev.h"
#include "FileSpec.h" #include "FileSpec.h"
#include "CharCodeToUnicode.h" #include "CharCodeToUnicode.h"
#if HAVE_SPLASH #ifdef HAVE_SPLASH
# include "splash/Splash.h" # include "splash/Splash.h"
# include "splash/SplashBitmap.h" # include "splash/SplashBitmap.h"
# include "SplashOutputDev.h" # include "SplashOutputDev.h"
...@@ -3282,7 +3282,7 @@ GBool PSOutputDev::checkPageSlice(Page *page, double /*hDPI*/, double /*vDPI*/, ...@@ -3282,7 +3282,7 @@ GBool PSOutputDev::checkPageSlice(Page *page, double /*hDPI*/, double /*vDPI*/,
paperColor[0] = 0xff; paperColor[0] = 0xff;
splashOut = new SplashOutputDev(splashModeMono8, 1, gFalse, splashOut = new SplashOutputDev(splashModeMono8, 1, gFalse,
paperColor, gFalse); paperColor, gFalse);
#if SPLASH_CMYK #ifdef SPLASH_CMYK
} else if (level == psLevel1Sep || level == psLevel2Sep || } else if (level == psLevel1Sep || level == psLevel2Sep ||
level == psLevel3Sep || globalParams->getOverprintPreview()) { level == psLevel3Sep || globalParams->getOverprintPreview()) {
numComps = 4; numComps = 4;
......
This diff is collapsed.
...@@ -404,7 +404,7 @@ private: ...@@ -404,7 +404,7 @@ private:
void setupScreenParams(double hDPI, double vDPI); void setupScreenParams(double hDPI, double vDPI);
SplashPattern *getColor(GfxGray gray); SplashPattern *getColor(GfxGray gray);
SplashPattern *getColor(GfxRGB *rgb); SplashPattern *getColor(GfxRGB *rgb);
#if SPLASH_CMYK #ifdef SPLASH_CMYK
SplashPattern *getColor(GfxCMYK *cmyk); SplashPattern *getColor(GfxCMYK *cmyk);
SplashPattern *getColor(GfxColor *deviceN); SplashPattern *getColor(GfxColor *deviceN);
#endif #endif
......
...@@ -839,7 +839,7 @@ namespace Poppler { ...@@ -839,7 +839,7 @@ namespace Poppler {
} }
bool isOverprintPreviewAvailable() { bool isOverprintPreviewAvailable() {
#if SPLASH_CMYK #ifdef SPLASH_CMYK
return true; return true;
#else #else
return false; return false;
......
...@@ -305,7 +305,7 @@ QImage Page::renderToImage(double xres, double yres, int x, int y, int w, int h, ...@@ -305,7 +305,7 @@ QImage Page::renderToImage(double xres, double yres, int x, int y, int w, int h,
#if defined(HAVE_SPLASH) #if defined(HAVE_SPLASH)
SplashColor bgColor; SplashColor bgColor;
GBool overprintPreview = gFalse; GBool overprintPreview = gFalse;
#if SPLASH_CMYK #ifdef SPLASH_CMYK
overprintPreview = m_page->parentDoc->m_hints & Document::OverprintPreview ? gTrue : gFalse; overprintPreview = m_page->parentDoc->m_hints & Document::OverprintPreview ? gTrue : gFalse;
if (overprintPreview) if (overprintPreview)
{ {
...@@ -338,7 +338,7 @@ QImage Page::renderToImage(double xres, double yres, int x, int y, int w, int h, ...@@ -338,7 +338,7 @@ QImage Page::renderToImage(double xres, double yres, int x, int y, int w, int h,
} }
SplashColorMode colorMode = splashModeXBGR8; SplashColorMode colorMode = splashModeXBGR8;
#if SPLASH_CMYK #ifdef SPLASH_CMYK
if (overprintPreview) colorMode = splashModeDeviceN8; if (overprintPreview) colorMode = splashModeDeviceN8;
#endif #endif
......
...@@ -836,7 +836,7 @@ namespace Poppler { ...@@ -836,7 +836,7 @@ namespace Poppler {
} }
bool isOverprintPreviewAvailable() { bool isOverprintPreviewAvailable() {
#if SPLASH_CMYK #ifdef SPLASH_CMYK
return true; return true;
#else #else
return false; return false;
......
...@@ -307,7 +307,7 @@ QImage Page::renderToImage(double xres, double yres, int x, int y, int w, int h, ...@@ -307,7 +307,7 @@ QImage Page::renderToImage(double xres, double yres, int x, int y, int w, int h,
#if defined(HAVE_SPLASH) #if defined(HAVE_SPLASH)
SplashColor bgColor; SplashColor bgColor;
GBool overprintPreview = gFalse; GBool overprintPreview = gFalse;
#if SPLASH_CMYK #ifdef SPLASH_CMYK
overprintPreview = m_page->parentDoc->m_hints & Document::OverprintPreview ? gTrue : gFalse; overprintPreview = m_page->parentDoc->m_hints & Document::OverprintPreview ? gTrue : gFalse;
if (overprintPreview) if (overprintPreview)
{ {
...@@ -340,7 +340,7 @@ QImage Page::renderToImage(double xres, double yres, int x, int y, int w, int h, ...@@ -340,7 +340,7 @@ QImage Page::renderToImage(double xres, double yres, int x, int y, int w, int h,
} }
SplashColorMode colorMode = splashModeXBGR8; SplashColorMode colorMode = splashModeXBGR8;
#if SPLASH_CMYK #ifdef SPLASH_CMYK
if (overprintPreview) colorMode = splashModeDeviceN8; if (overprintPreview) colorMode = splashModeDeviceN8;
#endif #endif
......
This diff is collapsed.
...@@ -62,7 +62,7 @@ typedef void (*SplashICCTransform)(void *data, SplashBitmap *bitmap); ...@@ -62,7 +62,7 @@ typedef void (*SplashICCTransform)(void *data, SplashBitmap *bitmap);
//------------------------------------------------------------------------ //------------------------------------------------------------------------
enum SplashPipeResultColorCtrl { enum SplashPipeResultColorCtrl {
#if SPLASH_CMYK #ifdef SPLASH_CMYK
splashPipeResultColorNoAlphaBlendCMYK, splashPipeResultColorNoAlphaBlendCMYK,
splashPipeResultColorNoAlphaBlendDeviceN, splashPipeResultColorNoAlphaBlendDeviceN,
#endif #endif
...@@ -70,13 +70,13 @@ enum SplashPipeResultColorCtrl { ...@@ -70,13 +70,13 @@ enum SplashPipeResultColorCtrl {
splashPipeResultColorNoAlphaBlendMono, splashPipeResultColorNoAlphaBlendMono,
splashPipeResultColorAlphaNoBlendMono, splashPipeResultColorAlphaNoBlendMono,
splashPipeResultColorAlphaNoBlendRGB, splashPipeResultColorAlphaNoBlendRGB,
#if SPLASH_CMYK #ifdef SPLASH_CMYK
splashPipeResultColorAlphaNoBlendCMYK, splashPipeResultColorAlphaNoBlendCMYK,
splashPipeResultColorAlphaNoBlendDeviceN, splashPipeResultColorAlphaNoBlendDeviceN,
#endif #endif
splashPipeResultColorAlphaBlendMono, splashPipeResultColorAlphaBlendMono,
splashPipeResultColorAlphaBlendRGB splashPipeResultColorAlphaBlendRGB
#if SPLASH_CMYK #ifdef SPLASH_CMYK
, ,
splashPipeResultColorAlphaBlendCMYK, splashPipeResultColorAlphaBlendCMYK,
splashPipeResultColorAlphaBlendDeviceN splashPipeResultColorAlphaBlendDeviceN
...@@ -298,7 +298,7 @@ private: ...@@ -298,7 +298,7 @@ private:
void pipeRunSimpleRGB8(SplashPipe *pipe); void pipeRunSimpleRGB8(SplashPipe *pipe);
void pipeRunSimpleXBGR8(SplashPipe *pipe); void pipeRunSimpleXBGR8(SplashPipe *pipe);
void pipeRunSimpleBGR8(SplashPipe *pipe); void pipeRunSimpleBGR8(SplashPipe *pipe);
#if SPLASH_CMYK #ifdef SPLASH_CMYK
void pipeRunSimpleCMYK8(SplashPipe *pipe); void pipeRunSimpleCMYK8(SplashPipe *pipe);
void pipeRunSimpleDeviceN8(SplashPipe *pipe); void pipeRunSimpleDeviceN8(SplashPipe *pipe);
#endif #endif
...@@ -307,7 +307,7 @@ private: ...@@ -307,7 +307,7 @@ private:
void pipeRunAARGB8(SplashPipe *pipe); void pipeRunAARGB8(SplashPipe *pipe);
void pipeRunAAXBGR8(SplashPipe *pipe); void pipeRunAAXBGR8(SplashPipe *pipe);
void pipeRunAABGR8(SplashPipe *pipe); void pipeRunAABGR8(SplashPipe *pipe);
#if SPLASH_CMYK #ifdef SPLASH_CMYK
void pipeRunAACMYK8(SplashPipe *pipe); void pipeRunAACMYK8(SplashPipe *pipe);
void pipeRunAADeviceN8(SplashPipe *pipe); void pipeRunAADeviceN8(SplashPipe *pipe);
#endif #endif
......
...@@ -90,7 +90,7 @@ SplashBitmap::SplashBitmap(int widthA, int heightA, int rowPadA, ...@@ -90,7 +90,7 @@ SplashBitmap::SplashBitmap(int widthA, int heightA, int rowPadA,
rowSize = -1; rowSize = -1;
} }
break; break;
#if SPLASH_CMYK #ifdef SPLASH_CMYK
case splashModeCMYK8: case splashModeCMYK8:
if (width > 0 && width <= INT_MAX / 4) { if (width > 0 && width <= INT_MAX / 4) {
rowSize = width * 4; rowSize = width * 4;
...@@ -247,7 +247,7 @@ SplashError SplashBitmap::writePNMFile(FILE *f) { ...@@ -247,7 +247,7 @@ SplashError SplashBitmap::writePNMFile(FILE *f) {
} }
break; break;
#if SPLASH_CMYK #ifdef SPLASH_CMYK
case splashModeCMYK8: case splashModeCMYK8:
case splashModeDeviceN8: case splashModeDeviceN8:
// PNM doesn't support CMYK // PNM doesn't support CMYK
...@@ -308,7 +308,7 @@ void SplashBitmap::getPixel(int x, int y, SplashColorPtr pixel) { ...@@ -308,7 +308,7 @@ void SplashBitmap::getPixel(int x, int y, SplashColorPtr pixel) {
pixel[1] = p[1]; pixel[1] = p[1];
pixel[2] = p[0]; pixel[2] = p[0];
break; break;
#if SPLASH_CMYK #ifdef SPLASH_CMYK
case splashModeCMYK8: case splashModeCMYK8:
p = &data[y * rowSize + 4 * x]; p = &data[y * rowSize + 4 * x];
pixel[0] = p[0]; pixel[0] = p[0];
...@@ -376,7 +376,7 @@ SplashError SplashBitmap::writeImgFile(SplashImageFileFormat format, FILE *f, in ...@@ -376,7 +376,7 @@ SplashError SplashBitmap::writeImgFile(SplashImageFileFormat format, FILE *f, in
#endif #endif
#ifdef ENABLE_LIBJPEG #ifdef ENABLE_LIBJPEG
#if SPLASH_CMYK #ifdef SPLASH_CMYK
case splashFormatJpegCMYK: case splashFormatJpegCMYK:
writer = new JpegWriter(JpegWriter::CMYK); writer = new JpegWriter(JpegWriter::CMYK);
setJpegParams(writer, params); setJpegParams(writer, params);
...@@ -403,7 +403,7 @@ SplashError SplashBitmap::writeImgFile(SplashImageFileFormat format, FILE *f, in ...@@ -403,7 +403,7 @@ SplashError SplashBitmap::writeImgFile(SplashImageFileFormat format, FILE *f, in
case splashModeBGR8: case splashModeBGR8:
writer = new TiffWriter(TiffWriter::RGB); writer = new TiffWriter(TiffWriter::RGB);
break; break;
#if SPLASH_CMYK #ifdef SPLASH_CMYK
case splashModeCMYK8: case splashModeCMYK8:
case splashModeDeviceN8: case splashModeDeviceN8:
writer = new TiffWriter(TiffWriter::CMYK); writer = new TiffWriter(TiffWriter::CMYK);
...@@ -443,7 +443,7 @@ void SplashBitmap::getRGBLine(int yl, SplashColorPtr line) { ...@@ -443,7 +443,7 @@ void SplashBitmap::getRGBLine(int yl, SplashColorPtr line) {
m = byteToDbl(col[1]); m = byteToDbl(col[1]);
y = byteToDbl(col[2]); y = byteToDbl(col[2]);
k = byteToDbl(col[3]); k = byteToDbl(col[3]);
#if SPLASH_CMYK #ifdef SPLASH_CMYK
if (separationList->getLength() > 0) { if (separationList->getLength() > 0) {
for (int i = 0; i < separationList->getLength(); i++) { for (int i = 0; i < separationList->getLength(); i++) {
if (col[i+4] > 0) { if (col[i+4] > 0) {
...@@ -489,7 +489,7 @@ void SplashBitmap::getXBGRLine(int yl, SplashColorPtr line, ConversionMode conve ...@@ -489,7 +489,7 @@ void SplashBitmap::getXBGRLine(int yl, SplashColorPtr line, ConversionMode conve
m = byteToDbl(col[1]); m = byteToDbl(col[1]);
y = byteToDbl(col[2]); y = byteToDbl(col[2]);
k = byteToDbl(col[3]); k = byteToDbl(col[3]);
#if SPLASH_CMYK #ifdef SPLASH_CMYK
if (separationList->getLength() > 0) { if (separationList->getLength() > 0) {
for (int i = 0; i < separationList->getLength(); i++) { for (int i = 0; i < separationList->getLength(); i++) {
if (col[i+4] > 0) { if (col[i+4] > 0) {
...@@ -593,7 +593,7 @@ GBool SplashBitmap::convertToXBGR(ConversionMode conversionMode) { ...@@ -593,7 +593,7 @@ GBool SplashBitmap::convertToXBGR(ConversionMode conversionMode) {
return newdata != NULL; return newdata != NULL;
} }
#if SPLASH_CMYK #ifdef SPLASH_CMYK
void SplashBitmap::getCMYKLine(int yl, SplashColorPtr line) { void SplashBitmap::getCMYKLine(int yl, SplashColorPtr line) {
SplashColor col; SplashColor col;
...@@ -637,7 +637,7 @@ void SplashBitmap::getCMYKLine(int yl, SplashColorPtr line) { ...@@ -637,7 +637,7 @@ void SplashBitmap::getCMYKLine(int yl, SplashColorPtr line) {
SplashError SplashBitmap::writeImgFile(ImgWriter *writer, FILE *f, int hDPI, int vDPI, SplashColorMode imageWriterFormat) { SplashError SplashBitmap::writeImgFile(ImgWriter *writer, FILE *f, int hDPI, int vDPI, SplashColorMode imageWriterFormat) {
if (mode != splashModeRGB8 && mode != splashModeMono8 && mode != splashModeMono1 && mode != splashModeXBGR8 && mode != splashModeBGR8 if (mode != splashModeRGB8 && mode != splashModeMono8 && mode != splashModeMono1 && mode != splashModeXBGR8 && mode != splashModeBGR8
#if SPLASH_CMYK #ifdef SPLASH_CMYK
&& mode != splashModeCMYK8 && mode != splashModeDeviceN8 && mode != splashModeCMYK8 && mode != splashModeDeviceN8
#endif #endif
) { ) {
...@@ -650,7 +650,7 @@ SplashError SplashBitmap::writeImgFile(ImgWriter *writer, FILE *f, int hDPI, int ...@@ -650,7 +650,7 @@ SplashError SplashBitmap::writeImgFile(ImgWriter *writer, FILE *f, int hDPI, int
} }
switch (mode) { switch (mode) {
#if SPLASH_CMYK #ifdef SPLASH_CMYK
case splashModeCMYK8: case splashModeCMYK8:
if (writer->supportCMYK()) { if (writer->supportCMYK()) {
SplashColorPtr row; SplashColorPtr row;
......
...@@ -96,7 +96,7 @@ public: ...@@ -96,7 +96,7 @@ public:
void getPixel(int x, int y, SplashColorPtr pixel); void getPixel(int x, int y, SplashColorPtr pixel);
void getRGBLine(int y, SplashColorPtr line); void getRGBLine(int y, SplashColorPtr line);
void getXBGRLine(int y, SplashColorPtr line, ConversionMode conversionMode = conversionOpaque); void getXBGRLine(int y, SplashColorPtr line, ConversionMode conversionMode = conversionOpaque);
#if SPLASH_CMYK #ifdef SPLASH_CMYK
void getCMYKLine(int y, SplashColorPtr line); void getCMYKLine(int y, SplashColorPtr line);
#endif #endif
Guchar getAlpha(int x, int y); Guchar getAlpha(int x, int y);
......
...@@ -65,7 +65,7 @@ SplashFTFont::SplashFTFont(SplashFTFontFile *fontFileA, SplashCoord *matA, ...@@ -65,7 +65,7 @@ SplashFTFont::SplashFTFont(SplashFTFontFile *fontFileA, SplashCoord *matA,
FT_Face face; FT_Face face;
int div; int div;
int x, y; int x, y;
#if USE_FIXEDPOINT #ifdef USE_FIXEDPOINT
SplashCoord scale; SplashCoord scale;
#endif #endif
...@@ -87,7 +87,7 @@ SplashFTFont::SplashFTFont(SplashFTFontFile *fontFileA, SplashCoord *matA, ...@@ -87,7 +87,7 @@ SplashFTFont::SplashFTFont(SplashFTFontFile *fontFileA, SplashCoord *matA,
div = face->bbox.xMax > 20000 ? 65536 : 1; div = face->bbox.xMax > 20000 ? 65536 : 1;
#if USE_FIXEDPOINT #ifdef USE_FIXEDPOINT
scale = (SplashCoord)1 / (SplashCoord)face->units_per_EM; scale = (SplashCoord)1 / (SplashCoord)face->units_per_EM;
// transform the four corners of the font bounding box -- the min // transform the four corners of the font bounding box -- the min
...@@ -204,7 +204,7 @@ SplashFTFont::SplashFTFont(SplashFTFontFile *fontFileA, SplashCoord *matA, ...@@ -204,7 +204,7 @@ SplashFTFont::SplashFTFont(SplashFTFontFile *fontFileA, SplashCoord *matA,
} }
// compute the transform matrix // compute the transform matrix
#if USE_FIXEDPOINT #ifdef USE_FIXEDPOINT
matrix.xx = (FT_Fixed)((mat[0] / size).get16Dot16()); matrix.xx = (FT_Fixed)((mat[0] / size).get16Dot16());
matrix.yx = (FT_Fixed)((mat[1] / size).get16Dot16()); matrix.yx = (FT_Fixed)((mat[1] / size).get16Dot16());
matrix.xy = (FT_Fixed)((mat[2] / size).get16Dot16()); matrix.xy = (FT_Fixed)((mat[2] / size).get16Dot16());
......
...@@ -54,7 +54,7 @@ public: ...@@ -54,7 +54,7 @@ public:
// Create a font engine. // Create a font engine.
SplashFontEngine( SplashFontEngine(
#if HAVE_T1LIB_H #ifdef HAVE_T1LIB_H
GBool enableT1lib, GBool enableT1lib,
#endif #endif
#if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H #if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H
...@@ -99,7 +99,7 @@ private: ...@@ -99,7 +99,7 @@ private:
SplashFont *fontCache[splashFontCacheSize]; SplashFont *fontCache[splashFontCacheSize];
#if HAVE_T1LIB_H #ifdef HAVE_T1LIB_H
SplashT1FontEngine *t1Engine; SplashT1FontEngine *t1Engine;
#endif #endif
#if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H #if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
#include "poppler-config.h" #include "poppler-config.h"
#if USE_FIXEDPOINT #ifdef USE_FIXEDPOINT
#include "goo/FixedPoint.h" #include "goo/FixedPoint.h"
#else #else
#include <math.h> #include <math.h>
...@@ -31,9 +31,9 @@ ...@@ -31,9 +31,9 @@
#include "SplashTypes.h" #include "SplashTypes.h"
static inline SplashCoord splashAbs(SplashCoord x) { static inline SplashCoord splashAbs(SplashCoord x) {
#if USE_FIXEDPOINT #if defined(USE_FIXEDPOINT)
return FixedPoint::abs(x); return FixedPoint::abs(x);
#elif USE_FLOAT #elif defined(USE_FLOAT)
return fabsf(x); return fabsf(x);
#else #else
return fabs(x); return fabs(x);
...@@ -41,11 +41,11 @@ static inline SplashCoord splashAbs(SplashCoord x) { ...@@ -41,11 +41,11 @@ static inline SplashCoord splashAbs(SplashCoord x) {
} }
static inline int splashFloor(SplashCoord x) { static inline int splashFloor(SplashCoord x) {
#if USE_FIXEDPOINT #if defined(USE_FIXEDPOINT)
return FixedPoint::floor(x); return FixedPoint::floor(x);
#elif USE_FLOAT #elif defined(USE_FLOAT)
return (int)floorf(x); return (int)floorf(x);
#elif __GNUC__ && __i386__ #elif defined(__GNUC__) && defined(__i386__)
// floor() and (int)() are implemented separately, which results // floor() and (int)() are implemented separately, which results
// in changing the FPCW multiple times - so we optimize it with // in changing the FPCW multiple times - so we optimize it with
// some inline assembly // some inline assembly
...@@ -64,7 +64,7 @@ static inline int splashFloor(SplashCoord x) { ...@@ -64,7 +64,7 @@ static inline int splashFloor(SplashCoord x) {
: "=m" (oldCW), "=m" (newCW), "=m" (result), "=r" (t) : "=m" (oldCW), "=m" (newCW), "=m" (result), "=r" (t)
: "m" (x)); : "m" (x));
return result; return result;
#elif defined(WIN32) && defined(_M_IX86) #elif defined(WIN32) && defined(_M_IX86)
// floor() and (int)() are implemented separately, which results // floor() and (int)() are implemented separately, which results
// in changing the FPCW multiple times - so we optimize it with // in changing the FPCW multiple times - so we optimize it with
// some inline assembly // some inline assembly
...@@ -81,18 +81,18 @@ static inline int splashFloor(SplashCoord x) { ...@@ -81,18 +81,18 @@ static inline int splashFloor(SplashCoord x) {
__asm fistp DWORD PTR result __asm fistp DWORD PTR result
__asm fldcw WORD PTR oldCW __asm fldcw WORD PTR oldCW
return result; return result;
#else #else
if (x > 0) return (int)x; if (x > 0) return (int)x;
else return (int)floor(x); else return (int)floor(x);
#endif #endif
} }
static inline int splashCeil(SplashCoord x) { static inline int splashCeil(SplashCoord x) {
#if USE_FIXEDPOINT #if defined(USE_FIXEDPOINT)
return FixedPoint::ceil(x); return FixedPoint::ceil(x);
#elif USE_FLOAT #elif defined(USE_FLOAT)
return (int)ceilf(x); return (int)ceilf(x);
#elif __GNUC__ && __i386__ #elif defined(__GNUC__) && defined(__i386__)
// ceil() and (int)() are implemented separately, which results // ceil() and (int)() are implemented separately, which results
// in changing the FPCW multiple times - so we optimize it with // in changing the FPCW multiple times - so we optimize it with
// some inline assembly // some inline assembly
...@@ -134,9 +134,9 @@ static inline int splashCeil(SplashCoord x) { ...@@ -134,9 +134,9 @@ static inline int splashCeil(SplashCoord x) {
} }
static inline int splashRound(SplashCoord x) { static inline int splashRound(SplashCoord x) {
#if USE_FIXEDPOINT #if defined(USE_FIXEDPOINT)
return FixedPoint::round(x); return FixedPoint::round(x);
#elif __GNUC__ && __i386__ #elif defined(__GNUC__) && defined(__i386__)
// this could use round-to-nearest mode and avoid the "+0.5", // this could use round-to-nearest mode and avoid the "+0.5",
// but that produces slightly different results (because i+0.5 // but that produces slightly different results (because i+0.5
// sometimes rounds up and sometimes down using the even rule) // sometimes rounds up and sometimes down using the even rule)
...@@ -180,7 +180,7 @@ static inline int splashRound(SplashCoord x) { ...@@ -180,7 +180,7 @@ static inline int splashRound(SplashCoord x) {
} }
static inline SplashCoord splashAvg(SplashCoord x, SplashCoord y) { static inline SplashCoord splashAvg(SplashCoord x, SplashCoord y) {
#if USE_FIXEDPOINT #ifdef USE_FIXEDPOINT
return FixedPoint::avg(x, y); return FixedPoint::avg(x, y);
#else #else
return 0.5 * (x + y); return 0.5 * (x + y);
...@@ -188,9 +188,9 @@ static inline SplashCoord splashAvg(SplashCoord x, SplashCoord y) { ...@@ -188,9 +188,9 @@ static inline SplashCoord splashAvg(SplashCoord x, SplashCoord y) {
} }
static inline SplashCoord splashSqrt(SplashCoord x) { static inline SplashCoord splashSqrt(SplashCoord x) {
#if USE_FIXEDPOINT #if defined(USE_FIXEDPOINT)
return FixedPoint::sqrt(x); return FixedPoint::sqrt(x);
#elif USE_FLOAT #elif defined(USE_FLOAT)
return sqrtf(x); return sqrtf(x);
#else #else
return sqrt(x); return sqrt(x);
...@@ -198,9 +198,9 @@ static inline SplashCoord splashSqrt(SplashCoord x) { ...@@ -198,9 +198,9 @@ static inline SplashCoord splashSqrt(SplashCoord x) {
} }
static inline SplashCoord splashPow(SplashCoord x, SplashCoord y) { static inline SplashCoord splashPow(SplashCoord x, SplashCoord y) {
#if USE_FIXEDPOINT #if defined(USE_FIXEDPOINT)
return FixedPoint::pow(x, y); return FixedPoint::pow(x, y);
#elif USE_FLOAT #elif defined(USE_FLOAT)
return powf(x, y); return powf(x, y);
#else #else
return pow(x, y); return pow(x, y);
...@@ -212,7 +212,7 @@ static inline SplashCoord splashDist(SplashCoord x0, SplashCoord y0, ...@@ -212,7 +212,7 @@ static inline SplashCoord splashDist(SplashCoord x0, SplashCoord y0,
SplashCoord dx, dy; SplashCoord dx, dy;
dx = x1 - x0; dx = x1 - x0;
dy = y1 - y0; dy = y1 - y0;
#if USE_FIXEDPOINT #ifdef USE_FIXEDPOINT
// this handles the situation where dx*dx or dy*dy is too large to // this handles the situation where dx*dx or dy*dy is too large to
// fit in the 16.16 fixed point format // fit in the 16.16 fixed point format
SplashCoord dxa, dya, d; SplashCoord dxa, dya, d;
...@@ -235,7 +235,7 @@ static inline SplashCoord splashDist(SplashCoord x0, SplashCoord y0, ...@@ -235,7 +235,7 @@ static inline SplashCoord splashDist(SplashCoord x0, SplashCoord y0,
static inline GBool splashCheckDet(SplashCoord m11, SplashCoord m12, static inline GBool splashCheckDet(SplashCoord m11, SplashCoord m12,
SplashCoord m21, SplashCoord m22, SplashCoord m21, SplashCoord m22,
SplashCoord epsilon) { SplashCoord epsilon) {
#if USE_FIXEDPOINT #ifdef USE_FIXEDPOINT
return FixedPoint::checkDet(m11, m12, m21, m22, epsilon); return FixedPoint::checkDet(m11, m12, m21, m22, epsilon);
#else #else
return fabs(m11 * m22 - m12 * m21) >= epsilon; return fabs(m11 * m22 - m12 * m21) >= epsilon;
......
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
// number of components in each color mode // number of components in each color mode
int splashColorModeNComps[] = { int splashColorModeNComps[] = {
1, 1, 3, 3, 4 1, 1, 3, 3, 4
#if SPLASH_CMYK #ifdef SPLASH_CMYK
, 4, 4 + SPOT_NCOMPS , 4, 4 + SPOT_NCOMPS
#endif #endif
}; };
...@@ -83,7 +83,7 @@ SplashState::SplashState(int width, int height, GBool vectorAntialias, ...@@ -83,7 +83,7 @@ SplashState::SplashState(int width, int height, GBool vectorAntialias,
rgbTransferG[i] = (Guchar)i; rgbTransferG[i] = (Guchar)i;
rgbTransferB[i] = (Guchar)i; rgbTransferB[i] = (Guchar)i;
grayTransfer[i] = (Guchar)i; grayTransfer[i] = (Guchar)i;
#if SPLASH_CMYK #ifdef SPLASH_CMYK
cmykTransferC[i] = (Guchar)i; cmykTransferC[i] = (Guchar)i;
cmykTransferM[i] = (Guchar)i; cmykTransferM[i] = (Guchar)i;
cmykTransferY[i] = (Guchar)i; cmykTransferY[i] = (Guchar)i;
...@@ -136,7 +136,7 @@ SplashState::SplashState(int width, int height, GBool vectorAntialias, ...@@ -136,7 +136,7 @@ SplashState::SplashState(int width, int height, GBool vectorAntialias,
rgbTransferG[i] = (Guchar)i; rgbTransferG[i] = (Guchar)i;
rgbTransferB[i] = (Guchar)i; rgbTransferB[i] = (Guchar)i;
grayTransfer[i] = (Guchar)i; grayTransfer[i] = (Guchar)i;
#if SPLASH_CMYK #ifdef SPLASH_CMYK
cmykTransferC[i] = (Guchar)i; cmykTransferC[i] = (Guchar)i;
cmykTransferM[i] = (Guchar)i; cmykTransferM[i] = (Guchar)i;
cmykTransferY[i] = (Guchar)i; cmykTransferY[i] = (Guchar)i;
...@@ -187,7 +187,7 @@ SplashState::SplashState(SplashState *state) { ...@@ -187,7 +187,7 @@ SplashState::SplashState(SplashState *state) {
memcpy(rgbTransferG, state->rgbTransferG, 256); memcpy(rgbTransferG, state->rgbTransferG, 256);
memcpy(rgbTransferB, state->rgbTransferB, 256); memcpy(rgbTransferB, state->rgbTransferB, 256);
memcpy(grayTransfer, state->grayTransfer, 256); memcpy(grayTransfer, state->grayTransfer, 256);
#if SPLASH_CMYK #ifdef SPLASH_CMYK
memcpy(cmykTransferC, state->cmykTransferC, 256); memcpy(cmykTransferC, state->cmykTransferC, 256);
memcpy(cmykTransferM, state->cmykTransferM, 256); memcpy(cmykTransferM, state->cmykTransferM, 256);
memcpy(cmykTransferY, state->cmykTransferY, 256); memcpy(cmykTransferY, state->cmykTransferY, 256);
...@@ -249,7 +249,7 @@ void SplashState::setSoftMask(SplashBitmap *softMaskA) { ...@@ -249,7 +249,7 @@ void SplashState::setSoftMask(SplashBitmap *softMaskA) {
void SplashState::setTransfer(Guchar *red, Guchar *green, Guchar *blue, void SplashState::setTransfer(Guchar *red, Guchar *green, Guchar *blue,
Guchar *gray) { Guchar *gray) {
#if SPLASH_CMYK #ifdef SPLASH_CMYK
int i; int i;
for (i = 0; i < 256; ++i) { for (i = 0; i < 256; ++i) {
......
...@@ -124,7 +124,7 @@ private: ...@@ -124,7 +124,7 @@ private:
rgbTransferG[256], rgbTransferG[256],
rgbTransferB[256]; rgbTransferB[256];
Guchar grayTransfer[256]; Guchar grayTransfer[256];
#if SPLASH_CMYK #ifdef SPLASH_CMYK
Guchar cmykTransferC[256], Guchar cmykTransferC[256],
cmykTransferM[256], cmykTransferM[256],
cmykTransferY[256], cmykTransferY[256],
......
...@@ -31,10 +31,10 @@ ...@@ -31,10 +31,10 @@
// coordinates // coordinates
//------------------------------------------------------------------------ //------------------------------------------------------------------------
#if USE_FIXEDPOINT #if defined(USE_FIXEDPOINT)
#include "goo/FixedPoint.h" #include "goo/FixedPoint.h"
typedef FixedPoint SplashCoord; typedef FixedPoint SplashCoord;
#elif USE_FLOAT #elif defined(USE_FLOAT)
typedef float SplashCoord; typedef float SplashCoord;
#else #else
typedef double SplashCoord; typedef double SplashCoord;
...@@ -64,7 +64,7 @@ enum SplashColorMode { ...@@ -64,7 +64,7 @@ enum SplashColorMode {
// BGRBGR... // BGRBGR...