diff options
author | Søren Sandmann Pedersen <ssp@redhat.com> | 2010-11-08 01:10:51 -0500 |
---|---|---|
committer | Søren Sandmann Pedersen <ssp@redhat.com> | 2010-11-08 01:10:51 -0500 |
commit | f043b03399ff1f323dd16bc82a5b5a1126828291 (patch) | |
tree | a428e816a5f7b9986a2c0f0c404983b567a51605 | |
parent | dd9ba2a8522e64063915563a7de7014d3223e358 (diff) |
asdf
-rw-r--r-- | region-iter.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/region-iter.c b/region-iter.c index bc88ba9..b7337c4 100644 --- a/region-iter.c +++ b/region-iter.c @@ -70,10 +70,11 @@ static pixman_region32_data_t * region_data_append (pixman_region32_data_t *data, int n, pixman_box32_t *boxes) { pixman_box32_t *data_boxes; + size_t new_size; if (!data || data->size < data->numRects + n) { - size_t new_size = next_power (n + data->numRects); + size_t new_size = next_power (n + data? data->numRects : 0); data = realloc (data, sizeof (pixman_region32_data_t) + new_size); @@ -378,10 +379,10 @@ typedef enum } ops_t; static void -region_op (pixman_region32_t *dst, +region_op (ops_t op, + pixman_region32_t *dst, pixman_region32_t *src1, - pixman_region32_t *src2, - ops_t op) + pixman_region32_t *src2) { overlapped_iter_t iter; row_t row1, row2; @@ -661,7 +662,7 @@ main () pixman_region32_init_rect (®ion1, 100, 100, 200, 200); pixman_region32_init_rect (®ion2, 200, 200, 200, 200); - region_op (NULL, ®ion1, ®ion2, UNION); + region_op (UNION, NULL, ®ion1, ®ion2); printf ("-=- op2\n"); pixman_region32_init_rect (®ion1, 100, 100, 200, 200); @@ -671,7 +672,7 @@ main () pixman_region32_init_rect (®ion2, 150, 50, 10, 520); - region_op (NULL, ®ion1, ®ion2, INTERSECT); + region_op (INTERSECT, NULL, ®ion1, ®ion2); printf ("-=- op2\n"); pixman_region32_init_rect (®ion1, 100, 100, 200, 200); @@ -680,7 +681,7 @@ main () pixman_region32_init_rect (®ion2, 150, 50, 10, 520); pixman_region32_union_rect (®ion2, ®ion2, 10, 10, 342, 23); - region_op (NULL, ®ion1, ®ion2, XOR); + region_op (XOR, NULL, ®ion1, ®ion2); printf ("-=- path\n"); pixman_region32_init_rect (®ion1, 100, 100, 200, 200); |