All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: Amin Azez <azez@ufomechanic.net>
Cc: Harald Welte <laforge@netfilter.org>,
	Netfilter Development Mailinglist
	<netfilter-devel@lists.netfilter.org>
Subject: Re: new code; iptables-xml for iptables package.
Date: Fri, 10 Nov 2006 14:07:14 +0100	[thread overview]
Message-ID: <45547982.2070606@trash.net> (raw)
In-Reply-To: <455457C8.4030205@ufomechanic.net>

Amin Azez wrote:
> * Patrick McHardy wrote, On 09/11/06 18:34:
>>
>>We can do that, but the code needs some serious coding style
>>cleanup before that. Please look at Documentation/CodingStyle
>>from the kernel source, it pretty much applies to iptables as
>>well.
>>  
> 
> Thanks for the tip.
> 
> Does this meet with approval?

Much better, thanks. Two minor nitpicks: return is not a function,
so I prefer return x to return (x). Functions and function calls
should have their opening parens directly following the function
name (unlike loops etc. where we use a space). But don't bother
changing it unless you feel really motivated :)

One real comment below ..

> 		} else if ((buffer[0] == ':') && (curTable[0])) {
> 			/* New chain. */
> 			char *policy, *chain;
> 
> 			chain = strtok (buffer + 1, " \t\n");
> 			DEBUGP ("line %u, chain '%s'\n", line, chain);
> 			if (!chain) {
> 				exit_error (PARAMETER_PROBLEM,
> 					    "%s: line %u chain name invalid\n",
> 					    program_name, line);
> 				exit (1);
> 			}
> 
> 			DEBUGP ("Creating new chain '%s'\n", chain);
> 
> 			policy = strtok (NULL, " \t\n");
> 			DEBUGP ("line %u, policy '%s'\n", line, policy);
> 			if (!policy) {
> 				exit_error (PARAMETER_PROBLEM,
> 					    "%s: line %u policy invalid\n",
> 					    program_name, line);
> 				exit (1);
> 			}
> 
> 			struct ipt_counters count;
> 
> 			char *ctrs;

This doesn't compile with old gcc versions. Unlike the kernel we still
support gcc-2.95 (I think), so please make sure you have no declarations
after statements.

  reply	other threads:[~2006-11-10 13:07 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-09 11:32 new code; iptables-xml for iptables package Amin Azez
2006-11-09 18:34 ` Patrick McHardy
2006-11-10 10:43   ` Amin Azez
2006-11-10 13:07     ` Patrick McHardy [this message]
2006-11-10 13:28       ` Amin Azez
2006-11-10 13:51         ` Patrick McHardy
2006-11-10 14:29           ` Amin Azez
2006-11-10 14:42             ` Patrick McHardy
2006-11-10 14:59               ` Amin Azez
2006-11-10 15:11                 ` Patrick McHardy
2006-11-10 15:57                   ` Amin Azez
2006-11-13 19:43                     ` Patrick McHardy
2006-11-10 14:43 ` Pablo Neira Ayuso
2006-11-10 15:13   ` Amin Azez
2006-11-22 17:37 ` Glen Turner
2006-11-23 12:55   ` Amin Azez

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=45547982.2070606@trash.net \
    --to=kaber@trash.net \
    --cc=azez@ufomechanic.net \
    --cc=laforge@netfilter.org \
    --cc=netfilter-devel@lists.netfilter.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.