Skip to content

Commit c133dbe

Browse files
committed
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 <[email protected]>
1 parent 068f566 commit c133dbe

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/target/riscv/opcodes.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,18 @@
1818
#define MAX_VREG_NUM 31
1919
#define MAX_CSR_NUM 4095
2020

21-
#define MIN_INT12 ((int16_t)(-0x800))
22-
#define MAX_INT12 ((int16_t)0x7ff)
21+
#define MIN_INT12 (-0x800)
22+
#define MAX_INT12 0x7ff
2323

24-
#define MIN_INT13 ((int16_t)(-0x1000))
25-
#define MAX_INT13 ((int16_t)0xfff)
24+
#define MIN_INT13 (-0x1000)
25+
#define MAX_INT13 0xfff
2626

27-
#define MIN_INT21 ((int16_t)(-0x100000))
28-
#define MAX_INT21 ((int16_t)0xfffff)
27+
#define MIN_INT21 (-0x100000)
28+
#define MAX_INT21 0xfffff
2929

30-
#define MAX_UINT5 ((uint8_t)0x1f)
31-
#define MAX_UINT11 ((uint16_t)0x7ff)
32-
#define MAX_UINT12 ((uint16_t)0xfff)
30+
#define MAX_UINT5 0x1f
31+
#define MAX_UINT11 0x7ff
32+
#define MAX_UINT12 0xfff
3333

3434
static uint32_t bits(uint32_t value, unsigned int hi, unsigned int lo)
3535
{

0 commit comments

Comments
 (0)