devicetree-compiler.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] srcpos: drop special handling of tab
@ 2018-01-22  8:08 Julia Lawall
  2018-01-23  6:06 ` David Gibson
  0 siblings, 1 reply; 2+ messages in thread
From: Julia Lawall @ 2018-01-22  8:08 UTC (permalink / raw)
  To: David Gibson
  Cc: Julia Lawall, Frank Rowand,
	devicetree-compiler-u79uwXL29TY76Z2rM5mHXA

Align column number with those reported by gcc.  Thus, do not make a tab
count as 8 spaces.

Signed-off-by: Julia Lawall <Julia.Lawall-L2FTfq7BK8M@public.gmane.org>
---

This replaces the patch about correcting column numbers.  That one should
be dropped.  This one, with the starting column as column 1 and no
expansion of tabs, follows the strategy of gcc.

julia

 srcpos.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/srcpos.c b/srcpos.c
index 9d38459..cb6ed0e 100644
--- a/srcpos.c
+++ b/srcpos.c
@@ -209,8 +209,6 @@ struct srcpos srcpos_empty = {
 	.file = NULL,
 };

-#define TAB_SIZE      8
-
 void srcpos_update(struct srcpos *pos, const char *text, int len)
 {
 	int i;
@@ -224,9 +222,6 @@ void srcpos_update(struct srcpos *pos, const char *text, int len)
 		if (text[i] == '\n') {
 			current_srcfile->lineno++;
 			current_srcfile->colno = 1;
-		} else if (text[i] == '\t') {
-			current_srcfile->colno =
-				ALIGN(current_srcfile->colno, TAB_SIZE);
 		} else {
 			current_srcfile->colno++;
 		}
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] srcpos: drop special handling of tab
  2018-01-22  8:08 [PATCH] srcpos: drop special handling of tab Julia Lawall
@ 2018-01-23  6:06 ` David Gibson
  0 siblings, 0 replies; 2+ messages in thread
From: David Gibson @ 2018-01-23  6:06 UTC (permalink / raw)
  To: Julia Lawall; +Cc: Frank Rowand, devicetree-compiler-u79uwXL29TY76Z2rM5mHXA

[-- Attachment #1: Type: text/plain, Size: 1416 bytes --]

On Mon, Jan 22, 2018 at 09:08:45AM +0100, Julia Lawall wrote:
> Align column number with those reported by gcc.  Thus, do not make a tab
> count as 8 spaces.
> 
> Signed-off-by: Julia Lawall <Julia.Lawall-L2FTfq7BK8M@public.gmane.org>
> ---
> 
> This replaces the patch about correcting column numbers.  That one should
> be dropped.  This one, with the starting column as column 1 and no
> expansion of tabs, follows the strategy of gcc.

Applied, thanks.

> 
> julia
> 
>  srcpos.c | 5 -----
>  1 file changed, 5 deletions(-)
> 
> diff --git a/srcpos.c b/srcpos.c
> index 9d38459..cb6ed0e 100644
> --- a/srcpos.c
> +++ b/srcpos.c
> @@ -209,8 +209,6 @@ struct srcpos srcpos_empty = {
>  	.file = NULL,
>  };
> 
> -#define TAB_SIZE      8
> -
>  void srcpos_update(struct srcpos *pos, const char *text, int len)
>  {
>  	int i;
> @@ -224,9 +222,6 @@ void srcpos_update(struct srcpos *pos, const char *text, int len)
>  		if (text[i] == '\n') {
>  			current_srcfile->lineno++;
>  			current_srcfile->colno = 1;
> -		} else if (text[i] == '\t') {
> -			current_srcfile->colno =
> -				ALIGN(current_srcfile->colno, TAB_SIZE);
>  		} else {
>  			current_srcfile->colno++;
>  		}

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-01-23  6:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-22  8:08 [PATCH] srcpos: drop special handling of tab Julia Lawall
2018-01-23  6:06 ` David Gibson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).