Remove warnings (#1140)

* remove warnings on windows with vs2019.

* remove warnings.
This commit is contained in:
Chen Huitao 2019-09-08 16:44:16 +08:00 committed by Nguyen Anh Quynh
parent 60896de9f4
commit ca6516ff79
6 changed files with 17 additions and 9 deletions

View File

@ -566,7 +566,7 @@ static inline guint g_hash_table_lookup_node_for_insertion (GHashTable *hash_
GHashNode *node; GHashNode *node;
guint node_index; guint node_index;
guint hash_value; guint hash_value;
guint first_tombstone; guint first_tombstone = 0;
gboolean have_tombstone = FALSE; gboolean have_tombstone = FALSE;
guint step = 0; guint step = 0;
@ -1282,7 +1282,10 @@ char *g_strdup_vprintf(const char *format, va_list ap)
return NULL; return NULL;
vsnprintf(str_res, len+1, format, ap); vsnprintf(str_res, len+1, format, ap);
#else #else
vasprintf(&str_res, format, ap); int ret = vasprintf(&str_res, format, ap);
if (ret == -1) {
return NULL;
}
#endif #endif
return str_res; return str_res;
} }

View File

@ -47,6 +47,11 @@ void arm_reg_reset(struct uc_struct *uc)
env->pc = 0; env->pc = 0;
} }
/* these functions are implemented in helper.c. */
#include "exec/helper-head.h"
uint32_t HELPER(v7m_mrs)(CPUARMState *env, uint32_t reg);
void HELPER(v7m_msr)(CPUARMState *env, uint32_t reg, uint32_t val);
int arm_reg_read(struct uc_struct *uc, unsigned int *regs, void **vals, int count) int arm_reg_read(struct uc_struct *uc, unsigned int *regs, void **vals, int count)
{ {
CPUState *mycpu; CPUState *mycpu;

View File

@ -8594,7 +8594,8 @@ static inline void gen_intermediate_code_internal(uint8_t *gen_opc_cc_op,
target_ulong pc_ptr; target_ulong pc_ptr;
uint16_t *gen_opc_end; uint16_t *gen_opc_end;
CPUBreakpoint *bp; CPUBreakpoint *bp;
int j, lj; int j;
int lj = -1;
uint64_t flags; uint64_t flags;
target_ulong pc_start; target_ulong pc_start;
target_ulong cs_base; target_ulong cs_base;
@ -8698,7 +8699,6 @@ static inline void gen_intermediate_code_internal(uint8_t *gen_opc_cc_op,
gen_opc_end = tcg_ctx->gen_opc_buf + OPC_MAX_SIZE; gen_opc_end = tcg_ctx->gen_opc_buf + OPC_MAX_SIZE;
dc->is_jmp = DISAS_NEXT; dc->is_jmp = DISAS_NEXT;
lj = -1;
max_insns = tb->cflags & CF_COUNT_MASK; max_insns = tb->cflags & CF_COUNT_MASK;
if (max_insns == 0) if (max_insns == 0)
max_insns = CF_COUNT_MASK; max_insns = CF_COUNT_MASK;

View File

@ -125,10 +125,11 @@ void cpu_m68k_flush_flags(CPUM68KState *env, int cc_op)
env->cc_dest = flags; env->cc_dest = flags;
} }
/* this function is implemented in op_helper.c: void HELPER(raise_exception) */
void raise_exception(CPUM68KState *env, uint32_t tt);
void HELPER(movec)(CPUM68KState *env, uint32_t reg, uint32_t val) void HELPER(movec)(CPUM68KState *env, uint32_t reg, uint32_t val)
{ {
M68kCPU *cpu = m68k_env_get_cpu(env);
switch (reg) { switch (reg) {
case 0x02: /* CACR */ case 0x02: /* CACR */
env->cacr = val; env->cacr = val;

View File

@ -2142,8 +2142,6 @@ DISAS_INSN(wddata)
DISAS_INSN(wdebug) DISAS_INSN(wdebug)
{ {
M68kCPU *cpu = m68k_env_get_cpu(env);
if (IS_USER(s)) { if (IS_USER(s)) {
gen_exception(s, s->pc - 2, EXCP_PRIVILEGE); gen_exception(s, s->pc - 2, EXCP_PRIVILEGE);
return; return;

View File

@ -527,7 +527,8 @@ void mips_cpu_do_interrupt(CPUState *cs)
break; break;
case EXCP_SRESET: case EXCP_SRESET:
env->CP0_Status |= (1 << CP0St_SR); env->CP0_Status |= (1 << CP0St_SR);
memset(env->CP0_WatchLo, 0, sizeof(*env->CP0_WatchLo)); /* memset CP0_WatchLo which is fixed size array. */
memset(env->CP0_WatchLo, 0, sizeof(env->CP0_WatchLo));
goto set_error_EPC; goto set_error_EPC;
case EXCP_NMI: case EXCP_NMI:
env->CP0_Status |= (1 << CP0St_NMI); env->CP0_Status |= (1 << CP0St_NMI);