From 74c84d7ce29eb12fba8f23fd6c5363fff10c0390 Mon Sep 17 00:00:00 2001 From: Rot127 Date: Wed, 22 May 2024 02:13:06 -0500 Subject: [PATCH] Fix Warning C4098: void returns value. --- arch/ARM/ARMInstPrinter.c | 12 ++++++++---- arch/Alpha/AlphaMapping.c | 2 +- arch/PowerPC/PPCInstPrinter.c | 12 ++++++++---- 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/arch/ARM/ARMInstPrinter.c b/arch/ARM/ARMInstPrinter.c index 14170eb522..677c27a418 100644 --- a/arch/ARM/ARMInstPrinter.c +++ b/arch/ARM/ARMInstPrinter.c @@ -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; diff --git a/arch/Alpha/AlphaMapping.c b/arch/Alpha/AlphaMapping.c index c3ae47d051..2bc18671ca 100644 --- a/arch/Alpha/AlphaMapping.c +++ b/arch/Alpha/AlphaMapping.c @@ -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) diff --git a/arch/PowerPC/PPCInstPrinter.c b/arch/PowerPC/PPCInstPrinter.c index a13aa0fbd9..fe6194ff4b 100644 --- a/arch/PowerPC/PPCInstPrinter.c +++ b/arch/PowerPC/PPCInstPrinter.c @@ -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)))