diff mbox series

[nft,4/9] datatype: use "enum byteorder" instead of int in set_datatype_alloc()

Message ID 20230920142958.566615-5-thaller@redhat.com
State Accepted
Delegated to: Pablo Neira
Headers show
Series various cleanups related to enums and struct datatype | expand

Commit Message

Thomas Haller Sept. 20, 2023, 2:26 p.m. UTC
Use the enum types as we have them.

Signed-off-by: Thomas Haller <thaller@redhat.com>
---
 include/datatype.h | 2 +-
 src/datatype.c     | 2 +-
 src/evaluate.c     | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

Comments

Pablo Neira Ayuso Sept. 20, 2023, 4:27 p.m. UTC | #1
On Wed, Sep 20, 2023 at 04:26:05PM +0200, Thomas Haller wrote:
> Use the enum types as we have them.

Applied, thanks
diff mbox series

Patch

diff --git a/include/datatype.h b/include/datatype.h
index 5b85adc15857..202935bd322f 100644
--- a/include/datatype.h
+++ b/include/datatype.h
@@ -295,7 +295,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,
diff --git a/src/datatype.c b/src/datatype.c
index c5d88d9a90b6..6e4bfc4c0de7 100644
--- a/src/datatype.c
+++ b/src/datatype.c
@@ -1304,7 +1304,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;
 
diff --git a/src/evaluate.c b/src/evaluate.c
index 03586922848a..933fddd8996d 100644
--- a/src/evaluate.c
+++ b/src/evaluate.c
@@ -1341,7 +1341,7 @@  static int expr_evaluate_bitwise(struct eval_ctx *ctx, struct expr **expr)
 	struct expr *op = *expr, *left = op->left;
 	const struct datatype *dtype;
 	unsigned int max_len;
-	int byteorder;
+	enum byteorder byteorder;
 
 	if (ctx->stmt_len > left->len) {
 		max_len = ctx->stmt_len;