Use const properly so that we dont remove const qualifier from region and MII

by casting. Found with gcc48.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163247 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Roman Divacky
2012-09-05 21:17:34 +00:00
parent 576cd11ab8
commit b438615abd
3 changed files with 13 additions and 13 deletions
@@ -44,7 +44,7 @@ void x86DisassemblerDebug(const char *file,
dbgs() << file << ":" << line << ": " << s;
}
const char *x86DisassemblerGetInstrName(unsigned Opcode, void *mii) {
const char *x86DisassemblerGetInstrName(unsigned Opcode, const void *mii) {
const MCInstrInfo *MII = static_cast<const MCInstrInfo *>(mii);
return MII->getName(Opcode);
}
@@ -95,8 +95,8 @@ const EDInstInfo *X86GenericDisassembler::getEDInfo() const {
/// be a pointer to a MemoryObject.
/// @param byte - A pointer to the byte to be read.
/// @param address - The address to be read.
static int regionReader(void* arg, uint8_t* byte, uint64_t address) {
MemoryObject* region = static_cast<MemoryObject*>(arg);
static int regionReader(const void* arg, uint8_t* byte, uint64_t address) {
const MemoryObject* region = static_cast<const MemoryObject*>(arg);
return region->readByte(address, byte);
}
@@ -135,10 +135,10 @@ X86GenericDisassembler::getInstruction(MCInst &instr,
int ret = decodeInstruction(&internalInstr,
regionReader,
(void*)&region,
(const void*)&region,
loggerFn,
(void*)&vStream,
(void*)MII,
(const void*)MII,
address,
fMode);