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/fitz/list-device.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/fitz/list-device.c')
-rw-r--r-- | source/fitz/list-device.c | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/source/fitz/list-device.c b/source/fitz/list-device.c index 14e2278c..d5a869c7 100644 --- a/source/fitz/list-device.c +++ b/source/fitz/list-device.c @@ -154,12 +154,12 @@ fz_append_display_node( fz_display_command cmd, int flags, const fz_rect *rect, - fz_path *path, - float *color, - fz_colorspace *colorspace, - float *alpha, + const fz_path *path, + const float *color, + const fz_colorspace *colorspace, + const float *alpha, const fz_matrix *ctm, - fz_stroke_state *stroke, + const fz_stroke_state *stroke, void *private_data, int private_data_len) { @@ -678,8 +678,8 @@ fz_list_end_page(fz_context *ctx, fz_device *dev) } static void -fz_list_fill_path(fz_context *ctx, fz_device *dev, fz_path *path, int even_odd, const fz_matrix *ctm, - fz_colorspace *colorspace, float *color, float alpha) +fz_list_fill_path(fz_context *ctx, fz_device *dev, const fz_path *path, int even_odd, const fz_matrix *ctm, + const fz_colorspace *colorspace, const float *color, float alpha) { fz_rect rect; @@ -701,8 +701,8 @@ fz_list_fill_path(fz_context *ctx, fz_device *dev, fz_path *path, int even_odd, } static void -fz_list_stroke_path(fz_context *ctx, fz_device *dev, fz_path *path, fz_stroke_state *stroke, - const fz_matrix *ctm, fz_colorspace *colorspace, float *color, float alpha) +fz_list_stroke_path(fz_context *ctx, fz_device *dev, const fz_path *path, const fz_stroke_state *stroke, + const fz_matrix *ctm, const fz_colorspace *colorspace, const float *color, float alpha) { fz_rect rect; @@ -724,7 +724,7 @@ fz_list_stroke_path(fz_context *ctx, fz_device *dev, fz_path *path, fz_stroke_st } static void -fz_list_clip_path(fz_context *ctx, fz_device *dev, fz_path *path, const fz_rect *rect, int even_odd, const fz_matrix *ctm) +fz_list_clip_path(fz_context *ctx, fz_device *dev, const fz_path *path, const fz_rect *rect, int even_odd, const fz_matrix *ctm) { fz_rect rect2; @@ -748,7 +748,7 @@ fz_list_clip_path(fz_context *ctx, fz_device *dev, fz_path *path, const fz_rect } static void -fz_list_clip_stroke_path(fz_context *ctx, fz_device *dev, fz_path *path, const fz_rect *rect, fz_stroke_state *stroke, const fz_matrix *ctm) +fz_list_clip_stroke_path(fz_context *ctx, fz_device *dev, const fz_path *path, const fz_rect *rect, const fz_stroke_state *stroke, const fz_matrix *ctm) { fz_rect rect2; @@ -772,8 +772,8 @@ fz_list_clip_stroke_path(fz_context *ctx, fz_device *dev, fz_path *path, const f } static void -fz_list_fill_text(fz_context *ctx, fz_device *dev, fz_text *text, const fz_matrix *ctm, - fz_colorspace *colorspace, float *color, float alpha) +fz_list_fill_text(fz_context *ctx, fz_device *dev, const fz_text *text, const fz_matrix *ctm, + const fz_colorspace *colorspace, const float *color, float alpha) { fz_rect rect; fz_text *cloned_text = fz_keep_text(ctx, text); @@ -804,8 +804,8 @@ fz_list_fill_text(fz_context *ctx, fz_device *dev, fz_text *text, const fz_matri } static void -fz_list_stroke_text(fz_context *ctx, fz_device *dev, fz_text *text, fz_stroke_state *stroke, const fz_matrix *ctm, - fz_colorspace *colorspace, float *color, float alpha) +fz_list_stroke_text(fz_context *ctx, fz_device *dev, const fz_text *text, const fz_stroke_state *stroke, const fz_matrix *ctm, + const fz_colorspace *colorspace, const float *color, float alpha) { fz_rect rect; fz_text *cloned_text = fz_keep_text(ctx, text); @@ -836,7 +836,7 @@ fz_list_stroke_text(fz_context *ctx, fz_device *dev, fz_text *text, fz_stroke_st } static void -fz_list_clip_text(fz_context *ctx, fz_device *dev, fz_text *text, const fz_matrix *ctm) +fz_list_clip_text(fz_context *ctx, fz_device *dev, const fz_text *text, const fz_matrix *ctm) { fz_rect rect; fz_text *cloned_text = fz_keep_text(ctx, text); @@ -867,7 +867,7 @@ fz_list_clip_text(fz_context *ctx, fz_device *dev, fz_text *text, const fz_matri } static void -fz_list_clip_stroke_text(fz_context *ctx, fz_device *dev, fz_text *text, fz_stroke_state *stroke, const fz_matrix *ctm) +fz_list_clip_stroke_text(fz_context *ctx, fz_device *dev, const fz_text *text, const fz_stroke_state *stroke, const fz_matrix *ctm) { fz_rect rect; fz_text *cloned_text = fz_keep_text(ctx, text); @@ -898,7 +898,7 @@ fz_list_clip_stroke_text(fz_context *ctx, fz_device *dev, fz_text *text, fz_stro } static void -fz_list_ignore_text(fz_context *ctx, fz_device *dev, fz_text *text, const fz_matrix *ctm) +fz_list_ignore_text(fz_context *ctx, fz_device *dev, const fz_text *text, const fz_matrix *ctm) { fz_rect rect; fz_text *cloned_text = fz_keep_text(ctx, text); @@ -948,7 +948,7 @@ fz_list_pop_clip(fz_context *ctx, fz_device *dev) } static void -fz_list_fill_shade(fz_context *ctx, fz_device *dev, fz_shade *shade, const fz_matrix *ctm, float alpha) +fz_list_fill_shade(fz_context *ctx, fz_device *dev, const fz_shade *shade, const fz_matrix *ctm, float alpha) { fz_shade *shade2 = fz_keep_shade(ctx, shade); fz_rect rect; @@ -979,7 +979,7 @@ fz_list_fill_shade(fz_context *ctx, fz_device *dev, fz_shade *shade, const fz_ma } static void -fz_list_fill_image(fz_context *ctx, fz_device *dev, fz_image *image, const fz_matrix *ctm, float alpha) +fz_list_fill_image(fz_context *ctx, fz_device *dev, const fz_image *image, const fz_matrix *ctm, float alpha) { fz_image *image2 = fz_keep_image(ctx, image); fz_rect rect = fz_unit_rect; @@ -1010,8 +1010,8 @@ fz_list_fill_image(fz_context *ctx, fz_device *dev, fz_image *image, const fz_ma } static void -fz_list_fill_image_mask(fz_context *ctx, fz_device *dev, fz_image *image, const fz_matrix *ctm, - fz_colorspace *colorspace, float *color, float alpha) +fz_list_fill_image_mask(fz_context *ctx, fz_device *dev, const fz_image *image, const fz_matrix *ctm, + const fz_colorspace *colorspace, const float *color, float alpha) { fz_image *image2 = fz_keep_image(ctx, image); fz_rect rect = fz_unit_rect; @@ -1042,7 +1042,7 @@ fz_list_fill_image_mask(fz_context *ctx, fz_device *dev, fz_image *image, const } static void -fz_list_clip_image_mask(fz_context *ctx, fz_device *dev, fz_image *image, const fz_rect *rect, const fz_matrix *ctm) +fz_list_clip_image_mask(fz_context *ctx, fz_device *dev, const fz_image *image, const fz_rect *rect, const fz_matrix *ctm) { fz_image *image2 = fz_keep_image(ctx, image); fz_rect rect2 = fz_unit_rect; @@ -1075,7 +1075,7 @@ fz_list_clip_image_mask(fz_context *ctx, fz_device *dev, fz_image *image, const } static void -fz_list_begin_mask(fz_context *ctx, fz_device *dev, const fz_rect *rect, int luminosity, fz_colorspace *colorspace, float *color) +fz_list_begin_mask(fz_context *ctx, fz_device *dev, const fz_rect *rect, int luminosity, const fz_colorspace *colorspace, const float *color) { fz_append_display_node( ctx, |