Skip to content

Commit

Permalink
fix tests & cstool, so we can compile on MSVC 2010
Browse files Browse the repository at this point in the history
  • Loading branch information
aquynh committed Feb 14, 2018
1 parent 673d733 commit 1af1e41
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
3 changes: 2 additions & 1 deletion cstool/cstool_arm64.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ void print_insn_detail_arm64(csh handle, cs_insn *ins)
int i;
cs_regs regs_read, regs_write;
uint8_t regs_read_count, regs_write_count;
uint8_t access;

// detail can be NULL if SKIPDATA option is turned ON
if (ins->detail == NULL)
Expand Down Expand Up @@ -75,7 +76,7 @@ void print_insn_detail_arm64(csh handle, cs_insn *ins)
break;
}

uint8_t access = op->access;
access = op->access;
switch(access) {
default:
break;
Expand Down
1 change: 0 additions & 1 deletion cstool/cstool_ppc.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/* Capstone Disassembler Engine */
/* By Nguyen Anh Quynh <[email protected]>, 2013> */

#include <inttypes.h>
#include <stdio.h>

#include <capstone/capstone.h>
Expand Down
5 changes: 3 additions & 2 deletions tests/test_arm64.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ static void print_insn_detail(cs_insn *ins)
cs_arm64 *arm64;
int i;
cs_regs regs_read, regs_write;
uint8_t regs_read_count, regs_write_count;
unsigned char regs_read_count, regs_write_count;
unsigned char access;

// detail can be NULL if SKIPDATA option is turned ON
if (ins->detail == NULL)
Expand Down Expand Up @@ -96,7 +97,7 @@ static void print_insn_detail(cs_insn *ins)
break;
}

uint8_t access = op->access;
access = op->access;
switch(access) {
default:
break;
Expand Down
3 changes: 2 additions & 1 deletion tests/test_m680x.c
Original file line number Diff line number Diff line change
Expand Up @@ -360,13 +360,14 @@ static void test()
printf("Disasm:\n");

for (j = 0; j < count; j++) {
int slen;
printf("0x%04X: ", (uint16_t)insn[j].address);
print_string_hex_short(insn[j].bytes,
insn[j].size);
printf("%.*s", 1 + ((5 - insn[j].size) * 2),
nine_spaces);
printf("%s", insn[j].mnemonic);
int slen = (int)strlen(insn[j].mnemonic);
slen = (int)strlen(insn[j].mnemonic);
printf("%.*s", 1 + (5 - slen), nine_spaces);
printf("%s\n", insn[j].op_str);
#ifdef WITH_DETAILS
Expand Down

0 comments on commit 1af1e41

Please sign in to comment.