Re: [PATCH nft v4 2/3] src: expose delinearize/linearize structures and stmt_error()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux