From ad8936bf2bcf54c7042bdec20c49c96657649b34 Mon Sep 17 00:00:00 2001 From: Robin Watts Date: Tue, 12 Jan 2016 17:30:59 +0000 Subject: 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. --- source/fitz/trace-device.c | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) (limited to 'source/fitz/trace-device.c') diff --git a/source/fitz/trace-device.c b/source/fitz/trace-device.c index 1f972642..6d12a396 100644 --- a/source/fitz/trace-device.c +++ b/source/fitz/trace-device.c @@ -14,7 +14,7 @@ fz_trace_matrix(fz_context *ctx, fz_output *out, const fz_matrix *ctm) } static void -fz_trace_color(fz_context *ctx, fz_output *out, fz_colorspace *colorspace, float *color, float alpha) +fz_trace_color(fz_context *ctx, fz_output *out, const fz_colorspace *colorspace, const float *color, float alpha) { int i; fz_printf(ctx, out, " colorspace=\"%s\" color=\"", colorspace->name); @@ -50,7 +50,7 @@ fz_trace_text_span(fz_context *ctx, fz_output *out, fz_text_span *span) } static void -fz_trace_text(fz_context *ctx, fz_output *out, fz_text *text) +fz_trace_text(fz_context *ctx, fz_output *out, const fz_text *text) { fz_text_span *span; for (span = text->head; span; span = span->next) @@ -94,7 +94,7 @@ static const fz_path_processor trace_path_proc = }; static void -fz_trace_path(fz_context *ctx, fz_output *out, fz_path *path) +fz_trace_path(fz_context *ctx, fz_output *out, const fz_path *path) { fz_process_path(ctx, &trace_path_proc, out, path); } @@ -116,8 +116,8 @@ fz_trace_end_page(fz_context *ctx, fz_device *dev) } static void -fz_trace_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_trace_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_output *out = ((fz_trace_device*)dev)->out; fz_printf(ctx, out, "out; int i; @@ -163,7 +163,7 @@ fz_trace_stroke_path(fz_context *ctx, fz_device *dev, fz_path *path, fz_stroke_s } static void -fz_trace_clip_path(fz_context *ctx, fz_device *dev, fz_path *path, const fz_rect *rect, int even_odd, const fz_matrix *ctm) +fz_trace_clip_path(fz_context *ctx, fz_device *dev, const fz_path *path, const fz_rect *rect, int even_odd, const fz_matrix *ctm) { fz_output *out = ((fz_trace_device*)dev)->out; fz_printf(ctx, out, "out; fz_printf(ctx, out, "out; fz_printf(ctx, out, "out; fz_printf(ctx, out, "out; fz_printf(ctx, out, "out; fz_printf(ctx, out, "out; fz_printf(ctx, out, "out; fz_printf(ctx, out, "out; fz_printf(ctx, out, "out; fz_printf(ctx, out, "out; fz_printf(ctx, out, "out; fz_printf(ctx, out, "