]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
Replace TRUE/FALSE with true/false
authorPhil Sutter <phil@nwl.cc>
Fri, 25 Oct 2019 12:35:51 +0000 (14:35 +0200)
committerPhil Sutter <phil@nwl.cc>
Wed, 30 Oct 2019 09:01:06 +0000 (10:01 +0100)
And drop the conditional defines.

Signed-off-by: Phil Sutter <phil@nwl.cc>
Acked-by: Pablo Neira Ayuso <pablo@netfilter.org>
iptables/ip6tables.c
iptables/iptables.c
iptables/xtables-arp.c
iptables/xtables.c

index e48fdeb1248bdf5397289098981e6ef8667caafb..576c2cf8b0d9f05e1dc7c1e692ff08c1c6d02fff 100644 (file)
 #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)
index 255b61b11ec897a377335a36c6e09ebdb6d9fc37..88ef6cf666d4bac22e4a82d9e3b585c695fbdbb2 100644 (file)
 #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)
index ae69baf2a9346d9a21f1fee9dc61939a58d8ea05..4949ddd3d486cb2eb1fdd01fe241cbcfdfcc89cb 100644 (file)
 
 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)
index 805bd801fb06069401cdf71822bbbe13072e942e..8f9dc628d0029f26bc813fa2c611050bc73197ed 100644 (file)
 #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 &&