[cairo] Pixman [PATCH] Remove redundant NULL checks from general_composite_rect().

M Joonas Pihlaja jpihlaja at cc.helsinki.fi
Fri Jun 19 07:44:33 PDT 2009


The general_composite_rect() function has two invocations
of the return_if_fail() macro before any of its variable
declarations.  Removing them allows for compilation to
succeed using a pre-C99 compiler.

The checks in question are redundant NULL pointer checks
of the source and destination images.  Every path
to general_composite_rect() contains a call to
pixman_compute_composite_region32(), and that function
in turn dereferences the same pointers without checking
for NULL first.

---
 pixman/pixman-general.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/pixman/pixman-general.c b/pixman/pixman-general.c
index bdb6550..3bd850a 100644
--- a/pixman/pixman-general.c
+++ b/pixman/pixman-general.c
@@ -54,9 +54,6 @@ general_composite_rect  (pixman_implementation_t *imp,
                         int32_t                  width,
                         int32_t                  height)
 {
-    return_if_fail (src != NULL);
-    return_if_fail (dest != NULL);
-    
     uint8_t stack_scanline_buffer[SCANLINE_BUFFER_LENGTH * 3];
     const pixman_format_code_t srcFormat = src->type == BITS ? src->bits.format : 0;
     const pixman_format_code_t maskFormat = mask && mask->type == BITS ? mask->bits.format : 0;
-- 
1.6.0.2.g1293c



More information about the cairo mailing list