wasm: silence some compilation warnings

This commit is contained in:
Nguyen Anh Quynh 2019-02-02 00:13:52 +08:00
parent d8fb57bb67
commit 0783e3fa38
15 changed files with 43 additions and 25 deletions

View File

@ -3,6 +3,7 @@
#include <capstone/capstone.h>
void print_insn_detail_arm(csh handle, cs_insn *ins);
void print_insn_detail_arm(csh handle, cs_insn *ins)
{

View File

@ -6,6 +6,7 @@
#include <capstone/capstone.h>
void print_insn_detail_arm64(csh handle, cs_insn *ins);
void print_insn_detail_arm64(csh handle, cs_insn *ins)
{

View File

@ -3,6 +3,7 @@
#include <capstone/capstone.h>
void print_insn_detail_evm(csh handle, cs_insn *ins);
void print_insn_detail_evm(csh handle, cs_insn *ins)
{

View File

@ -4,12 +4,14 @@
#include <stdio.h>
#include <capstone/capstone.h>
void print_insn_detail_m680x(csh handle, cs_insn *insn);
static const char *s_access[] = {
"UNCHANGED", "READ", "WRITE", "READ | WRITE",
};
void print_read_write_regs(csh handle, cs_detail *detail)
static void print_read_write_regs(csh handle, cs_detail *detail)
{
int i;

View File

@ -9,6 +9,7 @@
#include <stdio.h>
#include <capstone/capstone.h>
void print_insn_detail_m68k(csh handle, cs_insn *ins);
static const char* s_addressing_modes[] = {
"<invalid mode>",

View File

@ -6,6 +6,7 @@
#include <capstone/capstone.h>
void print_insn_detail_mips(csh handle, cs_insn *ins);
void print_insn_detail_mips(csh handle, cs_insn *ins)
{

View File

@ -3,7 +3,8 @@
#include <capstone/capstone.h>
void print_string_hex(char *comment, unsigned char *str, size_t len);
void print_insn_detail_mos65xx(csh handle, cs_insn *ins);
static const char *get_am_name(mos65xx_address_mode mode)
{

View File

@ -5,6 +5,8 @@
#include <capstone/capstone.h>
void print_insn_detail_ppc(csh handle, cs_insn *ins);
static const char* get_bc_name(int bc)
{

View File

@ -5,6 +5,8 @@
#include <capstone/capstone.h>
void print_insn_detail_sparc(csh handle, cs_insn *ins);
void print_insn_detail_sparc(csh handle, cs_insn *ins)
{

View File

@ -5,6 +5,7 @@
#include <capstone/capstone.h>
void print_insn_detail_sysz(csh handle, cs_insn *ins);
void print_insn_detail_sysz(csh handle, cs_insn *ins)
{

View File

@ -4,6 +4,7 @@
#include <stdio.h>
#include <capstone/capstone.h>
void print_insn_detail_tms320c64x(csh handle, cs_insn *ins);
void print_insn_detail_tms320c64x(csh handle, cs_insn *ins)
{

View File

@ -3,6 +3,7 @@
#include <capstone/capstone.h>
void print_insn_detail_wasm(csh handle, cs_insn *ins);
void print_insn_detail_wasm(csh handle, cs_insn *ins)
{
@ -23,28 +24,28 @@ void print_insn_detail_wasm(csh handle, cs_insn *ins)
default:
break;
case WASM_OP_INT7:
printf("\t\tOperand[%d] type: int7\n", i);
printf("\t\tOperand[%d] value: %d\n", i, wasm->operands[i].int7);
printf("\t\tOperand[%u] type: int7\n", i);
printf("\t\tOperand[%u] value: %d\n", i, wasm->operands[i].int7);
break;
case WASM_OP_UINT32:
printf("\t\tOperand[%d] type: uint32\n", i);
printf("\t\tOperand[%d] value: 0x%x\n", i, wasm->operands[i].uint32);
printf("\t\tOperand[%u] type: uint32\n", i);
printf("\t\tOperand[%u] value: 0x%x\n", i, wasm->operands[i].uint32);
break;
case WASM_OP_UINT64:
printf("\t\tOperand[%d] type: uint64\n", i);
printf("\t\tOperand[%d] value: 0x%lx\n", i, wasm->operands[i].uint64);
printf("\t\tOperand[%u] type: uint64\n", i);
printf("\t\tOperand[%u] value: 0x%" PRIx64 "\n", i, wasm->operands[i].uint64);
break;
case WASM_OP_VARUINT32:
printf("\t\tOperand[%d] type: varuint32\n", i);
printf("\t\tOperand[%d] value: 0x%x\n", i, wasm->operands[i].varuint32);
printf("\t\tOperand[%u] type: varuint32\n", i);
printf("\t\tOperand[%u] value: 0x%x\n", i, wasm->operands[i].varuint32);
break;
case WASM_OP_VARUINT64:
printf("\t\tOperand[%d] type: varuint64\n", i);
printf("\t\tOperand[%d] value: 0x%lx\n", i, wasm->operands[i].varuint64);
printf("\t\tOperand[%u] type: varuint64\n", i);
printf("\t\tOperand[%u] value: 0x%" PRIx64 "\n", i, wasm->operands[i].varuint64);
break;
}
printf("\t\tOperand[%d] size: %d\n", i, wasm->operands[i].size);
printf("\t\tOperand[%u] size: %u\n", i, wasm->operands[i].size);
}
}
}

View File

@ -5,6 +5,8 @@
#include <capstone/capstone.h>
void print_insn_detail_x86(csh ud, cs_mode mode, cs_insn *ins);
void print_string_hex(const char *comment, unsigned char *str, size_t len);
static const char *get_eflag_name(uint64_t flag)

View File

@ -4,6 +4,7 @@
#include <stdio.h>
#include <capstone/capstone.h>
void print_insn_detail_xcore(csh handle, cs_insn *ins);
void print_insn_detail_xcore(csh handle, cs_insn *ins)
{

View File

@ -50,7 +50,7 @@ static void print_insn_detail(csh cs_handle, cs_insn *ins)
wasm = &(ins->detail->wasm);
if (wasm->op_count > 0) {
int i;
unsigned int i;
printf("\tOperand count: %u\n", wasm->op_count);
@ -59,27 +59,27 @@ static void print_insn_detail(csh cs_handle, cs_insn *ins)
default:
break;
case WASM_OP_INT7:
printf("\t\tOperand[%d] type: int7\n", i);
printf("\t\tOperand[%d] value: %d\n", i, wasm->operands[i].int7);
printf("\t\tOperand[%u] type: int7\n", i);
printf("\t\tOperand[%u] value: %d\n", i, wasm->operands[i].int7);
break;
case WASM_OP_UINT32:
printf("\t\tOperand[%d] type: uint32\n", i);
printf("\t\tOperand[%d] value: 0x%x\n", i, wasm->operands[i].uint32);
printf("\t\tOperand[%u] type: uint32\n", i);
printf("\t\tOperand[%u] value: 0x%x\n", i, wasm->operands[i].uint32);
break;
case WASM_OP_UINT64:
printf("\t\tOperand[%d] type: uint64\n", i);
printf("\t\tOperand[%d] value: 0x%lx\n", i, wasm->operands[i].uint64);
printf("\t\tOperand[%u] type: uint64\n", i);
printf("\t\tOperand[%u] value: 0x%" PRIx64 "\n", i, wasm->operands[i].uint64);
break;
case WASM_OP_VARUINT32:
printf("\t\tOperand[%d] type: varuint32\n", i);
printf("\t\tOperand[%d] value: 0x%x\n", i, wasm->operands[i].varuint32);
printf("\t\tOperand[%u] type: varuint32\n", i);
printf("\t\tOperand[%u] value: 0x%x\n", i, wasm->operands[i].varuint32);
break;
case WASM_OP_VARUINT64:
printf("\t\tOperand[%d] type: varuint64\n", i);
printf("\t\tOperand[%d] value: 0x%lx\n", i, wasm->operands[i].varuint64);
printf("\t\tOperand[%u] type: varuint64\n", i);
printf("\t\tOperand[%u] value: 0x%" PRIx64 "\n", i, wasm->operands[i].varuint64);
break;
}
printf("\t\tOperand[%d] size: %u\n", i, wasm->operands[i].size);
printf("\t\tOperand[%u] size: %u\n", i, wasm->operands[i].size);
}
}
}