From ad4f9a4e8a4b2ca0913969cde8e7b2164929cc94 Mon Sep 17 00:00:00 2001 From: Apaczer <94932128+Apaczer@users.noreply.github.com> Date: Wed, 4 Sep 2024 23:00:54 +0200 Subject: [PATCH] gcc: fix crash on non-void func. without return make it workable with aggresive optimization flags --- src/burn/zet.cpp | 8 ++++---- src/sdl-dingux/sdl_progress.cpp | 2 ++ src/sdl-dingux/state.cpp | 2 ++ 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/burn/zet.cpp b/src/burn/zet.cpp index 0b7d333..05813dc 100644 --- a/src/burn/zet.cpp +++ b/src/burn/zet.cpp @@ -512,17 +512,17 @@ int ZetPc(int n) int ZetBc(int n) { - + return 0; } int ZetDe(int n) { - + return 0; } int ZetHL(int n) { - + return 0; } int ZetScan(int nAction) @@ -571,7 +571,7 @@ int ZetNmi() int ZetIdle(int nCycles) { Drz80.nCyclesTotal += nCycles; - + return 0; } int ZetSegmentCycles() diff --git a/src/sdl-dingux/sdl_progress.cpp b/src/sdl-dingux/sdl_progress.cpp index 78a5318..b9cbf73 100644 --- a/src/sdl-dingux/sdl_progress.cpp +++ b/src/sdl-dingux/sdl_progress.cpp @@ -94,6 +94,7 @@ int ProgressCreate() //DrawString("Based on FinalBurnAlpha", (uint16 *)load_screen->pixels, 10, 35, fwidth); DrawString("Now loading ...", (uint16 *)load_screen->pixels, 10, 105, fwidth); show_rom_loading_text("Reading ROM", 0, 0); + return 0; } int ProgressDestroy() @@ -102,6 +103,7 @@ int ProgressDestroy() SDL_FreeSurface(load_screen); load_screen = NULL; } + return 0; } int ProgressUpdateBurner(double dProgress, const TCHAR* pszText, bool bAbs) diff --git a/src/sdl-dingux/state.cpp b/src/sdl-dingux/state.cpp index 8a9d824..d94e881 100644 --- a/src/sdl-dingux/state.cpp +++ b/src/sdl-dingux/state.cpp @@ -43,6 +43,7 @@ static int StateInfo(int* pnLen, int* pnMinVer, int bAll) static int __cdecl ReadAcb(struct BurnArea* pba) { fread(pba->Data, 1, pba->nLen, bfp); + return 0; } // State load @@ -198,6 +199,7 @@ static int __cdecl WriteAcb(struct BurnArea *pba) //printf("WRITE ACB - len: %i, name: %s\n", pba->nLen, pba->szName); fwrite(pba->Data, 1, pba->nLen, bfp); nTotalLen += pba->nLen; + return 0; } // Write a savestate as a chunk of an "FBS " file