fix warnings on some unused functions when CAPTONE_DIET mode is turn on

test2
Nguyen Anh Quynh 10 years ago
parent 3bdc7f8488
commit 53a059b581
  1. 6
      arch/ARM/ARMInstPrinter.c
  2. 4
      arch/X86/X86Mapping.c

@ -121,20 +121,18 @@ static void printModImmOperand(MCInst *MI, unsigned OpNum, SStream *O);
static void printInstSyncBOption(MCInst *MI, unsigned OpNum, SStream *O); static void printInstSyncBOption(MCInst *MI, unsigned OpNum, SStream *O);
#ifndef CAPSTONE_DIET
// copy & normalize access info // copy & normalize access info
static uint8_t get_op_access(cs_struct *h, unsigned int id, unsigned int index) static uint8_t get_op_access(cs_struct *h, unsigned int id, unsigned int index)
{ {
#ifndef CAPSTONE_DIET
uint8_t *arr = ARM_get_op_access(h, id); uint8_t *arr = ARM_get_op_access(h, id);
if (arr[index] == CS_AC_IGNORE) if (arr[index] == CS_AC_IGNORE)
return 0; return 0;
return arr[index]; return arr[index];
#else
return 0;
#endif
} }
#endif
static void set_mem_access(MCInst *MI, bool status) static void set_mem_access(MCInst *MI, bool status)
{ {

@ -2289,6 +2289,7 @@ static insn_map insns[] = { // reduce x86 instructions
}; };
#endif #endif
#ifndef CAPSTONE_DIET
// replace r1 = r2 // replace r1 = r2
static void arr_replace(uint16_t *arr, uint8_t max, x86_reg r1, x86_reg r2) static void arr_replace(uint16_t *arr, uint8_t max, x86_reg r1, x86_reg r2)
{ {
@ -2301,6 +2302,7 @@ static void arr_replace(uint16_t *arr, uint8_t max, x86_reg r1, x86_reg r2)
} }
} }
} }
#endif
// given internal insn id, return public instruction info // given internal insn id, return public instruction info
void X86_get_insn_id(cs_struct *h, cs_insn *insn, unsigned int id) void X86_get_insn_id(cs_struct *h, cs_insn *insn, unsigned int id)
@ -2922,6 +2924,7 @@ static bool valid_repe(cs_struct *h, unsigned int opcode)
return false; return false;
} }
#ifndef CAPSTONE_DIET
// add *CX register to regs_read[] & regs_write[] // add *CX register to regs_read[] & regs_write[]
static void add_cx(MCInst *MI) static void add_cx(MCInst *MI)
{ {
@ -2942,6 +2945,7 @@ static void add_cx(MCInst *MI)
MI->flat_insn->detail->regs_write_count++; MI->flat_insn->detail->regs_write_count++;
} }
} }
#endif
// return true if we patch the mnemonic // return true if we patch the mnemonic
bool X86_lockrep(MCInst *MI, SStream *O) bool X86_lockrep(MCInst *MI, SStream *O)

Loading…
Cancel
Save