netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: "Pablo M. Bermudo Garay" <pablombg@gmail.com>
Cc: netfilter-devel@vger.kernel.org,
	Arturo Borrero Gonzalez <arturo.borrero.glez@gmail.com>
Subject: Re: [PATCH nft v4 2/3] src: expose delinearize/linearize structures and stmt_error()
Date: Sat, 9 Jul 2016 13:40:40 +0200	[thread overview]
Message-ID: <20160709114040.GC1357@salvia> (raw)
In-Reply-To: <20160709102454.2978-2-pablombg@gmail.com>

On Sat, Jul 09, 2016 at 12:24:53PM +0200, Pablo M. Bermudo Garay wrote:
> diff --git a/src/evaluate.c b/src/evaluate.c
> index f24e5f3..1a02ecd 100644
> --- a/src/evaluate.c
> +++ b/src/evaluate.c
> @@ -37,40 +37,18 @@ static const char *byteorder_names[] = {
>  	[BYTEORDER_BIG_ENDIAN]		= "big endian",
>  };
>  
> -static int __fmtstring(4, 5) __stmt_binary_error(struct eval_ctx *ctx,
> -						 const struct location *l1,
> -						 const struct location *l2,
> -						 const char *fmt, ...)
> -{
> -	struct error_record *erec;
> -	va_list ap;
> -
> -	va_start(ap, fmt);
> -	erec = erec_vcreate(EREC_ERROR, l1, fmt, ap);
> -	if (l2 != NULL)
> -		erec_add_location(erec, l2);
> -	va_end(ap);
> -	erec_queue(erec, ctx->msgs);
> -	return -1;
> -
> -}
> -
> -#define stmt_error(ctx, s1, fmt, args...) \
> -	__stmt_binary_error(ctx, &(s1)->location, NULL, fmt, ## args)
> -#define stmt_binary_error(ctx, s1, s2, fmt, args...) \
> -	__stmt_binary_error(ctx, &(s1)->location, &(s2)->location, fmt, ## args)
>  #define chain_error(ctx, s1, fmt, args...) \
> -	__stmt_binary_error(ctx, &(s1)->location, NULL, fmt, ## args)
> +	__binary_error(ctx, &(s1)->location, NULL, fmt, ## args)
>  #define monitor_error(ctx, s1, fmt, args...) \
> -	__stmt_binary_error(ctx, &(s1)->location, NULL, fmt, ## args)
> +	__binary_error(ctx, &(s1)->location, NULL, fmt, ## args)
>  #define cmd_error(ctx, fmt, args...) \
> -	__stmt_binary_error(ctx, &(ctx->cmd)->location, NULL, fmt, ## args)
> +	__binary_error(ctx, &(ctx->cmd)->location, NULL, fmt, ## args)
>  #define handle_error(ctx, fmt, args...) \
> -	__stmt_binary_error(ctx, &ctx->cmd->handle.handle.location, NULL, fmt, ## args)
> +	__binary_error(ctx, &ctx->cmd->handle.handle.location, NULL, fmt, ## args)
>  #define position_error(ctx, fmt, args...) \
> -	__stmt_binary_error(ctx, &ctx->cmd->handle.position.location, NULL, fmt, ## args)
> +	__binary_error(ctx, &ctx->cmd->handle.position.location, NULL, fmt, ## args)
>  #define handle_position_error(ctx, fmt, args...) \
> -	__stmt_binary_error(ctx, &ctx->cmd->handle.handle.location, &ctx->cmd->handle.position.location, fmt, ## args)
> +	__binary_error(ctx, &ctx->cmd->handle.handle.location, &ctx->cmd->handle.position.location, fmt, ## args)
>  
>  static int __fmtstring(3, 4) set_error(struct eval_ctx *ctx,
>  				       const struct set *set,

I think this rename from __stmt_binary_error() to __binary_error()
should come as a separated patch.

  reply	other threads:[~2016-07-09 11:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-09 10:24 [PATCH nft v4 1/3] include: cache ip_tables.h, ip6_tables.h, arp_tables.h and ebtables.h Pablo M. Bermudo Garay
2016-07-09 10:24 ` [PATCH nft v4 2/3] src: expose delinearize/linearize structures and stmt_error() Pablo M. Bermudo Garay
2016-07-09 11:40   ` Pablo Neira Ayuso [this message]
2016-07-09 10:24 ` [PATCH nft v4 3/3] src: add xt compat support Pablo M. Bermudo Garay
2016-07-09 11:39   ` Pablo Neira Ayuso

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=20160709114040.GC1357@salvia \
    --to=pablo@netfilter.org \
    --cc=arturo.borrero.glez@gmail.com \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablombg@gmail.com \
    /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 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).