summaryrefslogtreecommitdiff
path: root/source/fitz/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/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/device.c')
-rw-r--r--source/fitz/device.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/source/fitz/device.c b/source/fitz/device.c
index cd3435c9..f95ae32a 100644
--- a/source/fitz/device.c
+++ b/source/fitz/device.c
@@ -74,8 +74,8 @@ pop_clip_stack(fz_context *ctx, fz_device *dev)
}
void
-fz_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_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)
{
if (dev->error_depth)
return;
@@ -84,8 +84,8 @@ fz_fill_path(fz_context *ctx, fz_device *dev, fz_path *path, int even_odd, const
}
void
-fz_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_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)
{
if (dev->error_depth)
return;
@@ -94,7 +94,7 @@ fz_stroke_path(fz_context *ctx, fz_device *dev, fz_path *path, fz_stroke_state *
}
void
-fz_clip_path(fz_context *ctx, fz_device *dev, fz_path *path, const fz_rect *rect, int even_odd, const fz_matrix *ctm)
+fz_clip_path(fz_context *ctx, fz_device *dev, const fz_path *path, const fz_rect *rect, int even_odd, const fz_matrix *ctm)
{
if (dev->error_depth)
{
@@ -127,7 +127,7 @@ fz_clip_path(fz_context *ctx, fz_device *dev, fz_path *path, const fz_rect *rect
}
void
-fz_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_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)
{
if (dev->error_depth)
{
@@ -160,8 +160,8 @@ fz_clip_stroke_path(fz_context *ctx, fz_device *dev, fz_path *path, const fz_rec
}
void
-fz_fill_text(fz_context *ctx, fz_device *dev, fz_text *text, const fz_matrix *ctm,
- fz_colorspace *colorspace, float *color, float alpha)
+fz_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)
{
if (dev->error_depth)
return;
@@ -170,8 +170,8 @@ fz_fill_text(fz_context *ctx, fz_device *dev, fz_text *text, const fz_matrix *ct
}
void
-fz_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_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)
{
if (dev->error_depth)
return;
@@ -180,7 +180,7 @@ fz_stroke_text(fz_context *ctx, fz_device *dev, fz_text *text, fz_stroke_state *
}
void
-fz_clip_text(fz_context *ctx, fz_device *dev, fz_text *text, const fz_matrix *ctm)
+fz_clip_text(fz_context *ctx, fz_device *dev, const fz_text *text, const fz_matrix *ctm)
{
if (dev->error_depth)
{
@@ -208,7 +208,7 @@ fz_clip_text(fz_context *ctx, fz_device *dev, fz_text *text, const fz_matrix *ct
}
void
-fz_clip_stroke_text(fz_context *ctx, fz_device *dev, fz_text *text, fz_stroke_state *stroke, const fz_matrix *ctm)
+fz_clip_stroke_text(fz_context *ctx, fz_device *dev, const fz_text *text, const fz_stroke_state *stroke, const fz_matrix *ctm)
{
if (dev->error_depth)
{
@@ -236,7 +236,7 @@ fz_clip_stroke_text(fz_context *ctx, fz_device *dev, fz_text *text, fz_stroke_st
}
void
-fz_ignore_text(fz_context *ctx, fz_device *dev, fz_text *text, const fz_matrix *ctm)
+fz_ignore_text(fz_context *ctx, fz_device *dev, const fz_text *text, const fz_matrix *ctm)
{
if (dev->error_depth)
return;
@@ -261,7 +261,7 @@ fz_pop_clip(fz_context *ctx, fz_device *dev)
}
void
-fz_fill_shade(fz_context *ctx, fz_device *dev, fz_shade *shade, const fz_matrix *ctm, float alpha)
+fz_fill_shade(fz_context *ctx, fz_device *dev, const fz_shade *shade, const fz_matrix *ctm, float alpha)
{
if (dev->error_depth)
return;
@@ -270,7 +270,7 @@ fz_fill_shade(fz_context *ctx, fz_device *dev, fz_shade *shade, const fz_matrix
}
void
-fz_fill_image(fz_context *ctx, fz_device *dev, fz_image *image, const fz_matrix *ctm, float alpha)
+fz_fill_image(fz_context *ctx, fz_device *dev, const fz_image *image, const fz_matrix *ctm, float alpha)
{
if (dev->error_depth)
return;
@@ -279,8 +279,8 @@ fz_fill_image(fz_context *ctx, fz_device *dev, fz_image *image, const fz_matrix
}
void
-fz_fill_image_mask(fz_context *ctx, fz_device *dev, fz_image *image, const fz_matrix *ctm,
- fz_colorspace *colorspace, float *color, float alpha)
+fz_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)
{
if (dev->error_depth)
return;
@@ -289,7 +289,7 @@ fz_fill_image_mask(fz_context *ctx, fz_device *dev, fz_image *image, const fz_ma
}
void
-fz_clip_image_mask(fz_context *ctx, fz_device *dev, fz_image *image, const fz_rect *rect, const fz_matrix *ctm)
+fz_clip_image_mask(fz_context *ctx, fz_device *dev, const fz_image *image, const fz_rect *rect, const fz_matrix *ctm)
{
if (dev->error_depth)
{
@@ -313,7 +313,7 @@ fz_clip_image_mask(fz_context *ctx, fz_device *dev, fz_image *image, const fz_re
}
void
-fz_begin_mask(fz_context *ctx, fz_device *dev, const fz_rect *area, int luminosity, fz_colorspace *colorspace, float *bc)
+fz_begin_mask(fz_context *ctx, fz_device *dev, const fz_rect *area, int luminosity, const fz_colorspace *colorspace, const float *bc)
{
if (dev->error_depth)
{