[PATCH weston] Separate declarations from code.

Pekka Paalanen ppaalanen at gmail.com
Mon Mar 2 05:14:29 PST 2015


On Mon,  2 Mar 2015 13:24:36 +0100
Carlos Olmedo Escobar <carlos.olmedo.e at gmail.com> wrote:

> Thanks Pekka for pointing that out.
> 
> Signed-off-by: Carlos Olmedo Escobar <carlos.olmedo.e at gmail.com>
> ---
>  ivi-shell/ivi-layout-transition.c | 21 +++++++++++++++------
>  1 file changed, 15 insertions(+), 6 deletions(-)
> 
> diff --git a/ivi-shell/ivi-layout-transition.c b/ivi-shell/ivi-layout-transition.c
> index 904e8d6..f691d35 100644
> --- a/ivi-shell/ivi-layout-transition.c
> +++ b/ivi-shell/ivi-layout-transition.c
> @@ -327,11 +327,14 @@ create_move_resize_view_transition(
>  			ivi_layout_transition_destroy_func destroy_func,
>  			uint32_t duration)
>  {
> -	struct ivi_layout_transition *transition = create_layout_transition();
> +	struct ivi_layout_transition *transition;
> +	struct move_resize_view_data *data;
> +
> +	transition = create_layout_transition();
>  	if (transition == NULL)
>  		return NULL;
>  
> -	struct move_resize_view_data *data = malloc(sizeof(*data));
> +	data = malloc(sizeof(*data));
>  	if (data == NULL) {
>  		weston_log("%s: memory allocation fails\n", __func__);
>  		return NULL;
> @@ -452,11 +455,14 @@ create_fade_view_transition(
>  			ivi_layout_transition_destroy_func destroy_func,
>  			uint32_t duration)
>  {
> -	struct ivi_layout_transition *transition = create_layout_transition();
> +	struct ivi_layout_transition *transition;
> +	struct fade_view_data *data;
> +
> +	transition = create_layout_transition();
>  	if (transition == NULL)
>  		return NULL;
>  
> -	struct fade_view_data *data = malloc(sizeof(*data));
> +	data = malloc(sizeof(*data));
>  	if (data == NULL) {
>  		weston_log("%s: memory allocation fails\n", __func__);
>  		return NULL;
> @@ -678,11 +684,14 @@ create_move_layer_transition(
>  		ivi_layout_transition_destroy_user_func destroy_user_func,
>  		uint32_t duration)
>  {
> -	struct ivi_layout_transition *transition = create_layout_transition();
> +	struct ivi_layout_transition *transition;
> +	struct move_layer_data *data;
> +
> +	transition = create_layout_transition();
>  	if (transition == NULL)
>  		return NULL;
>  
> -	struct move_layer_data *data = malloc(sizeof(*data));
> +	data = malloc(sizeof(*data));
>  	if (data == NULL) {
>  		weston_log("%s: memory allocation fails\n", __func__);
>  		return NULL;

Yeah, that's better. Pushed with my R-b.

Thanks,
pq


More information about the wayland-devel mailing list