From c133dbef03cb7217fee140aee543c773184eb511 Mon Sep 17 00:00:00 2001 From: Jan Matyas Date: Fri, 14 Feb 2025 13:56:49 +0100 Subject: [PATCH] opcodes.h: Do not use casts in MIN_* and MAX_* macros This is to make it consistent with stdint.h. Change-Id: Ibba824dad431b3a1675700ad4cc15f3e39a187f7 Signed-off-by: Jan Matyas --- src/target/riscv/opcodes.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/target/riscv/opcodes.h b/src/target/riscv/opcodes.h index 7cc92bcb7..e4efc5b05 100644 --- a/src/target/riscv/opcodes.h +++ b/src/target/riscv/opcodes.h @@ -18,18 +18,18 @@ #define MAX_VREG_NUM 31 #define MAX_CSR_NUM 4095 -#define MIN_INT12 ((int16_t)(-0x800)) -#define MAX_INT12 ((int16_t)0x7ff) +#define MIN_INT12 (-0x800) +#define MAX_INT12 0x7ff -#define MIN_INT13 ((int16_t)(-0x1000)) -#define MAX_INT13 ((int16_t)0xfff) +#define MIN_INT13 (-0x1000) +#define MAX_INT13 0xfff -#define MIN_INT21 ((int16_t)(-0x100000)) -#define MAX_INT21 ((int16_t)0xfffff) +#define MIN_INT21 (-0x100000) +#define MAX_INT21 0xfffff -#define MAX_UINT5 ((uint8_t)0x1f) -#define MAX_UINT11 ((uint16_t)0x7ff) -#define MAX_UINT12 ((uint16_t)0xfff) +#define MAX_UINT5 0x1f +#define MAX_UINT11 0x7ff +#define MAX_UINT12 0xfff static uint32_t bits(uint32_t value, unsigned int hi, unsigned int lo) {