]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
nftables: make pointers in string arrays constant
authorHarsha Sharma <harshasharmaiitr@gmail.com>
Fri, 6 Oct 2017 14:47:54 +0000 (20:17 +0530)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 9 Oct 2017 13:27:38 +0000 (15:27 +0200)
Static const char * array should be static const char *
const array as per linux-kernel coding style.

Signed-off-by: Harsha Sharma <harshasharmaiitr@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
src/erec.c
src/evaluate.c
src/rule.c
src/statement.c

index 76fdeb8635a135990d1b26524ef39375372d2de1..80806ffeee949fb7c2a6a4da5e330f587a713c51 100644 (file)
@@ -27,7 +27,7 @@ const struct location internal_location = {
        .indesc = &internal_indesc,
 };
 
-static const char *error_record_names[] = {
+static const char * const error_record_names[] = {
        [EREC_INFORMATIONAL]    = NULL,
        [EREC_WARNING]          = "Warning",
        [EREC_ERROR]            = "Error"
index 193ea1c7b5d1902bc0122fea8dde380862a5ef67..618e1889863c852eced0abed6c913b171bb9b31b 100644 (file)
@@ -32,7 +32,7 @@
 
 static int expr_evaluate(struct eval_ctx *ctx, struct expr **expr);
 
-static const char *byteorder_names[] = {
+static const char * const byteorder_names[] = {
        [BYTEORDER_INVALID]             = "invalid",
        [BYTEORDER_HOST_ENDIAN]         = "host endian",
        [BYTEORDER_BIG_ENDIAN]          = "big endian",
@@ -3423,7 +3423,7 @@ static int cmd_evaluate_export(struct eval_ctx *ctx, struct cmd *cmd)
                            ctx->debug_mask & DEBUG_NETLINK, ctx->octx);
 }
 
-static const char *cmd_op_name[] = {
+static const char * const cmd_op_name[] = {
        [CMD_INVALID]   = "invalid",
        [CMD_ADD]       = "add",
        [CMD_REPLACE]   = "replace",
index 67a828f70e1823bdee90241b7a83be3978ff8015..d744cf611100f6dbcd65a6d92601b8a9fb5a1997 100644 (file)
@@ -496,7 +496,7 @@ struct symbol *symbol_lookup(const struct scope *scope, const char *identifier)
        return NULL;
 }
 
-static const char *chain_type_str_array[] = {
+static const char * const chain_type_str_array[] = {
        "filter",
        "nat",
        "route",
@@ -515,7 +515,7 @@ const char *chain_type_name_lookup(const char *name)
        return NULL;
 }
 
-static const char *chain_hookname_str_array[] = {
+static const char * const chain_hookname_str_array[] = {
        "prerouting",
        "input",
        "forward",
@@ -1345,7 +1345,7 @@ static void obj_print_data(const struct obj *obj,
        }
 }
 
-static const char *obj_type_name_array[] = {
+static const char * const obj_type_name_array[] = {
        [NFT_OBJECT_COUNTER]    = "counter",
        [NFT_OBJECT_QUOTA]      = "quota",
        [NFT_OBJECT_CT_HELPER]  = "",
index 6166863bacedc909940006a206db79ce99adc067..11d067f82e7751a752517c95622bbd2059c2c050 100644 (file)
@@ -302,7 +302,7 @@ const char *get_unit(uint64_t u)
        return "error";
 }
 
-static const char *data_unit[] = {
+static const char * const data_unit[] = {
        "bytes",
        "kbytes",
        "mbytes",
@@ -496,7 +496,7 @@ static void print_nf_nat_flags(uint32_t flags, struct output_ctx *octx)
 
 static void nat_stmt_print(const struct stmt *stmt, struct output_ctx *octx)
 {
-       static const char *nat_types[] = {
+       static const char * const nat_types[] = {
                [NFT_NAT_SNAT]  = "snat",
                [NFT_NAT_DNAT]  = "dnat",
        };