[PATCH weston v3 01/17] compositor-wayland: fix misc. typo

Pekka Paalanen ppaalanen at gmail.com
Fri May 6 13:02:27 UTC 2016


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

> Signed-off-by: Benoit Gschwind <gschwind at gnu-log.net>
> ---
>  src/compositor-wayland.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/src/compositor-wayland.c b/src/compositor-wayland.c
> index d0d1082..83f31de 100644
> --- a/src/compositor-wayland.c
> +++ b/src/compositor-wayland.c
> @@ -2328,6 +2328,7 @@ wayland_backend_destroy(struct wayland_backend *b)
>  static void
>  wayland_backend_config_release(struct weston_wayland_backend_config *new_config) {

Opening brace for a function belongs on a line of its own.

>  	int i;
> +
>  	for (i = 0; i < new_config->num_outputs; ++i) {
>  		free(new_config->outputs[i].name);
>  	}
> @@ -2344,13 +2345,14 @@ wayland_backend_config_release(struct weston_wayland_backend_config *new_config)
>  static struct weston_wayland_backend_output_config *
>  wayland_backend_config_add_new_output(struct weston_wayland_backend_config *new_config) {
>  	struct weston_wayland_backend_output_config *outputs;
> +
>  	outputs = realloc(new_config->outputs,
> -			  (new_config->num_outputs+1)*sizeof(struct weston_wayland_backend_output_config));
> +			  (new_config->num_outputs + 1) * sizeof(struct weston_wayland_backend_output_config));

Too long lines should be wrapped, but in this case it might require a
helper variable to do that.
	size_t elem_size = 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]);
> +	return &(new_config->outputs[new_config->num_outputs - 1]);
>  }
>  
>  static int

Hi,

these aren't typos, they are whitespace fixes. You could also fix the
function braces while at it.


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


More information about the wayland-devel mailing list