[PATCH] rpi: Support opaque regions

Bill Spitzak spitzak at gmail.com
Mon Dec 2 14:23:08 PST 2013

Bryce W. Harrington wrote:

>> +	ret = rpir_surface_set_opaque_rect(surface, update);
>> +	if (ret < 0)
> Other code here is just checking "if (ret)".
> rpir_surface_set_opaque_rect() only appears to return 0 or -1, so might
> be more consistent with existing code to do the same.  Or do you
> invision that routine could return a positive integer which would not
> cause it to error out here?

I think it is pretty common to have functions that return 0 on error and 
non-zero on success. Therefore a test of "if (ret)" may be mis-read as 
an accidental reversal of the error test.

Returning negative on error is also common, so "if (ret<0)" will not be 

More information about the wayland-devel mailing list