Re: [PATCH wayland 2/2] scanner: wrap few long lines
On Thu, 23 Jul 2015 11:19:00 -0700 Bryce Harrington br...@osg.samsung.com wrote: 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 mchqwe...@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. Eh, case by case... my personal feeling is that breaking a string literal into pieces is not worth it if it's just a little too long. Breaking it might hinder grep-ability. If there is a natural point to split, like a newline, then of course split. Let's try to do the best for readability. *pq waves hands* I think I'd still split the other arguments from a function call, though, at the comma. Thanks, pq pgpjpictrvwaj.pgp Description: OpenPGP digital signature ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
Re: [PATCH wayland 2/2] scanner: wrap few long lines
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 mchqwe...@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@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
Re: [PATCH wayland 2/2] scanner: wrap few long lines
Reviewed-By: Derek Foreman der...@osg.samsung.com On 16/07/15 06:59 AM, Marek Chalupa wrote: Wrap few long lines to the length around 80 chars Signed-off-by: Marek Chalupa mchqwe...@gmail.com --- 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); ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
[PATCH wayland 2/2] scanner: wrap few long lines
Wrap few long lines to the length around 80 chars Signed-off-by: Marek Chalupa mchqwe...@gmail.com --- 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@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel