[PATCH weston v3 09/17] compositor-wayland: refactor wayland_backend_config_add_new_output

Pekka Paalanen ppaalanen at gmail.com
Fri May 6 14:29:48 UTC 2016


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

> Rename new_config to config in wayland_backend_config_add_new_output
> function.
> 
> Signed-off-by: Benoit Gschwind <gschwind at gnu-log.net>
> ---
>  src/main.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/src/main.c b/src/main.c
> index 8d42ec5..3d643f1 100644
> --- a/src/main.c
> +++ b/src/main.c
> @@ -1027,16 +1027,16 @@ wayland_backend_config_release(struct weston_wayland_backend_config *new_config)
>   * structure is NOT cleared nor set to default values.
>   */
>  static struct weston_wayland_backend_output_config *
> -wayland_backend_config_add_new_output(struct weston_wayland_backend_config *new_config) {
> +wayland_backend_config_add_new_output(struct weston_wayland_backend_config *config) {

Hi,

I already comment this same place before, that function's braces got
their own lines.

Also what you have in commit message body would really be a matter for
the subject/summary. This is not refactoring, this is renaming an
argument.

Otherwise
Reviewed-by: Pekka Paalanen <pekka.paalanen at collabora.co.uk>


Thanks,
pq

>  	struct weston_wayland_backend_output_config *outputs;
>  
> -	outputs = realloc(new_config->outputs,
> -			  (new_config->num_outputs + 1) * sizeof(struct weston_wayland_backend_output_config));
> +	outputs = realloc(config->outputs,
> +			  (config->num_outputs + 1) * sizeof(struct weston_wayland_backend_output_config));
>  	if (!outputs)
>  		return NULL;
> -	new_config->num_outputs += 1;
> -	new_config->outputs = outputs;
> -	return &(new_config->outputs[new_config->num_outputs - 1]);
> +	config->num_outputs += 1;
> +	config->outputs = outputs;
> +	return &(config->outputs[config->num_outputs - 1]);
>  }
>  
>  static int

-------------- 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/afe4dec9/attachment-0001.sig>


More information about the wayland-devel mailing list