netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ana Rey <anarey@gmail.com>
To: netfilter-devel@vger.kernel.org
Cc: Ana Rey <anarey@gmail.com>
Subject: [libnftnl PATCH 4/5] expr: byteorder: Rename variables in nft_rule_expr_byteorder_json_parse functions
Date: Thu, 19 Jun 2014 17:07:09 +0200	[thread overview]
Message-ID: <1403190430-22173-5-git-send-email-anarey@gmail.com> (raw)
In-Reply-To: <1403190430-22173-1-git-send-email-anarey@gmail.com>

Renames some variables for code readability reasons.

Signed-off-by: Ana Rey <anarey@gmail.com>
---
 src/expr/byteorder.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/src/expr/byteorder.c b/src/expr/byteorder.c
index ad7721f..e56af3f 100644
--- a/src/expr/byteorder.c
+++ b/src/expr/byteorder.c
@@ -199,18 +199,18 @@ nft_rule_expr_byteorder_json_parse(struct nft_rule_expr *e, json_t *root,
 {
 #ifdef JSON_PARSING
 	const char *op;
-	uint32_t uval32;
+	uint32_t sreg, dreg, len, size;
 	int ntoh;
 
-	if (nft_jansson_parse_reg(root, "sreg", NFT_TYPE_U32, &uval32, err) < 0)
+	if (nft_jansson_parse_reg(root, "sreg", NFT_TYPE_U32, &sreg, err) < 0)
 		return -1;
 
-	nft_rule_expr_set_u32(e, NFT_EXPR_BYTEORDER_SREG, uval32);
+	nft_rule_expr_set_u32(e, NFT_EXPR_BYTEORDER_SREG, sreg);
 
-	if (nft_jansson_parse_reg(root, "dreg", NFT_TYPE_U32, &uval32, err) < 0)
+	if (nft_jansson_parse_reg(root, "dreg", NFT_TYPE_U32, &dreg, err) < 0)
 		return -1;
 
-	nft_rule_expr_set_u32(e, NFT_EXPR_BYTEORDER_DREG, uval32);
+	nft_rule_expr_set_u32(e, NFT_EXPR_BYTEORDER_DREG, dreg);
 
 	op = nft_jansson_parse_str(root, "op", err);
 	if (op == NULL)
@@ -222,15 +222,15 @@ nft_rule_expr_byteorder_json_parse(struct nft_rule_expr *e, json_t *root,
 
 	nft_rule_expr_set_u32(e, NFT_EXPR_BYTEORDER_OP, ntoh);
 
-	if (nft_jansson_parse_val(root, "len", NFT_TYPE_U32, &uval32, err) < 0)
+	if (nft_jansson_parse_val(root, "len", NFT_TYPE_U32, &len, err) < 0)
 		return -1;
 
-	nft_rule_expr_set_u32(e, NFT_EXPR_BYTEORDER_LEN, uval32);
+	nft_rule_expr_set_u32(e, NFT_EXPR_BYTEORDER_LEN, len);
 
-	if (nft_jansson_parse_val(root, "size", NFT_TYPE_U32, &uval32, err) < 0)
+	if (nft_jansson_parse_val(root, "size", NFT_TYPE_U32, &size, err) < 0)
 		return -1;
 
-	nft_rule_expr_set_u32(e, NFT_EXPR_BYTEORDER_SIZE, uval32);
+	nft_rule_expr_set_u32(e, NFT_EXPR_BYTEORDER_SIZE, size);
 
 	return 0;
 #else
-- 
2.0.0


  parent reply	other threads:[~2014-06-19 15:07 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-19 15:07 [libnftnl PATCH 0/5] expr: bitwise: Do not print unset values Ana Rey
2014-06-19 15:07 ` [libnftnl PATCH 1/5] expr: byteorder: Get a nft_rule_expr type in nft_rule_expr_byteorder_snprintf_* functions Ana Rey
2014-06-19 15:07 ` [libnftnl PATCH 2/5] expr: byteorder: Use nft_rule_expr_set_* in the xml parsing code Ana Rey
2014-06-19 15:07 ` [libnftnl PATCH 3/5] expr: byteorder: Do not print unset values in xml file Ana Rey
2014-06-20  7:12   ` Arturo Borrero Gonzalez
2014-06-19 15:07 ` Ana Rey [this message]
2014-06-19 15:07 ` [libnftnl PATCH 5/5] expr: byteorder: Do not print unset values in json Ana Rey
2014-06-20  7:16 ` [libnftnl PATCH 0/5] expr: bitwise: Do not print unset values Arturo Borrero Gonzalez

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=1403190430-22173-5-git-send-email-anarey@gmail.com \
    --to=anarey@gmail.com \
    --cc=netfilter-devel@vger.kernel.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 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).