summaryrefslogtreecommitdiff
path: root/source/fitz/trace-device.c
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2016-01-12 17:30:59 +0000
committerRobin Watts <robin.watts@artifex.com>2016-01-13 12:32:58 +0000
commitad8936bf2bcf54c7042bdec20c49c96657649b34 (patch)
tree0d6e309f5747e493632b72b34acef1e53e1ed9d7 /source/fitz/trace-device.c
parent881b7ea89588677e709aaa7d3d0ffe4aed63822a (diff)
downloadmupdf-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/trace-device.c')
-rw-r--r--source/fitz/trace-device.c44
1 files changed, 22 insertions, 22 deletions
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, "<fill_path");
@@ -133,8 +133,8 @@ fz_trace_fill_path(fz_context *ctx, fz_device *dev, fz_path *path, int even_odd,
}
static void
-fz_trace_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_trace_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_output *out = ((fz_trace_device*)dev)->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, "<clip_path");
@@ -181,7 +181,7 @@ fz_trace_clip_path(fz_context *ctx, fz_device *dev, fz_path *path, const fz_rect
}
static void
-fz_trace_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_trace_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_output *out = ((fz_trace_device*)dev)->out;
fz_printf(ctx, out, "<clip_stroke_path");
@@ -192,8 +192,8 @@ fz_trace_clip_stroke_path(fz_context *ctx, fz_device *dev, fz_path *path, const
}
static void
-fz_trace_fill_text(fz_context *ctx, fz_device *dev, fz_text *text, const fz_matrix *ctm,
- fz_colorspace *colorspace, float *color, float alpha)
+fz_trace_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_output *out = ((fz_trace_device*)dev)->out;
fz_printf(ctx, out, "<fill_text");
@@ -205,8 +205,8 @@ fz_trace_fill_text(fz_context *ctx, fz_device *dev, fz_text *text, const fz_matr
}
static void
-fz_trace_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_trace_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_output *out = ((fz_trace_device*)dev)->out;
fz_printf(ctx, out, "<stroke_text");
@@ -218,7 +218,7 @@ fz_trace_stroke_text(fz_context *ctx, fz_device *dev, fz_text *text, fz_stroke_s
}
static void
-fz_trace_clip_text(fz_context *ctx, fz_device *dev, fz_text *text, const fz_matrix *ctm)
+fz_trace_clip_text(fz_context *ctx, fz_device *dev, const fz_text *text, const fz_matrix *ctm)
{
fz_output *out = ((fz_trace_device*)dev)->out;
fz_printf(ctx, out, "<clip_text");
@@ -229,7 +229,7 @@ fz_trace_clip_text(fz_context *ctx, fz_device *dev, fz_text *text, const fz_matr
}
static void
-fz_trace_clip_stroke_text(fz_context *ctx, fz_device *dev, fz_text *text, fz_stroke_state *stroke, const fz_matrix *ctm)
+fz_trace_clip_stroke_text(fz_context *ctx, fz_device *dev, const fz_text *text, const fz_stroke_state *stroke, const fz_matrix *ctm)
{
fz_output *out = ((fz_trace_device*)dev)->out;
fz_printf(ctx, out, "<clip_stroke_text");
@@ -240,7 +240,7 @@ fz_trace_clip_stroke_text(fz_context *ctx, fz_device *dev, fz_text *text, fz_str
}
static void
-fz_trace_ignore_text(fz_context *ctx, fz_device *dev, fz_text *text, const fz_matrix *ctm)
+fz_trace_ignore_text(fz_context *ctx, fz_device *dev, const fz_text *text, const fz_matrix *ctm)
{
fz_output *out = ((fz_trace_device*)dev)->out;
fz_printf(ctx, out, "<ignore_text");
@@ -251,7 +251,7 @@ fz_trace_ignore_text(fz_context *ctx, fz_device *dev, fz_text *text, const fz_ma
}
static void
-fz_trace_fill_image(fz_context *ctx, fz_device *dev, fz_image *image, const fz_matrix *ctm, float alpha)
+fz_trace_fill_image(fz_context *ctx, fz_device *dev, const fz_image *image, const fz_matrix *ctm, float alpha)
{
fz_output *out = ((fz_trace_device*)dev)->out;
fz_printf(ctx, out, "<fill_image alpha=\"%g\"", alpha);
@@ -261,7 +261,7 @@ fz_trace_fill_image(fz_context *ctx, fz_device *dev, fz_image *image, const fz_m
}
static void
-fz_trace_fill_shade(fz_context *ctx, fz_device *dev, fz_shade *shade, const fz_matrix *ctm, float alpha)
+fz_trace_fill_shade(fz_context *ctx, fz_device *dev, const fz_shade *shade, const fz_matrix *ctm, float alpha)
{
fz_output *out = ((fz_trace_device*)dev)->out;
fz_printf(ctx, out, "<fill_shade alpha=\"%g\"", alpha);
@@ -270,8 +270,8 @@ fz_trace_fill_shade(fz_context *ctx, fz_device *dev, fz_shade *shade, const fz_m
}
static void
-fz_trace_fill_image_mask(fz_context *ctx, fz_device *dev, fz_image *image, const fz_matrix *ctm,
-fz_colorspace *colorspace, float *color, float alpha)
+fz_trace_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_output *out = ((fz_trace_device*)dev)->out;
fz_printf(ctx, out, "<fill_image_mask");
@@ -282,7 +282,7 @@ fz_colorspace *colorspace, float *color, float alpha)
}
static void
-fz_trace_clip_image_mask(fz_context *ctx, fz_device *dev, fz_image *image, const fz_rect *rect, const fz_matrix *ctm)
+fz_trace_clip_image_mask(fz_context *ctx, fz_device *dev, const fz_image *image, const fz_rect *rect, const fz_matrix *ctm)
{
fz_output *out = ((fz_trace_device*)dev)->out;
fz_printf(ctx, out, "<clip_image_mask");
@@ -299,7 +299,7 @@ fz_trace_pop_clip(fz_context *ctx, fz_device *dev)
}
static void
-fz_trace_begin_mask(fz_context *ctx, fz_device *dev, const fz_rect *bbox, int luminosity, fz_colorspace *colorspace, float *color)
+fz_trace_begin_mask(fz_context *ctx, fz_device *dev, const fz_rect *bbox, int luminosity, const fz_colorspace *colorspace, const float *color)
{
fz_output *out = ((fz_trace_device*)dev)->out;
fz_printf(ctx, out, "<mask bbox=\"%g %g %g %g\" s=\"%s\"",