From 14f0dd1c64500c1cf12dcb47d14620afa3416d9f Mon Sep 17 00:00:00 2001 From: Robin Watts Date: Thu, 20 Sep 2018 12:05:26 +0100 Subject: 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). --- include/mupdf/fitz/config.h | 2 +- platform/java/mupdf_native.c | 4 ++-- source/fitz/document.c | 6 +++--- source/fitz/draw-affine.c | 26 +++++++++++++------------- source/fitz/draw-device.c | 2 +- source/fitz/draw-paint.c | 14 +++++++------- source/tools/mudraw.c | 4 ++-- 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" -- cgit v1.2.3