From: Phil Sutter <phil@nwl.cc>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: netfilter-devel@vger.kernel.org
Subject: [iptables PATCH 06/10] Replace TRUE/FALSE with true/false
Date: Mon, 28 Oct 2019 15:04:27 +0100 [thread overview]
Message-ID: <20191028140431.13882-7-phil@nwl.cc> (raw)
In-Reply-To: <20191028140431.13882-1-phil@nwl.cc>
And drop the conditional defines.
Signed-off-by: Phil Sutter <phil@nwl.cc>
---
iptables/ip6tables.c | 14 +++-----------
iptables/iptables.c | 12 ++----------
iptables/xtables-arp.c | 17 +++++------------
iptables/xtables.c | 11 ++---------
4 files changed, 12 insertions(+), 42 deletions(-)
diff --git a/iptables/ip6tables.c b/iptables/ip6tables.c
index e48fdeb1248bd..576c2cf8b0d9f 100644
--- a/iptables/ip6tables.c
+++ b/iptables/ip6tables.c
@@ -45,14 +45,6 @@
#include "ip6tables-multi.h"
#include "xshared.h"
-#ifndef TRUE
-#define TRUE 1
-#endif
-#ifndef FALSE
-#define FALSE 0
-#endif
-
-
#define NUMBER_OF_OPT ARRAY_SIZE(optflags)
static const char optflags[]
= { 'n', 's', 'd', 'p', 'j', 'v', 'x', 'i', 'o', '0', 'c'};
@@ -1525,7 +1517,7 @@ int do_command6(int argc, char *argv[], char **table,
xtables_error(PARAMETER_PROBLEM,
"multiple consecutive ! not"
" allowed");
- cs.invert = TRUE;
+ cs.invert = true;
optarg[0] = '\0';
continue;
}
@@ -1537,12 +1529,12 @@ int do_command6(int argc, char *argv[], char **table,
/*
* If new options were loaded, we must retry
* getopt immediately and not allow
- * cs.invert=FALSE to be executed.
+ * cs.invert=false to be executed.
*/
continue;
break;
}
- cs.invert = FALSE;
+ cs.invert = false;
}
if (!wait && wait_interval_set)
diff --git a/iptables/iptables.c b/iptables/iptables.c
index 255b61b11ec89..88ef6cf666d4b 100644
--- a/iptables/iptables.c
+++ b/iptables/iptables.c
@@ -41,14 +41,6 @@
#include <fcntl.h>
#include "xshared.h"
-#ifndef TRUE
-#define TRUE 1
-#endif
-#ifndef FALSE
-#define FALSE 0
-#endif
-
-
#define OPT_FRAGMENT 0x00800U
#define NUMBER_OF_OPT ARRAY_SIZE(optflags)
static const char optflags[]
@@ -1518,7 +1510,7 @@ int do_command4(int argc, char *argv[], char **table,
xtables_error(PARAMETER_PROBLEM,
"multiple consecutive ! not"
" allowed");
- cs.invert = TRUE;
+ cs.invert = true;
optarg[0] = '\0';
continue;
}
@@ -1531,7 +1523,7 @@ int do_command4(int argc, char *argv[], char **table,
continue;
break;
}
- cs.invert = FALSE;
+ cs.invert = false;
}
if (!wait && wait_interval_set)
diff --git a/iptables/xtables-arp.c b/iptables/xtables-arp.c
index ae69baf2a9346..4949ddd3d486c 100644
--- a/iptables/xtables-arp.c
+++ b/iptables/xtables-arp.c
@@ -55,13 +55,6 @@
typedef char arpt_chainlabel[32];
-#ifndef TRUE
-#define TRUE 1
-#endif
-#ifndef FALSE
-#define FALSE 0
-#endif
-
#define OPTION_OFFSET 256
#define OPT_NONE 0x00000U
@@ -383,7 +376,7 @@ check_inverse(const char option[], int *invert, int *optidx, int argc)
if (*invert)
xtables_error(PARAMETER_PROBLEM,
"Multiple `!' flags not allowed");
- *invert = TRUE;
+ *invert = true;
if (optidx) {
*optidx = *optidx+1;
if (argc && *optidx > argc)
@@ -391,9 +384,9 @@ check_inverse(const char option[], int *invert, int *optidx, int argc)
"no argument following `!'");
}
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
static void
@@ -942,7 +935,7 @@ int do_commandarp(struct nft_handle *h, int argc, char *argv[], char **table,
xtables_error(PARAMETER_PROBLEM,
"multiple consecutive ! not"
" allowed");
- invert = TRUE;
+ invert = true;
optarg[0] = '\0';
continue;
}
@@ -956,7 +949,7 @@ int do_commandarp(struct nft_handle *h, int argc, char *argv[], char **table,
}
break;
}
- invert = FALSE;
+ invert = false;
}
if (cs.target)
diff --git a/iptables/xtables.c b/iptables/xtables.c
index 805bd801fb060..8f9dc628d0029 100644
--- a/iptables/xtables.c
+++ b/iptables/xtables.c
@@ -43,13 +43,6 @@
#include "nft-shared.h"
#include "nft.h"
-#ifndef TRUE
-#define TRUE 1
-#endif
-#ifndef FALSE
-#define FALSE 0
-#endif
-
#define OPT_FRAGMENT 0x00800U
#define NUMBER_OF_OPT ARRAY_SIZE(optflags)
static const char optflags[]
@@ -952,7 +945,7 @@ void do_parse(struct nft_handle *h, int argc, char *argv[],
xtables_error(PARAMETER_PROBLEM,
"multiple consecutive ! not"
" allowed");
- cs->invert = TRUE;
+ cs->invert = true;
optarg[0] = '\0';
continue;
}
@@ -965,7 +958,7 @@ void do_parse(struct nft_handle *h, int argc, char *argv[],
continue;
break;
}
- cs->invert = FALSE;
+ cs->invert = false;
}
if (strcmp(p->table, "nat") == 0 &&
--
2.23.0
next prev parent reply other threads:[~2019-10-28 14:05 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-28 14:04 [iptables PATCH 00/10] Reduce code size around arptables-nft Phil Sutter
2019-10-28 14:04 ` [iptables PATCH 01/10] ip6tables, xtables-arp: Drop unused struct pprot Phil Sutter
2019-10-28 14:04 ` [iptables PATCH 02/10] xshared: Share a common add_command() implementation Phil Sutter
2019-10-28 14:04 ` [iptables PATCH 03/10] xshared: Share a common implementation of parse_rulenumber() Phil Sutter
2019-10-28 14:04 ` [iptables PATCH 04/10] Merge CMD_* defines Phil Sutter
2019-10-28 14:04 ` [iptables PATCH 05/10] xtables-arp: Drop generic_opt_check() Phil Sutter
2019-10-28 14:04 ` Phil Sutter [this message]
2019-10-28 14:04 ` [iptables PATCH 07/10] xtables-arp: Integrate OPT_* defines into xshared.h Phil Sutter
2019-10-28 14:04 ` [iptables PATCH 08/10] xtables-arp: Drop some unused variables Phil Sutter
2019-10-28 14:04 ` [iptables PATCH 09/10] xtables-arp: Use xtables_parse_interface() Phil Sutter
2019-10-28 14:04 ` [iptables PATCH 10/10] nft-arp: Use xtables_print_mac_and_mask() Phil Sutter
2019-10-28 14:17 ` [iptables PATCH 00/10] Reduce code size around arptables-nft Pablo Neira Ayuso
2019-10-28 14:28 ` Phil Sutter
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=20191028140431.13882-7-phil@nwl.cc \
--to=phil@nwl.cc \
--cc=netfilter-devel@vger.kernel.org \
--cc=pablo@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 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).