From f0a4e8bd113094d14e28594db4a42cb83355302e Mon Sep 17 00:00:00 2001 From: harry Date: Fri, 20 Jan 2023 22:02:32 -0500 Subject: [PATCH] Added a proper contructor to CHEATF_SUBFAST struct to fix clang compiler initializer warning. --- src/cheat.cpp | 2 +- src/cheat.h | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/cheat.cpp b/src/cheat.cpp index 8ae0e985..3752f068 100644 --- a/src/cheat.cpp +++ b/src/cheat.cpp @@ -59,7 +59,7 @@ void FCEU_CheatAddRAM(int s, uint32 A, uint8 *p) } -CHEATF_SUBFAST SubCheats[256] = { 0 }; +CHEATF_SUBFAST SubCheats[256]; uint32 numsubcheats = 0; int globalCheatDisabled = 0; int disableAutoLSCheats = 0; diff --git a/src/cheat.h b/src/cheat.h index 3e11e9d3..200a0055 100644 --- a/src/cheat.h +++ b/src/cheat.h @@ -33,12 +33,18 @@ extern int disableAutoLSCheats; int FCEU_DisableAllCheats(void); int FCEU_DeleteAllCheats(void); -typedef struct { +struct CHEATF_SUBFAST +{ uint16 addr; uint8 val; int compare; readfunc PrevRead; -} CHEATF_SUBFAST; + + CHEATF_SUBFAST(void) + { + addr = 0; val = 0; compare = 0; PrevRead = nullptr; + } +}; struct CHEATF { struct CHEATF *next;