[PATCH][weston 1/2] ivi-layout-transition: Change layout_transition_register return type

Bryce Harrington bryce at osg.samsung.com
Tue Sep 22 14:36:44 PDT 2015


On Mon, Sep 21, 2015 at 02:10:32PM -0300, Lucas Tanure wrote:
> layout_transition_register could not work and we need to free trans in
> the calling function.
> 
> Signed-off-by: Lucas Tanure <tanure at linux.com>

LGTM,

Reviewed-by: Bryce Harrington <bryce at osg.samsung.com>

> ---
>  ivi-shell/ivi-layout-transition.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/ivi-shell/ivi-layout-transition.c b/ivi-shell/ivi-layout-transition.c
> index 6370e8f..8d477b4 100644
> --- a/ivi-shell/ivi-layout-transition.c
> +++ b/ivi-shell/ivi-layout-transition.c
> @@ -27,6 +27,7 @@
>  #include <assert.h>
>  #include <stdlib.h>
>  #include <stdio.h>
> +#include <stdbool.h>
>  
>  #include "ivi-layout-export.h"
>  #include "ivi-layout-private.h"
> @@ -181,7 +182,7 @@ ivi_layout_transition_set_create(struct weston_compositor *ec)
>  	return transitions;
>  }
>  
> -static void
> +static bool
>  layout_transition_register(struct ivi_layout_transition *trans)
>  {
>  	struct ivi_layout *layout = get_instance();
> @@ -190,11 +191,12 @@ layout_transition_register(struct ivi_layout_transition *trans)
>  	node = malloc(sizeof(*node));
>  	if (node == NULL) {
>  		weston_log("%s: memory allocation fails\n", __func__);
> -		return;
> +		return false;
>  	}
>  
>  	node->transition = trans;
>  	wl_list_insert(&layout->pending_transition_list, &node->link);
> +	return true;
>  }
>  
>  static void
> -- 
> 2.5.3
> 
> _______________________________________________
> 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