From 79577d7b4e79bff0c3a294db34c8e9975c5ef828 Mon Sep 17 00:00:00 2001 From: "(Tim) Efthimis Kritikos" Date: Wed, 14 Feb 2024 02:45:28 +0000 Subject: [PATCH] Project: fixed some warnings from other compilers --- Makefile | 4 ++-- cpu.c | 2 +- gui.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 0a66dc8..b301b1a 100644 --- a/Makefile +++ b/Makefile @@ -24,7 +24,7 @@ all:test.rom first: ${OBJECT_FILES} ${QUIET_LINK} - ${Q}gcc -ggdb $^ -fsanitize=address -lncurses -ltinfo -o $@ + ${Q}gcc -ggdb $^ -fsanitize=address -fsanitize=undefined -fsanitize=leak -lncursesw -ltinfow -o $@ %.rom:%.asm first $(QUIET_FAS) @@ -32,7 +32,7 @@ first: ${OBJECT_FILES} %.o:%.c ${QUIET_CC} - ${Q} gcc -ggdb -c $< -Wall -Wextra -Werror -fsanitize=address + ${Q}gcc -ggdb -c $< -Wall -Wextra -Werror -fsanitize=address .PHONY: clean clean: diff --git a/cpu.c b/cpu.c index f902333..f64494a 100644 --- a/cpu.c +++ b/cpu.c @@ -227,10 +227,10 @@ void free_exec_data(struct exec_data_t *tofree){ } int exec(struct simdata_t *simdata){ free_instr_list(&simdata->cpu_gui_hints->executing_list); + int condition=0; switch(simdata->exec_data->EXEC_ACTION){ case CALL: case JUMP: - int condition=0; switch(simdata->exec_data->COND){ case NONE: condition=1; break; case ZERO: condition=simdata->registers->FLAGS&1; break; diff --git a/gui.c b/gui.c index 86faccb..9e44a94 100644 --- a/gui.c +++ b/gui.c @@ -484,7 +484,7 @@ int update_general_registers(struct simdata_t *simdata){ for(int i=0;iregisters->GPR+n); - if(float_equiv<9999999999&&float_equiv>-9999999999) + if(float_equiv<9999999999.0&&float_equiv>-9999999999.0) mvwprintw(general_registers,1+y+center_y_offset,1+i*35+center_x_offset,"R%d: %08X (%08f) ",n,simdata->registers->GPR[n],float_equiv); else mvwprintw(general_registers,1+y+center_y_offset,1+i*35+center_x_offset,"R%d: %08X (%cinf) ",n,simdata->registers->GPR[n],(float_equiv>0)?'+':'-');