[krh/wayland/next 5/5] connection: Dereference id completely for comparasion.

Kristian Høgsberg hoegsberg at gmail.com
Tue Oct 16 08:25:44 PDT 2012


On Fri, Oct 12, 2012 at 11:28:28AM +0200, John Kåre Alsaker wrote:
> ---
>  src/connection.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Argh, yes, thanks.  Tricky one... I blame C for overloading '0' as a
numeral *and* a polymorphic pointer.  If only they'd used something
like 'nil' for that.

Kristian

> diff --git a/src/connection.c b/src/connection.c
> index ad060b0..6878eba 100644
> --- a/src/connection.c
> +++ b/src/connection.c
> @@ -710,7 +710,7 @@ wl_connection_demarshal(struct wl_connection *connection,
>  			closure->args[i] = id;
>  			*id = p;
>  
> -			if (*id == 0 && !arg.nullable) {
> +			if (**id == 0 && !arg.nullable) {
>  				printf("NULL object received on non-nullable "
>  				       "type, message %s(%s)\n", message->name,
>  				       message->signature);
> @@ -727,7 +727,7 @@ wl_connection_demarshal(struct wl_connection *connection,
>  			closure->args[i] = id;
>  			*id = p;
>  
> -			if (*id == 0 && !arg.nullable) {
> +			if (**id == 0 && !arg.nullable) {
>  				printf("NULL new ID received on non-nullable "
>  				       "type, message %s(%s)\n", message->name,
>  				       message->signature);
> -- 
> 1.7.12.2
> 
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel


More information about the wayland-devel mailing list