Fix compiler warnings about different sizes and sign.

_v3_old
reverser 10 years ago
parent b53a59af53
commit 202da41980
  1. 3
      arch/AArch64/AArch64Disassembler.c
  2. 3
      arch/ARM/ARMDisassembler.c
  3. 6
      arch/PowerPC/PPCMapping.c

@ -224,7 +224,6 @@ static DecodeStatus _getInstruction(cs_struct *ud, MCInst *MI,
{ {
uint32_t insn; uint32_t insn;
DecodeStatus result; DecodeStatus result;
int i;
if (code_len < 4) { if (code_len < 4) {
// not enough data // not enough data
@ -234,7 +233,7 @@ static DecodeStatus _getInstruction(cs_struct *ud, MCInst *MI,
if (MI->flat_insn->detail) { if (MI->flat_insn->detail) {
memset(MI->flat_insn->detail, 0, sizeof(cs_detail)); memset(MI->flat_insn->detail, 0, sizeof(cs_detail));
for (i = 0; i < ARR_SIZE(MI->flat_insn->detail->arm64.operands); i++) for (size_t i = 0; i < ARR_SIZE(MI->flat_insn->detail->arm64.operands); i++)
MI->flat_insn->detail->arm64.operands[i].vector_index = -1; MI->flat_insn->detail->arm64.operands[i].vector_index = -1;
} }

@ -687,7 +687,6 @@ static DecodeStatus _Thumb_getInstruction(cs_struct *ud, MCInst *MI, const uint8
bool InITBlock; bool InITBlock;
unsigned Firstcond, Mask; unsigned Firstcond, Mask;
uint32_t NEONLdStInsn, insn32, NEONDataInsn, NEONCryptoInsn, NEONv8Insn; uint32_t NEONLdStInsn, insn32, NEONDataInsn, NEONCryptoInsn, NEONv8Insn;
int i;
// We want to read exactly 2 bytes of data. // We want to read exactly 2 bytes of data.
if (code_len < 2) if (code_len < 2)
@ -698,7 +697,7 @@ static DecodeStatus _Thumb_getInstruction(cs_struct *ud, MCInst *MI, const uint8
if (MI->flat_insn->detail) { if (MI->flat_insn->detail) {
memset(&MI->flat_insn->detail->arm, 0, sizeof(cs_arm)); memset(&MI->flat_insn->detail->arm, 0, sizeof(cs_arm));
for (i = 0; i < ARR_SIZE(MI->flat_insn->detail->arm.operands); i++) for (size_t i = 0; i < ARR_SIZE(MI->flat_insn->detail->arm.operands); i++)
MI->flat_insn->detail->arm.operands[i].vector_index = -1; MI->flat_insn->detail->arm.operands[i].vector_index = -1;
} }

@ -8089,9 +8089,7 @@ static struct ppc_alias alias_insn_name_maps[] = {
// given alias mnemonic, return instruction ID & CC // given alias mnemonic, return instruction ID & CC
bool PPC_alias_insn(const char *name, struct ppc_alias *alias) bool PPC_alias_insn(const char *name, struct ppc_alias *alias)
{ {
int i; for(size_t i = 0; i < ARR_SIZE(alias_insn_name_maps); i++) {
for(i = 0; i < ARR_SIZE(alias_insn_name_maps); i++) {
if (!strcmp(name, alias_insn_name_maps[i].mnem)) { if (!strcmp(name, alias_insn_name_maps[i].mnem)) {
alias->id = alias_insn_name_maps[i].id; alias->id = alias_insn_name_maps[i].id;
alias->cc = alias_insn_name_maps[i].cc; alias->cc = alias_insn_name_maps[i].cc;
@ -8100,7 +8098,7 @@ bool PPC_alias_insn(const char *name, struct ppc_alias *alias)
} }
// not really an alias insn // not really an alias insn
i = name2id(&insn_name_maps[1], ARR_SIZE(insn_name_maps) - 1, name); int i = name2id(&insn_name_maps[1], ARR_SIZE(insn_name_maps) - 1, name);
if (i != -1) { if (i != -1) {
alias->id = insn_name_maps[i].id; alias->id = insn_name_maps[i].id;
alias->cc = PPC_BC_INVALID; alias->cc = PPC_BC_INVALID;

Loading…
Cancel
Save