diff options
Diffstat (limited to 'src/arch/instruction.h')
-rw-r--r-- | src/arch/instruction.h | 54 |
1 files changed, 31 insertions, 23 deletions
diff --git a/src/arch/instruction.h b/src/arch/instruction.h index 8289a43..217e38b 100644 --- a/src/arch/instruction.h +++ b/src/arch/instruction.h @@ -148,38 +148,46 @@ size_t _g_arch_instruction_count_operands(const GArchInstruction *); GArchOperand *_g_arch_instruction_get_operand(const GArchInstruction *, size_t); /* Remplace un opérande d'une instruction par un autre. */ -bool g_arch_instruction_replace_operand(GArchInstruction *, GArchOperand *, GArchOperand *); - -/* Remplace un opérande d'une instruction par un autre. */ bool _g_arch_instruction_replace_operand(GArchInstruction *, GArchOperand *, GArchOperand *); /* Détache un opérande liée d'une instruction. */ -void _g_arch_instruction_detach_operand(GArchInstruction *, GArchOperand *); +bool _g_arch_instruction_detach_operand(GArchInstruction *, GArchOperand *); -#define g_arch_instruction_count_operands(ins) \ - ({ \ - size_t __result; \ - g_arch_instruction_lock_operands(ins); \ - __result = _g_arch_instruction_count_operands(ins); \ - g_arch_instruction_unlock_operands(ins); \ - __result; \ +#define g_arch_instruction_count_operands(ins) \ + ({ \ + size_t __result; \ + g_arch_instruction_lock_operands(ins); \ + __result = _g_arch_instruction_count_operands(ins); \ + g_arch_instruction_unlock_operands(ins); \ + __result; \ + }) + +#define g_arch_instruction_get_operand(ins, idx) \ + ({ \ + GArchOperand *__result; \ + g_arch_instruction_lock_operands(ins); \ + __result = _g_arch_instruction_get_operand(ins, idx); \ + g_arch_instruction_unlock_operands(ins); \ + __result; \ }) -#define g_arch_instruction_get_operand(ins, idx) \ - ({ \ - GArchOperand *__result; \ - g_arch_instruction_lock_operands(ins); \ - __result = _g_arch_instruction_get_operand(ins, idx); \ - g_arch_instruction_unlock_operands(ins); \ - __result; \ +#define g_arch_instruction_replace_operand(ins, o, n) \ + ({ \ + bool __result; \ + g_arch_instruction_lock_operands(ins); \ + __result = _g_arch_instruction_replace_operand(ins, o, n); \ + g_arch_instruction_unlock_operands(ins); \ + __result; \ }) -#define g_arch_instruction_detach_operand(ins, o) \ - ({ \ - g_arch_instruction_lock_operands(ins); \ - _g_arch_instruction_detach_operand(ins, o); \ - g_arch_instruction_unlock_operands(ins); \ +#define g_arch_instruction_detach_operand(ins, o) \ + ({ \ + bool __result; \ + g_arch_instruction_lock_operands(ins); \ + __result = _g_arch_instruction_detach_operand(ins, o); \ + g_arch_instruction_unlock_operands(ins); \ + __result; \ }) |