summaryrefslogtreecommitdiff
path: root/src/cairo-clip.c
diff options
context:
space:
mode:
authorPeter O'Gorman <pogma@thewrittenword.com>2008-08-15 14:46:22 -0500
committerChris Wilson <chris@chris-wilson.co.uk>2008-08-17 11:42:48 +0100
commit586dbaafe6ac8803c7d7b9ed38297486d47f60e9 (patch)
tree4ad5676a4ba6ad4699ec3261069239d4ba3fe4c0 /src/cairo-clip.c
parent3998040c1151ffbc3f8748ca430af5bd81ca92e4 (diff)
downloadcairo-586dbaafe6ac8803c7d7b9ed38297486d47f60e9.tar.gz
Compile with old compilers
Some compilers fail to compile non-constant struct initializers.
Diffstat (limited to 'src/cairo-clip.c')
-rw-r--r--src/cairo-clip.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/cairo-clip.c b/src/cairo-clip.c
index 8a7c98a34..9f82db81e 100644
--- a/src/cairo-clip.c
+++ b/src/cairo-clip.c
@@ -59,7 +59,7 @@ _cairo_clip_init (cairo_clip_t *clip, cairo_surface_t *target)
clip->surface = NULL;
clip->surface_rect.x = 0;
clip->surface_rect.y = 0;
- clip->surface_rect.width = 0;
+ clip->surface_rect.width = 0;
clip->surface_rect.height = 0;
clip->serial = 0;
@@ -86,6 +86,7 @@ _cairo_clip_init_copy (cairo_clip_t *clip, cairo_clip_t *other)
if (other->has_region) {
cairo_status_t status;
+
status = _cairo_region_copy (&clip->region, &other->region);
if (status) {
_cairo_region_fini (&clip->region);
@@ -388,6 +389,7 @@ _cairo_clip_intersect_region (cairo_clip_t *clip,
clip->has_region = TRUE;
} else {
cairo_region_t intersection;
+
_cairo_region_init (&intersection);
status = _cairo_region_intersect (&intersection,
@@ -727,7 +729,7 @@ _cairo_clip_int_rect_to_user (cairo_gstate_t *gstate,
user_rect->x = x1;
user_rect->y = y1;
- user_rect->width = x2 - x1;
+ user_rect->width = x2 - x1;
user_rect->height = y2 - y1;
return is_tight;
@@ -764,9 +766,12 @@ _cairo_clip_copy_rectangle_list (cairo_clip_t *clip, cairo_gstate_t *gstate)
}
for (i = 0; i < n_boxes; ++i) {
- cairo_rectangle_int_t clip_rect = { boxes[i].p1.x, boxes[i].p1.y,
- boxes[i].p2.x - boxes[i].p1.x,
- boxes[i].p2.y - boxes[i].p1.y };
+ cairo_rectangle_int_t clip_rect;
+
+ clip_rect.x = boxes[i].p1.x;
+ clip_rect.y = boxes[i].p1.y;
+ clip_rect.width = boxes[i].p2.x - boxes[i].p1.x;
+ clip_rect.height = boxes[i].p2.y - boxes[i].p1.y;
if (!_cairo_clip_int_rect_to_user(gstate, &clip_rect, &rectangles[i])) {
_cairo_error_throw (CAIRO_STATUS_CLIP_NOT_REPRESENTABLE);