From 3a5965eb05b53714597ab187f46504e8bc487b63 Mon Sep 17 00:00:00 2001 From: Nguyen Anh Quynh Date: Wed, 28 May 2014 15:14:28 +0800 Subject: [PATCH] xcore: fix some warnings with Diet mode --- arch/XCore/XCoreGenAsmWriter.inc | 8 +++----- arch/XCore/XCoreInstPrinter.c | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/arch/XCore/XCoreGenAsmWriter.inc b/arch/XCore/XCoreGenAsmWriter.inc index e60d79179..684d23280 100644 --- a/arch/XCore/XCoreGenAsmWriter.inc +++ b/arch/XCore/XCoreGenAsmWriter.inc @@ -265,8 +265,7 @@ static void printInstruction(MCInst *MI, SStream *O, MCRegisterInfo *MRI) 0U }; -#ifndef CAPSTONE_DIET - static char AsmStrs[] = { + static const char AsmStrs[] = { /* 0 */ 'l', 'd', 'a', 'p', 32, 'r', '1', '1', ',', 32, 0, /* 11 */ 'g', 'e', 't', 's', 'r', 32, 'r', '1', '1', ',', 32, 0, /* 23 */ 's', 'e', 't', 32, 'c', 'p', ',', 32, 0, @@ -413,7 +412,6 @@ static void printInstruction(MCInst *MI, SStream *O, MCRegisterInfo *MRI) /* 1246 */ 'k', 'r', 'e', 't', 0, /* 1251 */ 'w', 'a', 'i', 't', 'e', 'u', 0, }; -#endif // Emit the opcode for the instruction. uint32_t Bits = OpInfo[MCInst_getOpcode(MI)]; @@ -423,7 +421,7 @@ static void printInstruction(MCInst *MI, SStream *O, MCRegisterInfo *MRI) #endif - if (strchr(AsmStrs+(Bits & 2047)-1, '[')) { + if (strchr((const char *)AsmStrs+(Bits & 2047)-1, '[')) { set_mem_access(MI, true, 0); } @@ -435,7 +433,7 @@ static void printInstruction(MCInst *MI, SStream *O, MCRegisterInfo *MRI) case 0: // DBG_VALUE, BUNDLE, LIFETIME_START, LIFETIME_END, CLRE_0R, DCALL_0R, DE... // already done. this means we have to extract details out ourself. - XCore_insn_extract(MI, AsmStrs+(Bits & 2047)-1); + XCore_insn_extract(MI, (const char *)AsmStrs+(Bits & 2047)-1); return; break; case 1: diff --git a/arch/XCore/XCoreInstPrinter.c b/arch/XCore/XCoreInstPrinter.c index ad2f1690d..9f4862323 100644 --- a/arch/XCore/XCoreInstPrinter.c +++ b/arch/XCore/XCoreInstPrinter.c @@ -40,7 +40,7 @@ void XCore_post_printer(csh ud, cs_insn *insn, char *insn_asm, MCInst *mci) } // stw sed, sp[3] -void XCore_insn_extract(MCInst *MI, char *code) +void XCore_insn_extract(MCInst *MI, const char *code) { int id; char *p, *p2;