diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2009-06-12 12:32:51 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2009-06-12 22:28:38 +0100 |
commit | a41e1275d28317c88e29b7f142cfc835673c01f5 (patch) | |
tree | e03ba47be122d53a66e41e333dfe641ce0b5ce99 /boilerplate | |
parent | 6aebde6598c629d667b06e20111106832d139c4d (diff) |
[boilerplate] Make array of targets const.
Protect the boilerplate targets from unexpected modifications.
Diffstat (limited to 'boilerplate')
-rw-r--r-- | boilerplate/cairo-boilerplate.c | 8 | ||||
-rw-r--r-- | boilerplate/cairo-boilerplate.h | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/boilerplate/cairo-boilerplate.c b/boilerplate/cairo-boilerplate.c index 03173379..e3d96a26 100644 --- a/boilerplate/cairo-boilerplate.c +++ b/boilerplate/cairo-boilerplate.c @@ -270,7 +270,7 @@ cairo_boilerplate_get_image_surface_from_png (const char *filename, return surface; } -static cairo_boilerplate_target_t targets[] = +static const cairo_boilerplate_target_t targets[] = { /* I'm uncompromising about leaving the image backend as 0 * for tolerance. There shouldn't ever be anything that is out of @@ -744,13 +744,13 @@ static cairo_boilerplate_target_t targets[] = #endif }; -cairo_boilerplate_target_t ** +const cairo_boilerplate_target_t ** cairo_boilerplate_get_targets (int *pnum_targets, cairo_bool_t *plimited_targets) { size_t i, num_targets; cairo_bool_t limited_targets = FALSE; const char *tname; - cairo_boilerplate_target_t **targets_to_test; + const cairo_boilerplate_target_t **targets_to_test; if ((tname = getenv ("CAIRO_TEST_TARGET")) != NULL && *tname) { /* check the list of targets specified by the user */ @@ -868,7 +868,7 @@ cairo_boilerplate_get_image_target (cairo_content_t content) } void -cairo_boilerplate_free_targets (cairo_boilerplate_target_t **targets) +cairo_boilerplate_free_targets (const cairo_boilerplate_target_t **targets) { free (targets); } diff --git a/boilerplate/cairo-boilerplate.h b/boilerplate/cairo-boilerplate.h index ba3c4eb5..a2763bbf 100644 --- a/boilerplate/cairo-boilerplate.h +++ b/boilerplate/cairo-boilerplate.h @@ -168,11 +168,11 @@ typedef struct _cairo_boilerplate_target const cairo_boilerplate_target_t * cairo_boilerplate_get_image_target (cairo_content_t content); -cairo_boilerplate_target_t ** +const cairo_boilerplate_target_t ** cairo_boilerplate_get_targets (int *num_targets, cairo_bool_t *limited_targets); void -cairo_boilerplate_free_targets (cairo_boilerplate_target_t **targets); +cairo_boilerplate_free_targets (const cairo_boilerplate_target_t **targets); cairo_surface_t * _cairo_boilerplate_get_image_surface (cairo_surface_t *src, |