Home page logo

nmap-dev logo Nmap Development mailing list archives

Re: [nmap-svn] r13330 - nmap
From: David Fifield <david () bamsoftware com>
Date: Sun, 24 May 2009 20:24:34 -0600

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
Archived at http://SecLists.Org

  By Date           By Thread  

Current thread:
[ Nmap | Sec Tools | Mailing Lists | Site News | About/Contact | Advertising | Privacy ]