[prev in list] [next in list] [prev in thread] [next in thread] 

List:       nmap-dev
Subject:    Re: [nmap-svn] r13330 - nmap
From:       David Fifield <david () bamsoftware ! com>
Date:       2009-05-25 2:24:34
Message-ID: 20090525022434.GB18391 () gusto
[Download RAW message or body]

On Sun, May 24, 2009 at 01:17:58AM -0600, Patrick Donnelly wrote:
> On Sun, May 24, 2009 at 12:43 AM, David Fifield <david@bamsoftware.com> wrote:
> > >From looking quickly at the diff the changes look good, except that I
> > think in this case the first line matches the usage in the rest of Nmap:
> >
> >> -static int l_nsock_connect(lua_State *L);
> >> +static int l_nsock_connect(lua_State * L);
> 
> You mean where the pointer (asterisk) is placed? I couldn't find a way
> to fix this. indent does a lot it's own whitespace changes that are
> unconfigurable. In the end I went ahead and used it because it
> accomplished the main goals in mind: (1) get rid of the tabs and (2)
> standardize the whitespace across the file. Keeping it similar to
> other NSE C code was a secondary (but important) goal.

I found a way to fix it, but it took some research. The problem is that
indent doesn't know that lua_State is a type name, so I suppose it
treats the * as a binary operator. It puts the star in the right place
when there's a normal type there:

const char *inet_ntop_both(int af, const void *v_addr, char *ipstring);

There's a way to fix it; use the -T option to inform indent that
lua_State is a typedef. That would have to be done for all the typedefs
we use. Maybe it's worth packaging as a script, like Linux has
scripts/Lindent? Their CodingStyle guidelines prohibit typedefs like
that so they don't have this particular problem.

It would be nice to have a more consistent style in the source files.

David Fifield

_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://SecLists.Org
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic