[Pixman] [PATCH 3/3] The code in 'bitmap_addrect' already assumes non-null 'reg->data'

Soeren Sandmann sandmann at cs.au.dk
Wed Jan 12 01:34:03 PST 2011

Siarhei Siamashka <siarhei.siamashka at gmail.com> writes:

> @@ -2590,6 +2589,8 @@ PREFIX (_init_from_image) (region_type_t *region,
>      PREFIX(_init) (region);
> +    assert (region->data);
> +
>      return_if_fail (image->type == BITS);
>      return_if_fail (image->bits.format == PIXMAN_a1);

I'm a little uncomfortable with adding asserts because if they
trigger, they will take down the X server. (Even though this one can't
possibly trigger).

Instead, I'd rather use the critical_if_fail() macro. If pixman is
compiled with DEBUG defined, it will print stuff to stderr if the
given expression fails.


More information about the Pixman mailing list