summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2018-09-20 12:05:26 +0100
committerRobin Watts <robin.watts@artifex.com>2018-09-20 12:24:17 +0100
commit14f0dd1c64500c1cf12dcb47d14620afa3416d9f (patch)
treeeec9685f2a91259e71bb4f1da1236af301b72663
parent94d6166428a679baa5a34fc5faa18a2aa26cee4a (diff)
downloadmupdf-14f0dd1c64500c1cf12dcb47d14620afa3416d9f.tar.xz
Be consistent in use of #if FZ_ENABLE_...
Using #ifdef FZ_ENABLE_ means we build code in, even if we have defined FZ_ENABLE_WHATEVER to be 0 (as we do in config.h).
-rw-r--r--include/mupdf/fitz/config.h2
-rw-r--r--platform/java/mupdf_native.c4
-rw-r--r--source/fitz/document.c6
-rw-r--r--source/fitz/draw-affine.c26
-rw-r--r--source/fitz/draw-device.c2
-rw-r--r--source/fitz/draw-paint.c14
-rw-r--r--source/tools/mudraw.c4
7 files changed, 29 insertions, 29 deletions
diff --git a/include/mupdf/fitz/config.h b/include/mupdf/fitz/config.h
index de2cba82..e5a19ed4 100644
--- a/include/mupdf/fitz/config.h
+++ b/include/mupdf/fitz/config.h
@@ -6,7 +6,7 @@
Enable the following for spot (and hence overprint/overprint
simulation) capable rendering. This forces FZ_PLOTTERS_N on.
*/
-#define FZ_ENABLE_SPOT_RENDERING
+#define FZ_ENABLE_SPOT_RENDERING 1
/*
Choose which plotters we need.
diff --git a/platform/java/mupdf_native.c b/platform/java/mupdf_native.c
index 9335fa6b..6d86e425 100644
--- a/platform/java/mupdf_native.c
+++ b/platform/java/mupdf_native.c
@@ -1203,7 +1203,7 @@ FUN(Context_initNative)(JNIEnv *env, jclass cls)
JNIEXPORT jint JNICALL
FUN(Context_gprfSupportedNative)(JNIEnv * env, jclass class)
{
-#ifdef FZ_ENABLE_GPRF
+#if FZ_ENABLE_GPRF
return JNI_TRUE;
#else
return JNI_FALSE;
@@ -4910,7 +4910,7 @@ static char *make_tmp_gproof_path(const char *path)
JNIEXPORT jstring JNICALL
FUN(Document_proofNative)(JNIEnv *env, jobject self, jstring jCurrentPath, jstring jPrintProfile, jstring jDisplayProfile, jint inResolution)
{
-#ifdef FZ_ENABLE_GPRF
+#if FZ_ENABLE_GPRF
fz_context *ctx = get_context(env);
fz_document *doc = from_Document(env, self);
char *tmp;
diff --git a/source/fitz/document.c b/source/fitz/document.c
index d234dc3b..594437b3 100644
--- a/source/fitz/document.c
+++ b/source/fitz/document.c
@@ -124,7 +124,7 @@ fz_recognize_document(fz_context *ctx, const char *magic)
return dc->handler[best_i];
}
-#ifdef FZ_ENABLE_PDF
+#if FZ_ENABLE_PDF
extern fz_document_handler pdf_document_handler;
#endif
@@ -138,7 +138,7 @@ fz_open_document_with_stream(fz_context *ctx, const char *magic, fz_stream *stre
handler = fz_recognize_document(ctx, magic);
if (!handler)
-#ifdef FZ_ENABLE_PDF
+#if FZ_ENABLE_PDF
handler = &pdf_document_handler;
#else
fz_throw(ctx, FZ_ERROR_GENERIC, "cannot find document handler for file type: %s", magic);
@@ -159,7 +159,7 @@ fz_open_document(fz_context *ctx, const char *filename)
handler = fz_recognize_document(ctx, filename);
if (!handler)
-#ifdef FZ_ENABLE_PDF
+#if FZ_ENABLE_PDF
handler = &pdf_document_handler;
#else
fz_throw(ctx, FZ_ERROR_GENERIC, "cannot find document handler for file: %s", filename);
diff --git a/source/fitz/draw-affine.c b/source/fitz/draw-affine.c
index dc64c481..8b4690a3 100644
--- a/source/fitz/draw-affine.c
+++ b/source/fitz/draw-affine.c
@@ -1455,7 +1455,7 @@ paint_affine_lerp_alpha_N(byte * FZ_RESTRICT dp, int da, const byte * FZ_RESTRIC
}
#endif /* FZ_PLOTTERS_N */
-#ifdef FZ_ENABLE_SPOT_RENDERING
+#if FZ_ENABLE_SPOT_RENDERING
static void
paint_affine_lerp_N_op(byte * FZ_RESTRICT dp, int da, const byte * FZ_RESTRICT sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * FZ_RESTRICT color, byte * FZ_RESTRICT hp, byte * FZ_RESTRICT gp, const fz_overprint * FZ_RESTRICT eop)
{
@@ -1474,7 +1474,7 @@ paint_affine_lerp_alpha_N_op(byte * FZ_RESTRICT dp, int da, const byte * FZ_REST
static paintfn_t *
fz_paint_affine_lerp(int da, int sa, int fa, int fb, int n, int alpha, const fz_overprint * FZ_RESTRICT eop)
{
-#ifdef FZ_ENABLE_SPOT_RENDERING
+#if FZ_ENABLE_SPOT_RENDERING
if (fz_overprint_required(eop))
{
if (alpha == 255)
@@ -1672,7 +1672,7 @@ fallback:
return NULL;
}
-#ifdef FZ_ENABLE_SPOT_RENDERING
+#if FZ_ENABLE_SPOT_RENDERING
static paintfn_t *
fz_paint_affine_lerp_spots(int da, int sa, int fa, int fb, int dn, int sn, int alpha, const fz_overprint * FZ_RESTRICT eop)
{
@@ -2584,7 +2584,7 @@ paint_affine_near_alpha_N(byte * FZ_RESTRICT dp, int da, const byte * FZ_RESTRIC
}
#endif /* FZ_PLOTTERS_N */
-#ifdef FZ_ENABLE_SPOT_RENDERING
+#if FZ_ENABLE_SPOT_RENDERING
static void
paint_affine_near_N_op(byte * FZ_RESTRICT dp, int da, const byte * FZ_RESTRICT sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * FZ_RESTRICT color, byte * FZ_RESTRICT hp, byte * FZ_RESTRICT gp, const fz_overprint * FZ_RESTRICT eop)
{
@@ -2603,7 +2603,7 @@ paint_affine_near_alpha_N_op(byte * FZ_RESTRICT dp, int da, const byte * FZ_REST
static paintfn_t *
fz_paint_affine_near(int da, int sa, int fa, int fb, int n, int alpha, const fz_overprint * FZ_RESTRICT eop)
{
-#ifdef FZ_ENABLE_SPOT_RENDERING
+#if FZ_ENABLE_SPOT_RENDERING
if (fz_overprint_required(eop))
{
if (alpha == 255)
@@ -3052,7 +3052,7 @@ fallback:
return NULL;
}
-#ifdef FZ_ENABLE_SPOT_RENDERING
+#if FZ_ENABLE_SPOT_RENDERING
static paintfn_t *
fz_paint_affine_near_spots(int da, int sa, int fa, int fb, int dn, int sn, int alpha, const fz_overprint * FZ_RESTRICT eop)
{
@@ -3506,7 +3506,7 @@ paint_affine_color_lerp_N(byte * FZ_RESTRICT dp, int da, const byte * FZ_RESTRIC
}
#endif /* FZ_PLOTTERS_N */
-#ifdef FZ_ENABLE_SPOT_RENDERING
+#if FZ_ENABLE_SPOT_RENDERING
static void
paint_affine_color_lerp_N_op(byte * FZ_RESTRICT dp, int da, const byte * FZ_RESTRICT sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * FZ_RESTRICT color, byte * FZ_RESTRICT hp, byte * FZ_RESTRICT gp, const fz_overprint * FZ_RESTRICT eop)
{
@@ -3518,7 +3518,7 @@ paint_affine_color_lerp_N_op(byte * FZ_RESTRICT dp, int da, const byte * FZ_REST
static paintfn_t *
fz_paint_affine_color_lerp(int da, int sa, int fa, int fb, int n, int alpha, const fz_overprint * FZ_RESTRICT eop)
{
-#ifdef FZ_ENABLE_SPOT_RENDERING
+#if FZ_ENABLE_SPOT_RENDERING
if (fz_overprint_required(eop))
return paint_affine_color_lerp_N_op;
#endif /* FZ_ENABLE_SPOT_RENDERING */
@@ -3541,7 +3541,7 @@ fz_paint_affine_color_lerp(int da, int sa, int fa, int fb, int n, int alpha, con
return NULL;
}
-#ifdef FZ_ENABLE_SPOT_RENDERING
+#if FZ_ENABLE_SPOT_RENDERING
static paintfn_t *
fz_paint_affine_color_lerp_spots(int da, int sa, int fa, int fb, int dn, int sn, int alpha, const fz_overprint * FZ_RESTRICT eop)
{
@@ -3622,7 +3622,7 @@ paint_affine_color_near_N(byte * FZ_RESTRICT dp, int da, const byte * FZ_RESTRIC
}
#endif /* FZ_PLOTTERS_N */
-#ifdef FZ_ENABLE_SPOT_RENDERING
+#if FZ_ENABLE_SPOT_RENDERING
static void
paint_affine_color_near_da_N_op(byte * FZ_RESTRICT dp, int da, const byte * FZ_RESTRICT sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * FZ_RESTRICT color, byte * FZ_RESTRICT hp, byte * FZ_RESTRICT gp, const fz_overprint * FZ_RESTRICT eop)
{
@@ -3641,7 +3641,7 @@ paint_affine_color_near_N_op(byte * FZ_RESTRICT dp, int da, const byte * FZ_REST
static paintfn_t *
fz_paint_affine_color_near(int da, int sa, int fa, int fb, int n, int alpha, const fz_overprint * FZ_RESTRICT eop)
{
-#ifdef FZ_ENABLE_SPOT_RENDERING
+#if FZ_ENABLE_SPOT_RENDERING
if (fz_overprint_required(eop))
return da ? paint_affine_color_near_da_N_op : paint_affine_color_near_N_op;
#endif /* FZ_ENABLE_SPOT_RENDERING */
@@ -3665,7 +3665,7 @@ fz_paint_affine_color_near(int da, int sa, int fa, int fb, int n, int alpha, con
}
}
-#ifdef FZ_ENABLE_SPOT_RENDERING
+#if FZ_ENABLE_SPOT_RENDERING
static paintfn_t *
fz_paint_affine_color_near_spots(int da, int sa, int fa, int fb, int dn, int sn, int alpha, const fz_overprint * FZ_RESTRICT eop)
{
@@ -4000,7 +4000,7 @@ fz_paint_image_imp(fz_pixmap *dst, const fz_irect *scissor, fz_pixmap *shape, fz
}
else
#endif /* FZ_PLOTTERS_RGB */
-#ifdef FZ_ENABLE_SPOT_RENDERING
+#if FZ_ENABLE_SPOT_RENDERING
if (sn != dn)
{
if (dolerp)
diff --git a/source/fitz/draw-device.c b/source/fitz/draw-device.c
index 92c9e5cd..4f3abd5b 100644
--- a/source/fitz/draw-device.c
+++ b/source/fitz/draw-device.c
@@ -3059,7 +3059,7 @@ new_draw_device(fz_context *ctx, fz_matrix transform, fz_pixmap *dest, const fz_
* to trigger on later.
*/
if (dest->seps || dev->proof_cs != NULL)
-#ifdef FZ_ENABLE_SPOT_RENDERING
+#if FZ_ENABLE_SPOT_RENDERING
dev->resolve_spots = 1;
#else
fz_throw(ctx, FZ_ERROR_GENERIC, "Spot rendering (and overprint/overprint simulation) not available in this build");
diff --git a/source/fitz/draw-paint.c b/source/fitz/draw-paint.c
index c437fa52..cf1af820 100644
--- a/source/fitz/draw-paint.c
+++ b/source/fitz/draw-paint.c
@@ -571,7 +571,7 @@ static void paint_solid_color_N_da_op(byte * FZ_RESTRICT dp, int n, int w, const
fz_solid_color_painter_t *
fz_get_solid_color_painter(int n, const byte * FZ_RESTRICT color, int da, const fz_overprint * FZ_RESTRICT eop)
{
-#ifdef FZ_ENABLE_SPOT_RENDERING
+#if FZ_ENABLE_SPOT_RENDERING
if (fz_overprint_required(eop))
{
if (da)
@@ -1014,7 +1014,7 @@ paint_span_with_color_N_da_op(byte * FZ_RESTRICT dp, const byte * FZ_RESTRICT mp
fz_span_color_painter_t *
fz_get_span_color_painter(int n, int da, const byte * FZ_RESTRICT color, const fz_overprint * FZ_RESTRICT eop)
{
-#ifdef FZ_ENABLE_SPOT_RENDERING
+#if FZ_ENABLE_SPOT_RENDERING
if (fz_overprint_required(eop))
{
return da ? paint_span_with_color_N_da_op : paint_span_with_color_N_op;
@@ -1976,7 +1976,7 @@ paint_span_N_alpha(byte * FZ_RESTRICT dp, int da, const byte * FZ_RESTRICT sp, i
}
#endif /* FZ_PLOTTERS_N */
-#ifdef FZ_ENABLE_SPOT_RENDERING
+#if FZ_ENABLE_SPOT_RENDERING
static void
paint_span_N_general_op(byte * FZ_RESTRICT dp, int da, const byte * FZ_RESTRICT sp, int sa, int n, int w, int alpha, const fz_overprint * FZ_RESTRICT eop)
{
@@ -1995,7 +1995,7 @@ paint_span_N_general_alpha_op(byte * FZ_RESTRICT dp, int da, const byte * FZ_RES
fz_span_painter_t *
fz_get_span_painter(int da, int sa, int n, int alpha, const fz_overprint * FZ_RESTRICT eop)
{
-#ifdef FZ_ENABLE_SPOT_RENDERING
+#if FZ_ENABLE_SPOT_RENDERING
if (fz_overprint_required(eop))
{
if (alpha == 255)
@@ -2620,7 +2620,7 @@ intermediate_run:
#include "paint-glyph.h"
#endif /* FZ_PLOTTERS_N */
-#ifdef FZ_ENABLE_SPOT_RENDERING
+#if FZ_ENABLE_SPOT_RENDERING
#define ALPHA
#define EOP
#include "paint-glyph.h"
@@ -2641,7 +2641,7 @@ intermediate_run:
static inline void
fz_paint_glyph_alpha(const unsigned char * FZ_RESTRICT colorbv, int n, int span, unsigned char * FZ_RESTRICT dp, int da, const fz_glyph *glyph, int w, int h, int skip_x, int skip_y, const fz_overprint * FZ_RESTRICT eop)
{
-#ifdef FZ_ENABLE_SPOT_RENDERING
+#if FZ_ENABLE_SPOT_RENDERING
if (fz_overprint_required(eop))
{
if (da)
@@ -2698,7 +2698,7 @@ fallback:{}
static inline void
fz_paint_glyph_solid(const unsigned char * FZ_RESTRICT colorbv, int n, int span, unsigned char * FZ_RESTRICT dp, int da, const fz_glyph * FZ_RESTRICT glyph, int w, int h, int skip_x, int skip_y, const fz_overprint * FZ_RESTRICT eop)
{
-#ifdef FZ_ENABLE_SPOT_RENDERING
+#if FZ_ENABLE_SPOT_RENDERING
if (fz_overprint_required(eop))
{
if (da)
diff --git a/source/tools/mudraw.c b/source/tools/mudraw.c
index 6ca08d01..ba259e49 100644
--- a/source/tools/mudraw.c
+++ b/source/tools/mudraw.c
@@ -262,7 +262,7 @@ static int lowmemory = 0;
static int errored = 0;
static fz_colorspace *colorspace;
static fz_colorspace *oi = NULL;
-#ifdef FZ_ENABLE_SPOT_RENDERING
+#if FZ_ENABLE_SPOT_RENDERING
static int spots = SPOTS_OVERPRINT_SIM;
#else
static int spots = SPOTS_NONE;
@@ -363,7 +363,7 @@ static void usage(void)
#endif
"\t-N\tdisable ICC workflow (\"N\"o color management)\n"
"\t-O -\tControl spot/overprint rendering\n"
-#ifdef FZ_ENABLE_SPOT_RENDERING
+#if FZ_ENABLE_SPOT_RENDERING
"\t\t 0 = No spot rendering\n"
"\t\t 1 = Overprint simulation (default)\n"
"\t\t 2 = Full spot rendering\n"