Fix Warning C4098: void returns value. (#2362)

This commit is contained in:
Rot127 2024-05-31 12:02:03 +00:00 committed by GitHub
parent f6ed6efc9c
commit 3a6331b4c2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 17 additions and 9 deletions

View File

@ -452,8 +452,10 @@ void printOperandAddr(MCInst *MI, uint64_t Address, unsigned OpNum, SStream *O)
{
MCOperand *Op = MCInst_getOperand(MI, (OpNum));
if (!MCOperand_isImm(Op) || MI->csh->PrintBranchImmNotAsAddress ||
getUseMarkup())
return printOperand(MI, OpNum, O);
getUseMarkup()) {
printOperand(MI, OpNum, O);
return;
}
int64_t Imm = MCOperand_getImm(Op);
// For ARM instructions the PC offset is 8 bytes, for Thumb instructions it
// is 4 bytes.
@ -1631,8 +1633,10 @@ void printModImmOperand(MCInst *MI, unsigned OpNum, SStream *O)
MCOperand *Op = MCInst_getOperand(MI, (OpNum));
// Support for fixups (MCFixup)
if (MCOperand_isExpr(Op))
return printOperand(MI, OpNum, O);
if (MCOperand_isExpr(Op)) {
printOperand(MI, OpNum, O);
return;
}
unsigned Bits = MCOperand_getImm(Op) & 0xFF;
unsigned Rot = (MCOperand_getImm(Op) & 0xF00) >> 7;

View File

@ -157,7 +157,7 @@ const char *Alpha_getRegisterName(csh handle, unsigned int id)
void Alpha_printInst(MCInst *MI, SStream *O, void *Info)
{
return Alpha_LLVM_printInstruction(MI, O, Info);
Alpha_LLVM_printInstruction(MI, O, Info);
}
void Alpha_set_instr_map_data(MCInst *MI)

View File

@ -505,8 +505,10 @@ void printU16ImmOperand(MCInst *MI, unsigned OpNo, SStream *O)
void printBranchOperand(MCInst *MI, uint64_t Address, unsigned OpNo, SStream *O)
{
add_cs_detail(MI, PPC_OP_GROUP_BranchOperand, OpNo);
if (!MCOperand_isImm(MCInst_getOperand(MI, (OpNo))))
return printOperand(MI, OpNo, O);
if (!MCOperand_isImm(MCInst_getOperand(MI, (OpNo)))) {
printOperand(MI, OpNo, O);
return;
}
int32_t Imm = SignExtend32(
((unsigned)MCOperand_getImm(MCInst_getOperand(MI, (OpNo)))
<< 2),
@ -534,8 +536,10 @@ void printBranchOperand(MCInst *MI, uint64_t Address, unsigned OpNo, SStream *O)
void printAbsBranchOperand(MCInst *MI, unsigned OpNo, SStream *O)
{
add_cs_detail(MI, PPC_OP_GROUP_AbsBranchOperand, OpNo);
if (!MCOperand_isImm(MCInst_getOperand(MI, (OpNo))))
return printOperand(MI, OpNo, O);
if (!MCOperand_isImm(MCInst_getOperand(MI, (OpNo)))) {
printOperand(MI, OpNo, O);
return;
}
printInt32(O, SignExtend32(((unsigned)MCOperand_getImm(
MCInst_getOperand(MI, (OpNo)))