]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
iptables: Remove explicit static variables initalization.
authorVarsha Rao <rvarsha016@gmail.com>
Wed, 29 Mar 2017 19:27:02 +0000 (00:57 +0530)
committerPablo Neira Ayuso <pablo@netfilter.org>
Thu, 6 Apr 2017 16:21:13 +0000 (18:21 +0200)
Static variables are initialized to zero by default, so remove explicit
initalization. This patch fixes the checkpatch issue.

Signed-off-by: Varsha Rao <rvarsha016@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
iptables/ip6tables-restore.c
iptables/ip6tables-save.c
iptables/iptables-restore.c
iptables/iptables-save.c
iptables/iptables-xml.c
iptables/xtables-arp.c
iptables/xtables-restore.c

index 8a47f09c950394b67bc288e5368c27f4d746b1e5..30a4ade7c0fddc75332ea4dcfbdabc660d325e72 100644 (file)
@@ -26,7 +26,7 @@
 #define DEBUGP(x, args...)
 #endif
 
-static int counters = 0, verbose = 0, noflush = 0, wait = 0;
+static int counters, verbose, noflush, wait;
 
 static struct timeval wait_interval = {
        .tv_sec = 1,
index 053413a9dfe2bd7b38d15e72346529207274a4c5..c2495d20feb91bf5484e4c6e0152b20d33f963be 100644 (file)
@@ -18,7 +18,7 @@
 #include "ip6tables.h"
 #include "ip6tables-multi.h"
 
-static int show_counters = 0;
+static int show_counters;
 
 static const struct option options[] = {
        {.name = "counters", .has_arg = false, .val = 'c'},
index 7bb06d84b1bfbb54ed2017dd1ebb0b0b4a2abdc9..15db3581cd8f0b02051e0e6ee59e474561fd10b3 100644 (file)
@@ -23,7 +23,7 @@
 #define DEBUGP(x, args...)
 #endif
 
-static int counters = 0, verbose = 0, noflush = 0, wait = 0;
+static int counters, verbose, noflush, wait;
 
 static struct timeval wait_interval = {
        .tv_sec = 1,
index e8ae9c6c4cc93571f159b25c3d561d0a5775b204..fbc605932c098121ace2811a0881981cb91cec47 100644 (file)
@@ -17,7 +17,7 @@
 #include "iptables.h"
 #include "iptables-multi.h"
 
-static int show_counters = 0;
+static int show_counters;
 
 static const struct option options[] = {
        {.name = "counters", .has_arg = false, .val = 'c'},
index 740a563c8e639a5c715ef229c154532251c2198f..2e093b5456fc142602f71c254b7ef9979b8534aa 100644 (file)
@@ -34,9 +34,9 @@ struct xtables_globals iptables_xml_globals = {
 static void print_usage(const char *name, const char *version)
            __attribute__ ((noreturn));
 
-static int verbose = 0;
+static int verbose;
 /* Whether to combine actions of sequential rules with identical conditions */
-static int combine = 0;
+static int combine;
 /* Keeping track of external matches and targets.  */
 static struct option options[] = {
        {"verbose", 0, NULL, 'v'},
@@ -73,10 +73,10 @@ parse_counters(char *string, struct xt_counters *ctr)
 
 /* global new argv and argc */
 static char *newargv[255];
-static unsigned int newargc = 0;
+static unsigned int newargc;
 
 static char *oldargv[255];
-static unsigned int oldargc = 0;
+static unsigned int oldargc;
 
 /* arg meta data, were they quoted, frinstance */
 static int newargvattr[255];
@@ -96,7 +96,7 @@ struct chain {
 
 #define maxChains 10240                /* max chains per table */
 static struct chain chains[maxChains];
-static int nextChain = 0;
+static int nextChain;
 
 /* funCtion adding one argument to newargv, updating newargc 
  * returns true if argument added, false otherwise */
index 6aa000a14d266c64a5017ff53e1e1b49a3fdfc47..4a968f4b9763faaf7940b07b7dee7b77e8691248 100644 (file)
@@ -150,7 +150,7 @@ static struct option original_opts[] = {
 int RUNTIME_NF_ARP_NUMHOOKS = 3;
 
 static struct option *opts = original_opts;
-static unsigned int global_option_offset = 0;
+static unsigned int global_option_offset;
 
 extern void xtables_exit_error(enum xtables_exittype status, const char *msg, ...) __attribute__((noreturn, format(printf,2,3)));
 struct xtables_globals arptables_globals = {
index a551c8c19f7ff5e8607704cee3b4791c90d06e33..6afa0d0ec5b1be652a67369de2b9a293cccac671 100644 (file)
@@ -24,7 +24,7 @@
 #define DEBUGP(x, args...)
 #endif
 
-static int counters = 0, verbose = 0, noflush = 0;
+static int counters, verbose, noflush;
 
 /* Keeping track of external matches and targets.  */
 static const struct option options[] = {