arm: fix some warnings reported by MSVC

test2
Nguyen Anh Quynh 10 years ago
parent e84d2cd523
commit 4b68d9505e
  1. 2
      arch/ARM/ARMInstPrinter.c
  2. 8
      suite/arm/test_arm_regression.c

@ -1058,7 +1058,7 @@ static void printAM3PreOrOffsetIndexOp(MCInst *MI, unsigned Op, SStream *O,
MI->flat_insn->detail->arm.operands[MI->flat_insn->detail->arm.op_count].mem.disp = (int)ImmOffs; MI->flat_insn->detail->arm.operands[MI->flat_insn->detail->arm.op_count].mem.disp = (int)ImmOffs;
MI->flat_insn->detail->arm.operands[MI->flat_insn->detail->arm.op_count].subtracted = true; MI->flat_insn->detail->arm.operands[MI->flat_insn->detail->arm.op_count].subtracted = true;
} else } else
MI->flat_insn->detail->arm.operands[MI->flat_insn->detail->arm.op_count].mem.disp = (int)-ImmOffs; MI->flat_insn->detail->arm.operands[MI->flat_insn->detail->arm.op_count].mem.disp = -(int)ImmOffs;
} }
SStream_concat0(O, "]"); SStream_concat0(O, "]");

@ -24,7 +24,7 @@ struct platform {
int syntax; int syntax;
}; };
static char* hex_string(unsigned char *str, int len) static char *hex_string(unsigned char *str, size_t len)
{ {
// returns a malloced string that has the hex version of the string in it // returns a malloced string that has the hex version of the string in it
// null if failed to malloc // null if failed to malloc
@ -195,8 +195,8 @@ static void test_invalids()
cs_option(handle, CS_OPT_SYNTAX, CS_OPT_SYNTAX_NOREGNAME); cs_option(handle, CS_OPT_SYNTAX, CS_OPT_SYNTAX_NOREGNAME);
for (j = 0; j < invalid->num_invalid_codes; ++j) { for (j = 0; j < invalid->num_invalid_codes; ++j) {
struct invalid_code * invalid_code = NULL; struct invalid_code *invalid_code = NULL;
char * hex_str = NULL; char *hex_str = NULL;
invalid_code = invalid->invalid_codes + j; invalid_code = invalid->invalid_codes + j;
@ -234,7 +234,7 @@ struct valid_code {
unsigned char *code; unsigned char *code;
size_t size; size_t size;
uint32_t start_addr; uint32_t start_addr;
char* expected_out; char *expected_out;
char *comment; char *comment;
}; };

Loading…
Cancel
Save