From 911990671f79d3cb94bf70931953e6bf8e35b0bb Mon Sep 17 00:00:00 2001 From: Nguyen Anh Quynh Date: Tue, 13 Jan 2015 14:33:09 +0800 Subject: [PATCH] arm64 & sparc: fix some warnings reported by MSVC --- arch/AArch64/AArch64InstPrinter.c | 2 +- arch/Sparc/SparcInstPrinter.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/AArch64/AArch64InstPrinter.c b/arch/AArch64/AArch64InstPrinter.c index 822a10cad..c7b26aa17 100644 --- a/arch/AArch64/AArch64InstPrinter.c +++ b/arch/AArch64/AArch64InstPrinter.c @@ -614,7 +614,7 @@ static void printOperand(MCInst *MI, unsigned OpNo, SStream *O) printUInt64Bang(O, imm); if (MI->csh->detail) { if (MI->csh->doing_mem) { - MI->flat_insn->detail->arm64.operands[MI->flat_insn->detail->arm64.op_count].mem.disp = imm; + MI->flat_insn->detail->arm64.operands[MI->flat_insn->detail->arm64.op_count].mem.disp = (int32_t)imm; } else { MI->flat_insn->detail->arm64.operands[MI->flat_insn->detail->arm64.op_count].type = ARM64_OP_IMM; MI->flat_insn->detail->arm64.operands[MI->flat_insn->detail->arm64.op_count].imm = imm; diff --git a/arch/Sparc/SparcInstPrinter.c b/arch/Sparc/SparcInstPrinter.c index 846d3b659..cd8979ce7 100644 --- a/arch/Sparc/SparcInstPrinter.c +++ b/arch/Sparc/SparcInstPrinter.c @@ -190,10 +190,10 @@ static void printOperand(MCInst *MI, int opNum, SStream *O) // get absolute address for CALL/Bxx if (MI->Opcode == SP_CALL) - Imm += MI->address; + Imm += (uint32_t)MI->address; else if (MI->flat_insn->id == SPARC_INS_B) // pc + (disp30 * 4) - Imm = MI->address + Imm * 4; + Imm = (uint32_t)MI->address + Imm * 4; if (Imm >= 0) { if (Imm > HEX_THRESHOLD)