[PATCH wayland 2/2] scanner: wrap few long lines

Bryce Harrington bryce at osg.samsung.com
Thu Jul 23 11:19:00 PDT 2015


On Thu, Jul 16, 2015 at 01:59:05PM +0200, Marek Chalupa wrote:
> Wrap few long lines to the length around 80 chars
> 
> Signed-off-by: Marek Chalupa <mchqwerty at gmail.com>

How hard core are we about maintaining the 80-column rule?  Frankly I
think the original code with the logging message on one line is more
readable.

> ---
>  src/scanner.c | 15 +++++++++++----
>  1 file changed, 11 insertions(+), 4 deletions(-)
> 
> diff --git a/src/scanner.c b/src/scanner.c
> index c652612..ac511f1 100644
> --- a/src/scanner.c
> +++ b/src/scanner.c
> @@ -597,7 +597,8 @@ start_element(void *data, const char *element_name, const char **atts)
>  		message->since = version;
>  
>  		if (strcmp(name, "destroy") == 0 && !message->destructor)
> -			fail(&ctx->loc, "destroy request should be destructor type");
> +			fail(&ctx->loc,
> +			     "destroy request should be destructor type");
>  
>  		ctx->message = message;
>  	} else if (strcmp(element_name, "arg") == 0) {
> @@ -620,7 +621,9 @@ start_element(void *data, const char *element_name, const char **atts)
>  			break;
>  		default:
>  			if (interface_name != NULL)
> -				fail(&ctx->loc, "interface attribute not allowed for type %s", type);
> +				fail(&ctx->loc,
> +				     "interface attribute not allowed for type"
> +				     " %s", type);
>  			break;
>  		}
>  
> @@ -629,10 +632,14 @@ start_element(void *data, const char *element_name, const char **atts)
>  		else if (strcmp(allow_null, "true") == 0)
>  			arg->nullable = 1;
>  		else
> -			fail(&ctx->loc, "invalid value for allow-null attribute (%s)", allow_null);
> +			fail(&ctx->loc,
> +			     "invalid value for allow-null attribute (%s)",
> +			     allow_null);
>  
>  		if (allow_null != NULL && !is_nullable_type(arg))
> -			fail(&ctx->loc, "allow-null is only valid for objects, strings, and arrays");
> +			fail(&ctx->loc,
> +			     "allow-null is only valid for objects, strings,"
> +			     " and arrays");
>  
>  		if (summary)
>  			arg->summary = xstrdup(summary);
> -- 
> 2.4.3
> 
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel


More information about the wayland-devel mailing list