mirror of
https://github.com/capstone-engine/capstone.git
synced 2024-11-23 13:39:46 +00:00
MCInst_addOperand2() does not need to return value
This commit is contained in:
parent
215e76b223
commit
264ca37ad8
15
MCInst.c
15
MCInst.c
@ -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)
|
||||
|
2
MCInst.h
2
MCInst.h
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user