Skip to content

Commit

Permalink
Use bracket-less met-programming macro to fix Windows build warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rot127 committed Dec 18, 2023
1 parent be5cf12 commit 548cc56
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions librz/analysis/arch/arm/arm_accessors64.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,20 @@

#include <capstone/capstone.h>

#define IMM64(x) (ut64)(insn->detail->CS_aarch64().operands[x].imm)
#define INSOP64(x) insn->detail->CS_aarch64().operands[x]
#define IMM64(x) (ut64)(insn->detail->CS_aarch64_.operands[x].imm)
#define INSOP64(x) insn->detail->CS_aarch64_.operands[x]

#define REGID64(x) insn->detail->CS_aarch64().operands[x].reg
#define REGBASE64(x) insn->detail->CS_aarch64().operands[x].mem.base
#define REGID64(x) insn->detail->CS_aarch64_.operands[x].reg
#define REGBASE64(x) insn->detail->CS_aarch64_.operands[x].mem.base
// s/index/base|reg/
#define HASMEMINDEX64(x) (insn->detail->CS_aarch64().operands[x].mem.index != CS_AARCH64(_REG_INVALID))
#define MEMDISP64(x) (ut64) insn->detail->CS_aarch64().operands[x].mem.disp
#define ISIMM64(x) (insn->detail->CS_aarch64().operands[x].type == CS_AARCH64(_OP_IMM))
#define ISREG64(x) (insn->detail->CS_aarch64().operands[x].type == CS_AARCH64(_OP_REG))
#define ISMEM64(x) (insn->detail->CS_aarch64().operands[x].type == CS_AARCH64(_OP_MEM))
#define HASMEMINDEX64(x) (insn->detail->CS_aarch64_.operands[x].mem.index != CS_AARCH64(_REG_INVALID))
#define MEMDISP64(x) (ut64) insn->detail->CS_aarch64_.operands[x].mem.disp
#define ISIMM64(x) (insn->detail->CS_aarch64_.operands[x].type == CS_AARCH64(_OP_IMM))
#define ISREG64(x) (insn->detail->CS_aarch64_.operands[x].type == CS_AARCH64(_OP_REG))
#define ISMEM64(x) (insn->detail->CS_aarch64_.operands[x].type == CS_AARCH64(_OP_MEM))

#define LSHIFT2_64(x) insn->detail->CS_aarch64().operands[x].shift.value
#define OPCOUNT64() insn->detail->CS_aarch64().op_count
#define LSHIFT2_64(x) insn->detail->CS_aarch64_.operands[x].shift.value
#define OPCOUNT64() insn->detail->CS_aarch64_.op_count

#if CS_NEXT_VERSION < 6
#define ISWRITEBACK64() (insn->detail->arm64.writeback == true)
Expand All @@ -33,6 +33,6 @@
#define ISPREINDEX64() (((OPCOUNT64() == 2) && (ISMEM64(1)) && (ISWRITEBACK64())) || ((OPCOUNT64() == 3) && (ISMEM64(2)) && (ISWRITEBACK64())))
#define ISPOSTINDEX64() (((OPCOUNT64() == 3) && (ISIMM64(2)) && (ISWRITEBACK64())) || ((OPCOUNT64() == 4) && (ISIMM64(3)) && (ISWRITEBACK64())))
#else
#define ISPREINDEX64() (!insn->detail->CS_aarch64().post_index && ISWRITEBACK64())
#define ISPOSTINDEX64() (insn->detail->CS_aarch64().post_index && ISWRITEBACK64())
#define ISPREINDEX64() (!insn->detail->CS_aarch64_.post_index && ISWRITEBACK64())
#define ISPOSTINDEX64() (insn->detail->CS_aarch64_.post_index && ISWRITEBACK64())
#endif

0 comments on commit 548cc56

Please sign in to comment.