diff --git a/libraries/asmjit/asmjit/core/compiler.h b/libraries/asmjit/asmjit/core/compiler.h index 293dcf2aa..a59d2bc28 100644 --- a/libraries/asmjit/asmjit/core/compiler.h +++ b/libraries/asmjit/asmjit/core/compiler.h @@ -327,7 +327,7 @@ public: FuncDetail _funcDetail; //! Function frame. FuncFrame _frame; - //! Function exit (label). + //! Function exit(label). LabelNode* _exitNode; //! Function end (sentinel). SentinelNode* _end; diff --git a/libraries/glslang/spirv/SpvBuilder.h b/libraries/glslang/spirv/SpvBuilder.h index edeac1b62..f2773b55c 100644 --- a/libraries/glslang/spirv/SpvBuilder.h +++ b/libraries/glslang/spirv/SpvBuilder.h @@ -493,7 +493,7 @@ public: // Add a branch to the continue_target of the current (innermost) loop. void createLoopContinue(); - // Add an exit (e.g. "break") from the innermost loop that we're currently + // Add an exit(e.g. "break") from the innermost loop that we're currently // in. void createLoopExit(); diff --git a/src/console/c_cmds.cpp b/src/console/c_cmds.cpp index a4e3ab5f8..e99ff662c 100644 --- a/src/console/c_cmds.cpp +++ b/src/console/c_cmds.cpp @@ -101,12 +101,12 @@ bool CheckCheatmode (bool printmsg) CCMD (quit) { - if (!insave) exit (0); + if (!insave) exit(0); } CCMD (exit) { - if (!insave) exit (0); + if (!insave) exit(0); } /* diff --git a/src/d_net.cpp b/src/d_net.cpp index 95e1cd756..9bb00105c 100644 --- a/src/d_net.cpp +++ b/src/d_net.cpp @@ -1604,7 +1604,7 @@ void D_ArbitrateNetStart (void) StartScreen->NetInit ("Exchanging game information", 1); if (!StartScreen->NetLoop (DoArbitrate, &data)) { - exit (0); + exit(0); } if (consoleplayer == Net_Arbitrator) diff --git a/src/dobjtype.cpp b/src/dobjtype.cpp index d7ea265bc..fd430a352 100644 --- a/src/dobjtype.cpp +++ b/src/dobjtype.cpp @@ -209,7 +209,7 @@ static int cregcmp (const void *a, const void *b) NO_SANITIZE void PClass::StaticInit () { - atterm (StaticShutdown); + atterm(StaticShutdown); Namespaces.GlobalNamespace = Namespaces.NewNamespace(0); diff --git a/src/i_net.cpp b/src/i_net.cpp index 717e204cf..ca9b488f7 100644 --- a/src/i_net.cpp +++ b/src/i_net.cpp @@ -435,7 +435,7 @@ void StartNetwork (bool autoPort) } #endif - atterm (CloseNetwork); + atterm(CloseNetwork); netgame = true; multiplayer = true; @@ -689,14 +689,14 @@ void HostGame (int i) doomcom.numnodes = 1; - atterm (SendAbort); + atterm(SendAbort); StartScreen->NetInit ("Waiting for players", numplayers); // Wait for numplayers-1 different connections if (!StartScreen->NetLoop (Host_CheckForConnects, (void *)(intptr_t)numplayers)) { - exit (0); + exit(0); } // Now inform everyone of all machines involved in the game @@ -706,7 +706,7 @@ void HostGame (int i) if (!StartScreen->NetLoop (Host_SendAllHere, (void *)gotack)) { - exit (0); + exit(0); } popterm (); @@ -858,20 +858,20 @@ void JoinGame (int i) sendplayer[1] = 0; doomcom.numnodes = 2; - atterm (SendAbort); + atterm(SendAbort); // Let host know we are here StartScreen->NetInit ("Contacting host", 0); if (!StartScreen->NetLoop (Guest_ContactHost, NULL)) { - exit (0); + exit(0); } // Wait for everyone else to connect if (!StartScreen->NetLoop (Guest_WaitForOthers, 0)) { - exit (0); + exit(0); } popterm (); diff --git a/src/m_misc.cpp b/src/m_misc.cpp index ea6974153..aa4650ca9 100644 --- a/src/m_misc.cpp +++ b/src/m_misc.cpp @@ -320,7 +320,7 @@ void M_LoadDefaults () { GameConfig = new FGameConfigFile; GameConfig->DoGlobalSetup (); - atterm (M_SaveDefaultsFinal); + atterm(M_SaveDefaultsFinal); } diff --git a/src/p_setup.cpp b/src/p_setup.cpp index 5ee6ac5a3..287c6d61a 100644 --- a/src/p_setup.cpp +++ b/src/p_setup.cpp @@ -572,7 +572,7 @@ void P_SetupLevel(FLevelLocals *Level, int position, bool newGame) // void P_Init () { - atterm (P_Shutdown); + atterm(P_Shutdown); P_InitEffects (); // [RH] P_InitTerrainTypes (); diff --git a/src/posix/cocoa/i_main.mm b/src/posix/cocoa/i_main.mm index 73dd6ee2e..489906a9d 100644 --- a/src/posix/cocoa/i_main.mm +++ b/src/posix/cocoa/i_main.mm @@ -512,7 +512,7 @@ int main(int argc, char** argv) CreateMenu(); - atterm(ReleaseApplicationController); + atexit(ReleaseApplicationController); appCtrl = [ApplicationController new]; [NSApp setDelegate:appCtrl]; diff --git a/src/posix/sdl/hardware.cpp b/src/posix/sdl/hardware.cpp index eb71e6e97..b761529af 100644 --- a/src/posix/sdl/hardware.cpp +++ b/src/posix/sdl/hardware.cpp @@ -84,5 +84,5 @@ void I_InitGraphics () if (Video == NULL) I_FatalError ("Failed to initialize display"); - atterm (I_ShutdownGraphics); + atterm(I_ShutdownGraphics); } diff --git a/src/posix/sdl/i_input.cpp b/src/posix/sdl/i_input.cpp index 18d8af0a2..040abe736 100644 --- a/src/posix/sdl/i_input.cpp +++ b/src/posix/sdl/i_input.cpp @@ -297,7 +297,7 @@ void MessagePump (const SDL_Event &sev) switch (sev.type) { case SDL_QUIT: - exit (0); + exit(0); case SDL_WINDOWEVENT: extern void ProcessSDLWindowEvent(const SDL_WindowEvent &); diff --git a/src/posix/sdl/i_main.cpp b/src/posix/sdl/i_main.cpp index 34d2d070e..e454f775f 100644 --- a/src/posix/sdl/i_main.cpp +++ b/src/posix/sdl/i_main.cpp @@ -241,7 +241,7 @@ int main (int argc, char **argv) } } - exit (-1); + return -1; } catch (...) { diff --git a/src/posix/sdl/i_system.cpp b/src/posix/sdl/i_system.cpp index faf957601..dd89c7bce 100644 --- a/src/posix/sdl/i_system.cpp +++ b/src/posix/sdl/i_system.cpp @@ -98,7 +98,7 @@ void I_Init (void) CheckCPUID (&CPU); DumpCPUInfo (&CPU); - atterm (I_ShutdownSound); + atterm(I_ShutdownSound); I_InitSound (); } @@ -171,7 +171,7 @@ void I_FatalError (const char *error, va_list ap) } // throw CFatalError (errortext); fprintf (stderr, "%s\n", errortext); - exit (-1); + exit(-1); } std::terminate(); } diff --git a/src/rendering/r_utility.cpp b/src/rendering/r_utility.cpp index 6e063928c..4258b6278 100644 --- a/src/rendering/r_utility.cpp +++ b/src/rendering/r_utility.cpp @@ -380,7 +380,7 @@ FRenderer *CreateSWRenderer(); void R_Init () { - atterm (R_Shutdown); + atterm(R_Shutdown); StartScreen->Progress(); R_InitTranslationTables (); diff --git a/src/rendering/v_video.cpp b/src/rendering/v_video.cpp index 51f2d83e1..bcda5920d 100644 --- a/src/rendering/v_video.cpp +++ b/src/rendering/v_video.cpp @@ -563,7 +563,7 @@ void V_InitScreenSize () const char *i; int width, height, bits; - atterm (V_Shutdown); + atterm(V_Shutdown); width = height = bits = 0; diff --git a/src/sound/s_advsound.cpp b/src/sound/s_advsound.cpp index 42194d57d..c0bf79b09 100644 --- a/src/sound/s_advsound.cpp +++ b/src/sound/s_advsound.cpp @@ -986,7 +986,7 @@ void S_ParseSndInfo (bool redefine) int lump; if (!redefine) SavedPlayerSounds.Clear(); // clear skin sounds only for initial parsing. - atterm (S_ClearSoundData); + atterm(S_ClearSoundData); S_ClearSoundData(); // remove old sound data first! CurrentPitchMask = 0; diff --git a/src/sound/s_environment.cpp b/src/sound/s_environment.cpp index cfc9e87b8..64bb93bd7 100644 --- a/src/sound/s_environment.cpp +++ b/src/sound/s_environment.cpp @@ -643,7 +643,7 @@ void S_ParseReverbDef () { int lump, lastlump = 0; - atterm (S_UnloadReverbDef); + atterm(S_UnloadReverbDef); S_UnloadReverbDef (); while ((lump = Wads.FindLump ("REVERBS", &lastlump)) != -1) diff --git a/src/sound/s_sound.cpp b/src/sound/s_sound.cpp index 7242bb8c5..7820f1cce 100644 --- a/src/sound/s_sound.cpp +++ b/src/sound/s_sound.cpp @@ -305,7 +305,7 @@ void S_Init () { int curvelump; - atterm (S_Shutdown); + atterm(S_Shutdown); // Heretic and Hexen have sound curve lookup tables. Doom does not. curvelump = Wads.CheckNumForName ("SNDCURVE"); diff --git a/src/win32/hardware.cpp b/src/win32/hardware.cpp index 98af9957c..c015c3a7a 100644 --- a/src/win32/hardware.cpp +++ b/src/win32/hardware.cpp @@ -152,5 +152,5 @@ void I_InitGraphics () if (Video == NULL) I_FatalError ("Failed to initialize display"); - atterm (I_ShutdownGraphics); + atterm(I_ShutdownGraphics); } diff --git a/src/win32/i_input.cpp b/src/win32/i_input.cpp index 3c251d147..3846884ea 100644 --- a/src/win32/i_input.cpp +++ b/src/win32/i_input.cpp @@ -424,7 +424,7 @@ LRESULT CALLBACK WndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) case WM_DESTROY: SetPriorityClass (GetCurrentProcess(), NORMAL_PRIORITY_CLASS); //PostQuitMessage (0); - exit (0); + exit(0); break; case WM_HOTKEY: @@ -614,7 +614,7 @@ bool I_InitInput (void *hwnd) HRESULT hr; Printf ("I_InitInput\n"); - atterm (I_ShutdownInput); + atterm(I_ShutdownInput); noidle = !!Args->CheckParm ("-noidle"); g_pdi = NULL; @@ -740,7 +740,7 @@ void I_GetEvent () while (PeekMessage (&mess, NULL, 0, 0, PM_REMOVE)) { if (mess.message == WM_QUIT) - exit (mess.wParam); + exit(mess.wParam); if (GUICapture) { diff --git a/src/win32/i_main.cpp b/src/win32/i_main.cpp index fdf2f51f9..9119a9c78 100644 --- a/src/win32/i_main.cpp +++ b/src/win32/i_main.cpp @@ -932,7 +932,7 @@ void DoMain (HINSTANCE hInstance) if (!Window) { - MessageBoc(nullptr, "Fatal", "Unable to create main window", MB_ICONEXCLAMATION|MB_OK); + MessageBoxA(nullptr, "Unable to create main window", "Fatal", MB_ICONEXCLAMATION|MB_OK); exit(-1); } @@ -1019,7 +1019,7 @@ void DoMain (HINSTANCE hInstance) Printf("%s\n", msg); } } - exit (-1); + exit(-1); } } @@ -1133,7 +1133,7 @@ void CALLBACK ExitFatally (ULONG_PTR dummy) I_ShutdownGraphics (); RestoreConView (); DisplayCrashLog (); - exit (-1); + exit(-1); } //========================================================================== @@ -1233,7 +1233,7 @@ int WINAPI wWinMain (HINSTANCE hInstance, HINSTANCE nothing, LPWSTR cmdline, int // don't support Windows 95, we have no obligation to provide assistance in // getting it installed. MessageBoxA(NULL, "Could not load riched20.dll", GAMENAME " Error", MB_OK | MB_ICONSTOP); - exit(0); + return 0; } #if !defined(__GNUC__) && defined(_DEBUG) @@ -1248,7 +1248,7 @@ int WINAPI wWinMain (HINSTANCE hInstance, HINSTANCE nothing, LPWSTR cmdline, int { } DisplayCrashLog (); - exit (0); + return 0; } if (__argc == 2 && __wargv != nullptr && wcscmp (__wargv[1], L"TestStackCrash") == 0) { @@ -1261,7 +1261,7 @@ int WINAPI wWinMain (HINSTANCE hInstance, HINSTANCE nothing, LPWSTR cmdline, int { } DisplayCrashLog (); - exit (0); + return 0; } #endif diff --git a/src/win32/i_system.cpp b/src/win32/i_system.cpp index 9fdf14dd0..8d52903e6 100644 --- a/src/win32/i_system.cpp +++ b/src/win32/i_system.cpp @@ -337,7 +337,7 @@ void I_Init() CalculateCPUSpeed(); DumpCPUInfo(&CPU); - atterm (I_ShutdownSound); + atterm(I_ShutdownSound); I_InitSound (); } diff --git a/src/win32/st_start.cpp b/src/win32/st_start.cpp index 72daf79ac..420618ec6 100644 --- a/src/win32/st_start.cpp +++ b/src/win32/st_start.cpp @@ -1343,13 +1343,11 @@ void FStrifeStartupScreen::DrawStuff(int old_laser, int new_laser) // //========================================================================== -void ST_Endoom() +int RunEndoom() { - if (showendoom == 0) exit(0); - - if (gameinfo.Endoom.Len() == 0) + if (showendoom == 0 || gameinfo.Endoom.Len() == 0) { - exit(0); + return 0; } int endoom_lump = Wads.CheckNumForFullName (gameinfo.Endoom, true); @@ -1363,25 +1361,25 @@ void ST_Endoom() if (endoom_lump < 0 || Wads.LumpLength (endoom_lump) != 4000) { - exit(0); + return 0; } if (Wads.GetLumpFile(endoom_lump) == Wads.GetMaxIwadNum() && showendoom == 2) { // showendoom==2 means to show only lumps from PWADs. - exit(0); + return 0; } font = ST_Util_LoadFont (TEXT_FONT_NAME); if (font == NULL) { - exit(0); + return 0; } if (!ST_Util_CreateStartupWindow()) { ST_Util_FreeFont (font); - exit(0); + return 0; } I_ShutdownGraphics (); @@ -1432,7 +1430,7 @@ void ST_Endoom() } ST_Util_FreeBitmap (StartupBitmap); ST_Util_FreeFont (font); - exit (int(bRet == 0 ? mess.wParam : 0)); + return int(bRet == 0 ? mess.wParam : 0); } else if (blinking && mess.message == WM_TIMER && mess.hwnd == Window && mess.wParam == 0x5A15A) { @@ -1444,6 +1442,13 @@ void ST_Endoom() } } +void ST_Endoom() +{ + int code = RunEndoom(); + exit(code); + +} + //========================================================================== // // ST_Util_CreateStartupWindow diff --git a/tools/re2c/src/ir/skeleton/generate_data.cc b/tools/re2c/src/ir/skeleton/generate_data.cc index 60af8376e..2fb8a607b 100644 --- a/tools/re2c/src/ir/skeleton/generate_data.cc +++ b/tools/re2c/src/ir/skeleton/generate_data.cc @@ -131,14 +131,14 @@ void Skeleton::emit_data (const char * fname) if (!input) { error ("cannot open file: %s", input_name.c_str ()); - exit (1); + exit(1); } const std::string keys_name = std::string (fname) + "." + name + ".keys"; FILE * keys = fopen (keys_name.c_str (), "wb"); if (!keys) { error ("cannot open file: %s", keys_name.c_str ()); - exit (1); + exit(1); } generate_paths (input, keys); diff --git a/tools/re2c/src/ir/skeleton/skeleton.cc b/tools/re2c/src/ir/skeleton/skeleton.cc index deee11334..6838f17f2 100644 --- a/tools/re2c/src/ir/skeleton/skeleton.cc +++ b/tools/re2c/src/ir/skeleton/skeleton.cc @@ -116,7 +116,7 @@ Skeleton::Skeleton if (maxlen == Node::DIST_MAX) { error ("DFA path %sis too long", incond (cond).c_str ()); - exit (1); + exit(1); } // calculate maximal rule rank (disregarding default and none rules)