diff options
author | Robin Watts <robin.watts@artifex.com> | 2016-01-12 17:30:59 +0000 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2016-01-13 12:32:58 +0000 |
commit | ad8936bf2bcf54c7042bdec20c49c96657649b34 (patch) | |
tree | 0d6e309f5747e493632b72b34acef1e53e1ed9d7 /source/pdf/pdf-colorspace.c | |
parent | 881b7ea89588677e709aaa7d3d0ffe4aed63822a (diff) | |
download | mupdf-ad8936bf2bcf54c7042bdec20c49c96657649b34.tar.xz |
Add lots of consts.
In general, we should use 'const fz_blah' in device calls whenever
the callee should not alter the fz_blah.
Push this through. This shows up various places where we fz_keep
and fz_drop these const things.
I've updated the fz_keep and fz_drops with appropriate casts
to remove the consts. We may need to do the union dance to avoid
the consts for some compilers, but will only do that if required.
I think this is nicer overall, even allowing for the const<->no const
problems.
Diffstat (limited to 'source/pdf/pdf-colorspace.c')
-rw-r--r-- | source/pdf/pdf-colorspace.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/source/pdf/pdf-colorspace.c b/source/pdf/pdf-colorspace.c index 321b224b..b8c2e1cc 100644 --- a/source/pdf/pdf-colorspace.c +++ b/source/pdf/pdf-colorspace.c @@ -53,7 +53,7 @@ static inline float fung(float x) } static void -lab_to_rgb(fz_context *ctx, fz_colorspace *cs, const float *lab, float *rgb) +lab_to_rgb(fz_context *ctx, const fz_colorspace *cs, const float *lab, float *rgb) { /* input is in range (0..100, -128..127, -128..127) not (0..1, 0..1, 0..1) */ float lstar, astar, bstar, l, m, n, x, y, z, r, g, b; @@ -75,7 +75,7 @@ lab_to_rgb(fz_context *ctx, fz_colorspace *cs, const float *lab, float *rgb) } static void -rgb_to_lab(fz_context *ctx, fz_colorspace *cs, const float *rgb, float *lab) +rgb_to_lab(fz_context *ctx, const fz_colorspace *cs, const float *rgb, float *lab) { fz_warn(ctx, "cannot convert into L*a*b colorspace"); lab[0] = rgb[0]; @@ -95,7 +95,7 @@ struct separation }; static void -separation_to_rgb(fz_context *ctx, fz_colorspace *cs, const float *color, float *rgb) +separation_to_rgb(fz_context *ctx, const fz_colorspace *cs, const float *color, float *rgb) { struct separation *sep = cs->data; float alt[FZ_MAX_COLORS]; @@ -104,7 +104,7 @@ separation_to_rgb(fz_context *ctx, fz_colorspace *cs, const float *color, float } static void -free_separation(fz_context *ctx, fz_colorspace *cs) +free_separation(fz_context *ctx, const fz_colorspace *cs) { struct separation *sep = cs->data; fz_drop_colorspace(ctx, sep->base); @@ -165,7 +165,7 @@ load_separation(fz_context *ctx, pdf_document *doc, pdf_obj *array) } int -pdf_is_tint_colorspace(fz_context *ctx, fz_colorspace *cs) +pdf_is_tint_colorspace(fz_context *ctx, const fz_colorspace *cs) { return cs && cs->to_rgb == separation_to_rgb; } |