[PATCH weston v3 06/17] compositor-wayland: refactor load_wayland_backend

Pekka Paalanen ppaalanen at gmail.com
Fri May 6 13:00:04 UTC 2016


On Thu,  5 May 2016 22:45:44 +0200
Benoit Gschwind <gschwind at gnu-log.net> wrote:

> Rename compositor to c in load_wayland_backend function.
> 
> Signed-off-by: Benoit Gschwind <gschwind at gnu-log.net>
> ---
>  src/main.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/src/main.c b/src/main.c
> index 92b7ac2..a84bdeb 100644
> --- a/src/main.c
> +++ b/src/main.c
> @@ -1040,7 +1040,7 @@ wayland_backend_config_add_new_output(struct weston_wayland_backend_config *new_
>  }
>  
>  static int
> -load_wayland_backend(struct weston_compositor *compositor, char const * backend,
> +load_wayland_backend(struct weston_compositor *c, char const * backend,
>  		     int *argc, char *argv[], struct weston_config *config)
>  {
>  	struct weston_wayland_backend_config new_config = {{ 0, }};
> @@ -1086,7 +1086,7 @@ load_wayland_backend(struct weston_compositor *compositor, char const * backend,
>  
>  	if (new_config.sprawl) {
>  		/* do nothing, everything is already set */
> -		ret = load_backend_new(compositor, backend, &new_config.base);
> +		ret = load_backend_new(c, backend, &new_config.base);
>  		wayland_backend_config_release(&new_config);
>  		return ret;
>  	}
> @@ -1104,7 +1104,7 @@ load_wayland_backend(struct weston_compositor *compositor, char const * backend,
>  		oc->transform = WL_OUTPUT_TRANSFORM_NORMAL;
>  		oc->scale = 1;
>  
> -		ret = load_backend_new(compositor, backend, &new_config.base);
> +		ret = load_backend_new(c, backend, &new_config.base);
>  		wayland_backend_config_release(&new_config);
>  		return ret;
>  	}
> @@ -1159,7 +1159,7 @@ load_wayland_backend(struct weston_compositor *compositor, char const * backend,
>  		--count;
>  	}
>  
> -	ret = load_backend_new(compositor, backend, &new_config.base);
> +	ret = load_backend_new(c, backend, &new_config.base);
>  	wayland_backend_config_release(&new_config);
>  	return ret;
>  

Hi,

please don't do this. Long functions need to use descriptive variable
names. This patch is a step towards obfuscation.

In fact, I would welcome patches doing the opposite, if anyone cares.


Thanks,
pq
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 811 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/wayland-devel/attachments/20160506/bc94e114/attachment.sig>


More information about the wayland-devel mailing list