[PATCH weston v3 04/17] compositor-wayland: refactor wayland_output_config_init

Pekka Paalanen ppaalanen at gmail.com
Fri May 6 13:28:07 UTC 2016


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

> Rename the missleading output to output_config.

Hi,

that is indeed the only thing this patch does, so that should be the
summary (the email subject, the first line in git commit message).

There is no refactoring going on.

The word "misleading" nicely also explains "why this patch".

With that fixed:
Reviewed-by: Pekka Paalanen <pekka.paalanen at collabora.co.uk>


Thanks,
pq

> Signed-off-by: Benoit Gschwind <gschwind at gnu-log.net>
> ---
>  src/compositor-wayland.c | 38 +++++++++++++++++++-------------------
>  1 file changed, 19 insertions(+), 19 deletions(-)
> 
> diff --git a/src/compositor-wayland.c b/src/compositor-wayland.c
> index 2822a09..53f855d 100644
> --- a/src/compositor-wayland.c
> +++ b/src/compositor-wayland.c
> @@ -1092,7 +1092,7 @@ err_name:
>  }
>  
>  static void
> -wayland_output_config_init(struct weston_wayland_backend_output_config *output,
> +wayland_output_config_init(struct weston_wayland_backend_output_config *output_config,
>  				struct weston_config_section *config_section,
>  				int option_width, int option_height,
>  				int option_scale)
> @@ -1100,46 +1100,46 @@ wayland_output_config_init(struct weston_wayland_backend_output_config *output,
>  	char *mode, *t, *str;
>  	unsigned int slen;
>  
> -	weston_config_section_get_string(config_section, "name", &output->name,
> +	weston_config_section_get_string(config_section, "name", &output_config->name,
>  					 NULL);
> -	if (output->name) {
> -		slen = strlen(output->name);
> +	if (output_config->name) {
> +		slen = strlen(output_config->name);
>  		slen += strlen(WINDOW_TITLE " - ");
>  		str = malloc(slen + 1);
>  		if (str)
>  			snprintf(str, slen + 1, WINDOW_TITLE " - %s",
> -				 output->name);
> -		free(output->name);
> -		output->name = str;
> +				 output_config->name);
> +		free(output_config->name);
> +		output_config->name = str;
>  	}
> -	if (!output->name)
> -		output->name = strdup(WINDOW_TITLE);
> +	if (!output_config->name)
> +		output_config->name = strdup(WINDOW_TITLE);
>  
>  	weston_config_section_get_string(config_section,
>  					 "mode", &mode, "1024x600");
> -	if (sscanf(mode, "%dx%d", &output->width, &output->height) != 2) {
> +	if (sscanf(mode, "%dx%d", &output_config->width, &output_config->height) != 2) {
>  		weston_log("Invalid mode \"%s\" for output %s\n",
> -			   mode, output->name);
> -		output->width = 1024;
> -		output->height = 640;
> +			   mode, output_config->name);
> +		output_config->width = 1024;
> +		output_config->height = 640;
>  	}
>  	free(mode);
>  
>  	if (option_width)
> -		output->width = option_width;
> +		output_config->width = option_width;
>  	if (option_height)
> -		output->height = option_height;
> +		output_config->height = option_height;
>  
> -	weston_config_section_get_int(config_section, "scale", &output->scale, 1);
> +	weston_config_section_get_int(config_section, "scale", &output_config->scale, 1);
>  
>  	if (option_scale)
> -		output->scale = option_scale;
> +		output_config->scale = option_scale;
>  
>  	weston_config_section_get_string(config_section,
>  					 "transform", &t, "normal");
> -	if (weston_parse_transform(t, &output->transform) < 0)
> +	if (weston_parse_transform(t, &output_config->transform) < 0)
>  		weston_log("Invalid transform \"%s\" for output %s\n",
> -			   t, output->name);
> +			   t, output_config->name);
>  	free(t);
>  
>  }

-------------- 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/2f5d68d8/attachment.sig>


More information about the wayland-devel mailing list