diffutils: C labels misdetected as functions (Was: [PATCH 1/2] run scripts/Lindent on it to match Documentation/CodingStyle)

2007-07-21 Thread Simon Arlott
(Bcc: [EMAIL PROTECTED]) The patch below stops diffutils treating C labels starting in column 1 as function names. On 21/07/07 14:52, Matthew Wilcox wrote: > On Sat, Jul 21, 2007 at 07:11:01AM +0100, Simon Arlott wrote: >> Changing the code to fix a utility bug is madness. I think it's been >> fi

Re: [PATCH 1/2] run scripts/Lindent on it to match Documentation/CodingStyle

2007-07-21 Thread Jan Engelhardt
On Jul 20 2007 11:07, Matthew Wilcox wrote: >sed -i -e 's/^\t* \(\w*:\)/ \1/' "$@" > >Any regexp ninjas want to have a go at something better? You want \w+. [ perl -i -pe 's/^\t* {6}(\w+:)/ $1/' "$@" Whether that is "better" depends on the user who uses it :) ] Jan -- - To uns

Re: [PATCH 1/2] run scripts/Lindent on it to match Documentation/CodingStyle

2007-07-21 Thread Matthew Wilcox
On Sat, Jul 21, 2007 at 07:11:01AM +0100, Simon Arlott wrote: > Changing the code to fix a utility bug is madness. I think it's been > fixed too... I just downloaded the source from CVS and it hasn't: --- test1.c 2007-07-21 09:49:02.0 -0400 +++ test2.c 2007-07-21 09:49:12.

Re: [PATCH 1/2] run scripts/Lindent on it to match Documentation/CodingStyle

2007-07-21 Thread rae l
On 7/21/07, Simon Arlott <[EMAIL PROTECTED]> wrote: Changing the code to fix a utility bug is madness. I think it's been fixed too... Now I also think it's the utility's bug, that hardly do nothing on indent the source. -- Denis Cheng Linux Application Developer "One of my most productive days

Re: [PATCH 1/2] run scripts/Lindent on it to match Documentation/CodingStyle

2007-07-20 Thread Simon Arlott
On 20/07/07 19:00, Matthew Wilcox wrote: > On Fri, Jul 20, 2007 at 06:36:02PM +0100, Simon Arlott wrote: >> Mass >> replacing any labels run through Lindent with space prefixes would seem >> like a bad idea :/ > > We don't tend to mass-run code through Lindent. This may or may not be > a bad thin

Re: [PATCH 1/2] run scripts/Lindent on it to match Documentation/CodingStyle

2007-07-20 Thread Simon Arlott
On 20/07/07 19:00, Matthew Wilcox wrote: > On Fri, Jul 20, 2007 at 06:36:02PM +0100, Simon Arlott wrote: >> On 20/07/07 18:07, Matthew Wilcox wrote: >> > sed -i -e 's/^\t* \(\w*:\)/ \1/' "$@" >> > >> > which will replace the leading tabs and spaces with one space. >> >> ... isn't the space t

Fixing lables after GNU indent (Re: [PATCH 1/2] run scripts/Lindent on it to match Documentation/CodingStyle)

2007-07-20 Thread Oleg Verych
[] > > > sed -i -e 's/^\t* \(\w*:\)/ \1/' "$@" > > > > > > which will replace the leading tabs and spaces with one space. > > > It should leave case labels unmolested, as they should be indented with > > > tabs, not 6 spaces. > > > > > > Any regexp ninjas want to have a go at something better?

Re: [PATCH 1/2] run scripts/Lindent on it to match Documentation/CodingStyle

2007-07-20 Thread Matthew Wilcox
On Fri, Jul 20, 2007 at 10:50:42PM +0200, Oleg Verych wrote: > > Of course, we can't add this flag to Lindent until it's widely > > circulating amongst the distributions. Perhaps we can add this to > > Lindent in the meantime: > > > > sed -i -e 's/^\t* \(\w*:\)/ \1/' "$@" > > > > which will r

Re: [PATCH 1/2] run scripts/Lindent on it to match Documentation/CodingStyle

2007-07-20 Thread Oleg Verych
* Date: Fri, 20 Jul 2007 11:07:43 -0600 > Of course, we can't add this flag to Lindent until it's widely > circulating amongst the distributions. Perhaps we can add this to > Lindent in the meantime: > > sed -i -e 's/^\t* \(\w*:\)/ \1/' "$@" > > which will replace the leading tabs and spaces

Re: [PATCH 1/2] run scripts/Lindent on it to match Documentation/CodingStyle

2007-07-20 Thread Matthew Wilcox
On Fri, Jul 20, 2007 at 06:36:02PM +0100, Simon Arlott wrote: > On 20/07/07 18:07, Matthew Wilcox wrote: > > sed -i -e 's/^\t* \(\w*:\)/ \1/' "$@" > > > > which will replace the leading tabs and spaces with one space. > > ... isn't the space thing a workaround for a "diff -p" bug? Yes. I l

Re: [PATCH 1/2] run scripts/Lindent on it to match Documentation/CodingStyle

2007-07-20 Thread Simon Arlott
On 20/07/07 18:07, Matthew Wilcox wrote: > Of course, we can't add this flag to Lindent until it's widely > circulating amongst the distributions. Perhaps we can add this to > Lindent in the meantime: > > sed -i -e 's/^\t* \(\w*:\)/ \1/' "$@" > > which will replace the leading tabs and spac

Re: [PATCH 1/2] run scripts/Lindent on it to match Documentation/CodingStyle

2007-07-20 Thread Matthew Wilcox
On Sun, Jul 15, 2007 at 10:53:45AM +0100, Simon Arlott wrote: > > - } else if (base_addr > 0x100) { /* Check a single specified location. */ > > + } else if (base_addr > 0x100) { /* Check a single specified location. */ > > What is Lit doing here?! It's changed "{/*" to "{/*"... > > > - } e

Re: [PATCH 1/2] run scripts/Lindent on it to match Documentation/CodingStyle

2007-07-20 Thread Matthew Wilcox
On Sun, Jul 15, 2007 at 10:53:45AM +0100, Simon Arlott wrote: > Do people ever check what Lindent does? [...] > > -out1: > > + out1: > > NAK: A perfectly valid non-indented label is now indented by 6 spaces. I tracked down why indent does this. It's actually hard-coded to indent by 2 fewer

Re: [PATCH 1/2] run scripts/Lindent on it to match Documentation/CodingStyle

2007-07-15 Thread Simon Arlott
On 15/07/07 09:52, Denis Cheng wrote: > Signed-off-by: Denis Cheng <[EMAIL PROTECTED]> > --- > drivers/net/wireless/wavelan.c | 806 > ++-- > 1 files changed, 369 insertions(+), 437 deletions(-) Do people ever check what Lindent does? > - } else if (base

Re: [PATCH 1/2] run scripts/Lindent on it to match Documentation/CodingStyle

2007-07-15 Thread Christoph Hellwig
On Sun, Jul 15, 2007 at 04:52:50PM +0800, Denis Cheng wrote: > - return ((char *) NULL); > + return ((char *)NULL); casting NULL to another pointer type is dumb to start with. Please replace this line with return NULL; - To unsubscribe from this list: send the line "unsubscribe