From 88245044741aade52f5611e36054cd882fdf6130 Mon Sep 17 00:00:00 2001 From: Patryk Obara Date: Tue, 5 Nov 2019 12:38:42 +0100 Subject: [PATCH] Silence several sometimes-uninitialized warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit GCC compiler reports these as: warning: variable (…) is used uninitialized whenever switch default is taken --- src/cpu/core_dyn_x86/risc_x64.h | 6 +++--- src/cpu/core_dyn_x86/risc_x86.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/cpu/core_dyn_x86/risc_x64.h b/src/cpu/core_dyn_x86/risc_x64.h index 4fea48ff..731885f0 100644 --- a/src/cpu/core_dyn_x86/risc_x64.h +++ b/src/cpu/core_dyn_x86/risc_x64.h @@ -518,7 +518,7 @@ static void gen_load_host(void * data,DynReg * dr1,Bitu size) { static void gen_mov_host(void * data,DynReg * dr1,Bitu size,Bit8u di1=0) { int idx = FindDynReg(dr1,size==4)->index; opcode op; - Bit8u tmp; + Bit8u tmp = 0x00; switch (size) { case 1: op.setreg(idx,di1); @@ -660,7 +660,7 @@ static void gen_dop_byte_imm_mem(DualOps op,DynReg * dr1,Bit8u di1,void* data) { i = opcode(dst->index,true,di1).setea(src); } - Bit8u tmp; + Bit8u tmp = 0x00; switch (op) { case DOP_ADD: tmp=0x02; break; case DOP_ADC: tmp=0x12; break; @@ -1100,7 +1100,7 @@ static void gen_call_function(void * func,const char* ops,...) { } static void gen_call_write(DynReg * dr,Bit32u val,Bitu write_size) { - void *func; + void *func = NULL; gen_protectflags(); gen_load_arg_reg(0,dr,"rd"); diff --git a/src/cpu/core_dyn_x86/risc_x86.h b/src/cpu/core_dyn_x86/risc_x86.h index 51b2fe5a..c6758c10 100644 --- a/src/cpu/core_dyn_x86/risc_x86.h +++ b/src/cpu/core_dyn_x86/risc_x86.h @@ -329,7 +329,7 @@ static void gen_mov_host(void * data,DynReg * dr1,Bitu size,Bit8u di1=0) { static void gen_dop_byte(DualOps op,DynReg * dr1,Bit8u di1,DynReg * dr2,Bit8u di2) { GenReg * gr1=FindDynReg(dr1);GenReg * gr2=FindDynReg(dr2); - Bit8u tmp; + Bit8u tmp = 0x00; switch (op) { case DOP_ADD: tmp=0x02; break; case DOP_ADC: tmp=0x12; break;