]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
datatype: use "enum byteorder" instead of int in set_datatype_alloc()
authorThomas Haller <thaller@redhat.com>
Wed, 20 Sep 2023 14:26:05 +0000 (16:26 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Wed, 20 Sep 2023 16:27:30 +0000 (18:27 +0200)
Use the enum types as we have them.

Signed-off-by: Thomas Haller <thaller@redhat.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
include/datatype.h
src/datatype.c
src/evaluate.c

index 52a2e943b252d01f33aa28a25ccf2317c471c863..4e838a38b34f1058d6042287269d113b12ac3337 100644 (file)
@@ -301,7 +301,7 @@ concat_subtype_lookup(uint32_t type, unsigned int n)
 }
 
 extern const struct datatype *
-set_datatype_alloc(const struct datatype *orig_dtype, unsigned int byteorder);
+set_datatype_alloc(const struct datatype *orig_dtype, enum byteorder byteorder);
 
 extern void time_print(uint64_t msec, struct output_ctx *octx);
 extern struct error_record *time_parse(const struct location *loc,
index 14d5a0e60146208f9ba823786dd9ab21e515ac87..8d65ab8bcd7f981d82b0a6a179ff1cf396b18ebc 100644 (file)
@@ -1310,7 +1310,7 @@ const struct datatype *concat_type_alloc(uint32_t type)
 }
 
 const struct datatype *set_datatype_alloc(const struct datatype *orig_dtype,
-                                         unsigned int byteorder)
+                                         enum byteorder byteorder)
 {
        struct datatype *dtype;
 
index 03586922848a7280db86089bca836a0af72d7a06..c404e9a83eccce9f0a0b24bd08e4a119e5467729 100644 (file)
@@ -1340,8 +1340,8 @@ static int expr_evaluate_bitwise(struct eval_ctx *ctx, struct expr **expr)
 {
        struct expr *op = *expr, *left = op->left;
        const struct datatype *dtype;
+       enum byteorder byteorder;
        unsigned int max_len;
-       int byteorder;
 
        if (ctx->stmt_len > left->len) {
                max_len = ctx->stmt_len;