MCInst_addOperand2() does not need to return value

This commit is contained in:
Nguyen Anh Quynh 2014-06-16 14:52:09 +08:00
parent 215e76b223
commit 264ca37ad8
2 changed files with 2 additions and 15 deletions

View File

@ -70,25 +70,12 @@ unsigned MCInst_getNumOperands(const MCInst *inst)
return inst->size;
}
// NOTE: this will free @Op argument
int MCInst_addOperand(MCInst *inst, MCOperand *Op)
{
inst->Operands[inst->size] = *Op;
cs_mem_free(Op);
inst->size++;
return 0;
}
// This addOperand2 function doesnt free Op
int MCInst_addOperand2(MCInst *inst, MCOperand *Op)
void MCInst_addOperand2(MCInst *inst, MCOperand *Op)
{
inst->Operands[inst->size] = *Op;
inst->size++;
return 0;
}
void MCOperand_Init(MCOperand *op)

View File

@ -133,6 +133,6 @@ unsigned MCInst_getNumOperands(const MCInst *inst);
int MCInst_addOperand(MCInst *inst, MCOperand *Op);
// This addOperand2 function doesnt free Op
int MCInst_addOperand2(MCInst *inst, MCOperand *Op);
void MCInst_addOperand2(MCInst *inst, MCOperand *Op);
#endif