From 433edc63eaac94ac71057fd06367f73cfcaa01ea Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Tue, 6 Apr 2021 13:38:17 +0200 Subject: [PATCH] :recycle: Consistently use pragma once to guard the headers --- DiabloUI/diabloui.h | 6 ++---- Source/all.h | 5 +---- Source/automap.h | 5 +---- Source/capture.h | 5 +---- Source/codec.h | 5 +---- Source/control.h | 5 +---- Source/cursor.h | 5 +---- Source/dead.h | 5 +---- Source/debug.h | 5 +---- Source/diablo.h | 5 +---- Source/doom.h | 5 +---- Source/drlg_l1.h | 5 +---- Source/drlg_l2.cpp | 2 +- Source/drlg_l2.h | 5 +---- Source/drlg_l3.h | 5 +---- Source/drlg_l4.h | 5 +---- Source/dthread.h | 5 +---- Source/dx.h | 5 +---- Source/effects.h | 5 +---- Source/encrypt.h | 5 +---- Source/engine.h | 5 +---- Source/error.h | 5 +---- Source/gamemenu.h | 5 +---- Source/gendung.h | 5 +---- Source/gmenu.h | 5 +---- Source/help.h | 5 +---- Source/init.h | 5 +---- Source/interfac.h | 5 +---- Source/inv.cpp | 4 ++-- Source/inv.h | 5 +---- Source/itemdat.h | 5 +---- Source/items.h | 5 +---- Source/lighting.h | 5 +---- Source/loadsave.h | 5 +---- Source/mainmenu.h | 5 +---- Source/minitext.h | 5 +---- Source/misdat.h | 5 +---- Source/missiles.h | 5 +---- Source/monstdat.h | 5 +---- Source/monster.h | 5 +---- Source/movie.h | 5 +---- Source/mpqapi.h | 5 +---- Source/msg.h | 5 +---- Source/multi.h | 5 +---- Source/nthread.h | 5 +---- Source/objdat.h | 5 +---- Source/objects.h | 5 +---- Source/pack.h | 5 +---- Source/palette.h | 5 +---- Source/path.h | 5 +---- Source/pfile.h | 5 +---- Source/player.h | 5 +---- Source/plrmsg.h | 5 +---- Source/portal.h | 5 +---- Source/quests.h | 5 +---- Source/render.h | 5 +---- Source/restrict.h | 5 +---- Source/scrollrt.h | 5 +---- Source/setmaps.h | 5 +---- Source/sha.h | 5 +---- Source/sound.h | 5 +---- Source/spelldat.h | 5 +---- Source/spells.h | 5 +---- Source/stores.h | 5 +---- Source/sync.h | 5 +---- Source/textdat.h | 5 +---- Source/themes.h | 5 +---- Source/tmsg.h | 5 +---- Source/town.h | 5 +---- Source/towners.h | 5 +---- Source/track.h | 5 +---- Source/trigs.h | 5 +---- SourceX/display.cpp | 2 +- SourceX/display.h | 2 +- SourceX/dx.cpp | 2 +- SourceX/qol.cpp | 2 +- SourceX/qol.h | 7 ++----- SourceX/sound.cpp | 2 +- SourceX/soundsample.cpp | 2 +- SourceX/storm_sdl_rw.cpp | 2 +- SourceX/storm_sdl_rw.h | 2 +- SourceX/thread.cpp | 2 +- 82 files changed, 85 insertions(+), 297 deletions(-) diff --git a/DiabloUI/diabloui.h b/DiabloUI/diabloui.h index 3de95e779..96f00fecc 100644 --- a/DiabloUI/diabloui.h +++ b/DiabloUI/diabloui.h @@ -1,6 +1,5 @@ //HEADER_GOES_HERE -#ifndef __DIABLOUI_H__ -#define __DIABLOUI_H__ +#pragma once namespace devilution { @@ -49,6 +48,5 @@ BOOL UiArtCallback(int game_type, unsigned int art_code, SDL_Color *pPalette, BY int UiSelectGame(GameData *gameData, int *playerId); int UiSelectProvider(GameData *gameData); void UiSetupPlayerInfo(char *infostr, _uiheroinfo *pInfo, Uint32 type); -} // namespace dvl -#endif /* __DIABLOUI_H__ */ +} // namespace devilution diff --git a/Source/all.h b/Source/all.h index 14464b18f..81d674f74 100644 --- a/Source/all.h +++ b/Source/all.h @@ -3,8 +3,7 @@ * * Include all application headers. */ -#ifndef __ALL_H__ -#define __ALL_H__ +#pragma once #include #include @@ -93,5 +92,3 @@ #include "track.h" #include "trigs.h" #include "render.h" // linked last, likely .s/.asm - -#endif /* __ALL_H__ */ diff --git a/Source/automap.h b/Source/automap.h index 9a90f7e96..edce91a32 100644 --- a/Source/automap.h +++ b/Source/automap.h @@ -3,8 +3,7 @@ * * Interface of the in-game map overlay. */ -#ifndef __AUTOMAP_H__ -#define __AUTOMAP_H__ +#pragma once #include "engine.h" @@ -93,5 +92,3 @@ void AutomapZoomReset(); #endif } - -#endif /* __AUTOMAP_H__ */ diff --git a/Source/capture.h b/Source/capture.h index a15a91179..3bb0fb6f5 100644 --- a/Source/capture.h +++ b/Source/capture.h @@ -3,8 +3,7 @@ * * Interface of the screenshot function. */ -#ifndef __CAPTURE_H__ -#define __CAPTURE_H__ +#pragma once namespace devilution { @@ -19,5 +18,3 @@ void CaptureScreen(); #endif } - -#endif /* __CAPTURE_H__ */ diff --git a/Source/codec.h b/Source/codec.h index 90a752d3a..014ae0810 100644 --- a/Source/codec.h +++ b/Source/codec.h @@ -3,8 +3,7 @@ * * Interface of save game encryption algorithm. */ -#ifndef __CODEC_H__ -#define __CODEC_H__ +#pragma once namespace devilution { @@ -21,5 +20,3 @@ void codec_encode(BYTE *pbSrcDst, DWORD size, int size_64, const char *pszPasswo #endif } - -#endif /* __CODEC_H__ */ diff --git a/Source/control.h b/Source/control.h index 17fa705af..229cefc48 100644 --- a/Source/control.h +++ b/Source/control.h @@ -3,8 +3,7 @@ * * Interface of the character and main control panels */ -#ifndef __CONTROL_H__ -#define __CONTROL_H__ +#pragma once #include "engine.h" #include "spelldat.h" @@ -158,5 +157,3 @@ extern RECT32 ChrBtnsRect[4]; #endif } - -#endif /* __CONTROL_H__ */ diff --git a/Source/cursor.h b/Source/cursor.h index 662dee3e3..2ea9fc186 100644 --- a/Source/cursor.h +++ b/Source/cursor.h @@ -3,8 +3,7 @@ * * Interface of cursor tracking functionality. */ -#ifndef __CURSOR_H__ -#define __CURSOR_H__ +#pragma once namespace devilution { @@ -48,5 +47,3 @@ extern const int InvItemHeight[]; #endif } - -#endif /* __CURSOR_H__ */ diff --git a/Source/dead.h b/Source/dead.h index 1ddb3f262..742bbb99c 100644 --- a/Source/dead.h +++ b/Source/dead.h @@ -3,8 +3,7 @@ * * Interface of functions for placing dead monsters. */ -#ifndef __DEAD_H__ -#define __DEAD_H__ +#pragma once namespace devilution { @@ -32,5 +31,3 @@ void SetDead(); #endif } - -#endif /* __DEAD_H__ */ diff --git a/Source/debug.h b/Source/debug.h index 32c9beca2..23bc66357 100644 --- a/Source/debug.h +++ b/Source/debug.h @@ -3,8 +3,7 @@ * * Interface of debug functions. */ -#ifndef __DEBUG_H__ -#define __DEBUG_H__ +#pragma once namespace devilution { @@ -31,5 +30,3 @@ void NextDebugMonster(); #endif } - -#endif /* __DEBUG_H__ */ diff --git a/Source/diablo.h b/Source/diablo.h index 683b81729..ac2c79087 100644 --- a/Source/diablo.h +++ b/Source/diablo.h @@ -3,8 +3,7 @@ * * Interface of the main game initialization functions. */ -#ifndef __DIABLO_H__ -#define __DIABLO_H__ +#pragma once #include "pack.h" #ifdef _DEBUG @@ -88,5 +87,3 @@ extern bool gbFriendlyFire; #endif } - -#endif /* __DIABLO_H__ */ diff --git a/Source/doom.h b/Source/doom.h index 7fe88721e..f58d30186 100644 --- a/Source/doom.h +++ b/Source/doom.h @@ -3,8 +3,7 @@ * * Interface of the map of the stars quest. */ -#ifndef __DOOM_H__ -#define __DOOM_H__ +#pragma once #include "engine.h" @@ -27,5 +26,3 @@ void doom_draw(CelOutputBuffer out); #endif } - -#endif /* __DOOM_H__ */ diff --git a/Source/drlg_l1.h b/Source/drlg_l1.h index e55edd170..7e8861f18 100644 --- a/Source/drlg_l1.h +++ b/Source/drlg_l1.h @@ -3,8 +3,7 @@ * * Interface of the cathedral level generation algorithms. */ -#ifndef __DRLG_L1_H__ -#define __DRLG_L1_H__ +#pragma once namespace devilution { @@ -39,5 +38,3 @@ void drlg_l1_crypt_pattern7(int rndper); #endif } - -#endif /* __DRLG_L1_H__ */ diff --git a/Source/drlg_l2.cpp b/Source/drlg_l2.cpp index 03b22ccd7..c0759d958 100644 --- a/Source/drlg_l2.cpp +++ b/Source/drlg_l2.cpp @@ -1837,7 +1837,7 @@ static void DRLG_LoadL2SP() if (QuestStatus(Q_BLIND)) { pSetPiece = LoadFileInMem("Levels\\L2Data\\Blind1.DUN", NULL); - pSetPiece[26] = 154; // Close outer wall + pSetPiece[26] = 154; // Close outer wall pSetPiece[200] = 154; // Close outer wall setloadflag = TRUE; } else if (QuestStatus(Q_BLOOD)) { diff --git a/Source/drlg_l2.h b/Source/drlg_l2.h index 0fad86f29..24c002602 100644 --- a/Source/drlg_l2.h +++ b/Source/drlg_l2.h @@ -3,8 +3,7 @@ * * Interface of the catacombs level generation algorithms. */ -#ifndef __DRLG_L2_H__ -#define __DRLG_L2_H__ +#pragma once namespace devilution { @@ -41,5 +40,3 @@ void CreateL2Dungeon(DWORD rseed, int entry); #endif } - -#endif /* __DRLG_L2_H__ */ diff --git a/Source/drlg_l3.h b/Source/drlg_l3.h index d5bcd4017..5a6d5d8e4 100644 --- a/Source/drlg_l3.h +++ b/Source/drlg_l3.h @@ -3,8 +3,7 @@ * * Interface of the caves level generation algorithms. */ -#ifndef __DRLG_L3_H__ -#define __DRLG_L3_H__ +#pragma once namespace devilution { @@ -22,5 +21,3 @@ void LoadPreL3Dungeon(const char *sFileName, int vx, int vy); #endif } - -#endif /* __DRLG_L3_H__ */ diff --git a/Source/drlg_l4.h b/Source/drlg_l4.h index 43502c1fd..d9107d4ca 100644 --- a/Source/drlg_l4.h +++ b/Source/drlg_l4.h @@ -3,8 +3,7 @@ * * Interface of the hell level generation algorithms. */ -#ifndef __DRLG_L4_H__ -#define __DRLG_L4_H__ +#pragma once namespace devilution { @@ -29,5 +28,3 @@ void CreateL4Dungeon(DWORD rseed, int entry); #endif } - -#endif /* __DRLG_L4_H__ */ diff --git a/Source/dthread.h b/Source/dthread.h index 44afa86d7..0286d6398 100644 --- a/Source/dthread.h +++ b/Source/dthread.h @@ -3,8 +3,7 @@ * * Interface of functions for updating game state from network commands. */ -#ifndef __DTHREAD_H__ -#define __DTHREAD_H__ +#pragma once namespace devilution { @@ -23,5 +22,3 @@ void dthread_cleanup(); #endif } - -#endif /* __DTHREAD_H__ */ diff --git a/Source/dx.h b/Source/dx.h index ca19a13c8..5a9b17e88 100644 --- a/Source/dx.h +++ b/Source/dx.h @@ -3,8 +3,7 @@ * * Interface of functions setting up the graphics pipeline. */ -#ifndef __DX_H__ -#define __DX_H__ +#pragma once namespace devilution { @@ -22,5 +21,3 @@ void RenderPresent(); void PaletteGetEntries(DWORD dwNumEntries, SDL_Color *lpEntries); } - -#endif /* __DX_H__ */ diff --git a/Source/effects.h b/Source/effects.h index 4426105b9..3a6ba2a7c 100644 --- a/Source/effects.h +++ b/Source/effects.h @@ -3,8 +3,7 @@ * * Interface of functions for loading and playing sounds. */ -#ifndef __EFFECTS_H__ -#define __EFFECTS_H__ +#pragma once #include "sound.h" @@ -44,5 +43,3 @@ int GetSFXLength(int nSFX); #endif } - -#endif /* __EFFECTS_H__ */ diff --git a/Source/encrypt.h b/Source/encrypt.h index 11b871c4e..34e27e4b7 100644 --- a/Source/encrypt.h +++ b/Source/encrypt.h @@ -3,8 +3,7 @@ * * Interface of functions for compression and decompressing MPQ data. */ -#ifndef __ENCRYPT_H__ -#define __ENCRYPT_H__ +#pragma once namespace devilution { @@ -32,5 +31,3 @@ void PkwareDecompress(BYTE *pbInBuff, int recv_size, int dwMaxBytes); #endif } - -#endif /* __ENCRYPT_H__ */ diff --git a/Source/engine.h b/Source/engine.h index e375d684b..b47d3314b 100644 --- a/Source/engine.h +++ b/Source/engine.h @@ -10,8 +10,7 @@ * - File loading * - Video playback */ -#ifndef __ENGINE_H__ -#define __ENGINE_H__ +#pragma once #include #include @@ -441,5 +440,3 @@ void Cl2ApplyTrans(BYTE *p, BYTE *ttbl, int nCel); void PlayInGameMovie(const char *pszMovie); } - -#endif /* __ENGINE_H__ */ diff --git a/Source/error.h b/Source/error.h index e72afdc1c..f3ddda773 100644 --- a/Source/error.h +++ b/Source/error.h @@ -3,8 +3,7 @@ * * Interface of in-game message functions. */ -#ifndef __ERROR_H__ -#define __ERROR_H__ +#pragma once #include "engine.h" @@ -26,5 +25,3 @@ void DrawDiabloMsg(CelOutputBuffer out); #endif } - -#endif /* __ERROR_H__ */ diff --git a/Source/gamemenu.h b/Source/gamemenu.h index 25697b196..de263ae6f 100644 --- a/Source/gamemenu.h +++ b/Source/gamemenu.h @@ -3,8 +3,7 @@ * * Interface of the in-game menu functions. */ -#ifndef __GAMEMENU_H__ -#define __GAMEMENU_H__ +#pragma once namespace devilution { @@ -36,5 +35,3 @@ void gamemenu_color_cycling(BOOL bActivate); #endif } - -#endif /* __GAMEMENU_H__ */ diff --git a/Source/gendung.h b/Source/gendung.h index 89f29044c..53e1cbdd2 100644 --- a/Source/gendung.h +++ b/Source/gendung.h @@ -3,8 +3,7 @@ * * Interface of general dungeon generation code. */ -#ifndef __GENDUNG_H__ -#define __GENDUNG_H__ +#pragma once namespace devilution { @@ -122,5 +121,3 @@ void InitLevels(); #endif } - -#endif /* __GENDUNG_H__ */ diff --git a/Source/gmenu.h b/Source/gmenu.h index ee0f715ae..ef2d21927 100644 --- a/Source/gmenu.h +++ b/Source/gmenu.h @@ -3,8 +3,7 @@ * * Interface of the in-game navigation and interaction. */ -#ifndef __GMENU_H__ -#define __GMENU_H__ +#pragma once #include "engine.h" @@ -41,5 +40,3 @@ void gmenu_slider_steps(TMenuItem *pItem, int dwTicks); #endif } - -#endif /* __GMENU_H__ */ diff --git a/Source/help.h b/Source/help.h index 75976d2ab..73957cd66 100644 --- a/Source/help.h +++ b/Source/help.h @@ -3,8 +3,7 @@ * * Interface of the in-game help text. */ -#ifndef __HELP_H__ -#define __HELP_H__ +#pragma once namespace devilution { @@ -25,5 +24,3 @@ void HelpScrollDown(); #endif } - -#endif /* __HELP_H__ */ diff --git a/Source/init.h b/Source/init.h index 05d216c0b..ad58e6f6d 100644 --- a/Source/init.h +++ b/Source/init.h @@ -3,8 +3,7 @@ * * Interface of routines for initializing the environment, disable screen saver, load MPQ. */ -#ifndef __INIT_H__ -#define __INIT_H__ +#pragma once namespace devilution { @@ -46,5 +45,3 @@ extern char gszProductName[64]; #endif } - -#endif /* __INIT_H__ */ diff --git a/Source/interfac.h b/Source/interfac.h index cebc2705e..6d31006fd 100644 --- a/Source/interfac.h +++ b/Source/interfac.h @@ -3,8 +3,7 @@ * * Interface of load screens. */ -#ifndef __INTERFAC_H__ -#define __INTERFAC_H__ +#pragma once namespace devilution { @@ -35,5 +34,3 @@ void ShowProgress(interface_mode uMsg); #endif } - -#endif /* __INTERFAC_H__ */ diff --git a/Source/inv.cpp b/Source/inv.cpp index 2f5e8444a..5f7bb4cf3 100644 --- a/Source/inv.cpp +++ b/Source/inv.cpp @@ -483,7 +483,7 @@ void DrawInv(CelOutputBuffer out) InvRect[j + SLOTXY_INV_FIRST].X + RIGHT_PANEL_X, InvRect[j + SLOTXY_INV_FIRST].Y - 1, pCursCels, frame, frame_width, - false); + false); } else { CelBlitOutlineTo( out, @@ -491,7 +491,7 @@ void DrawInv(CelOutputBuffer out) InvRect[j + SLOTXY_INV_FIRST].X + RIGHT_PANEL_X, InvRect[j + SLOTXY_INV_FIRST].Y - 1, pCursCels2, frame - 179, frame_width, - false); + false); } } diff --git a/Source/inv.h b/Source/inv.h index f639a4990..ca108ac5e 100644 --- a/Source/inv.h +++ b/Source/inv.h @@ -3,8 +3,7 @@ * * Interface of player inventory. */ -#ifndef __INV_H__ -#define __INV_H__ +#pragma once #include "items.h" #include "player.h" @@ -81,5 +80,3 @@ extern int AP2x2Tbl[10]; #endif } - -#endif /* __INV_H__ */ diff --git a/Source/itemdat.h b/Source/itemdat.h index 088b6ec9e..1a12f480b 100644 --- a/Source/itemdat.h +++ b/Source/itemdat.h @@ -3,8 +3,7 @@ * * Interface of all item data. */ -#ifndef __ITEMDAT_H__ -#define __ITEMDAT_H__ +#pragma once namespace devilution { @@ -549,5 +548,3 @@ extern const UItemStruct UniqueItemList[]; #endif } - -#endif /* __ITEMDAT_H__ */ diff --git a/Source/items.h b/Source/items.h index ec92e174e..5a77a9c5b 100644 --- a/Source/items.h +++ b/Source/items.h @@ -3,8 +3,7 @@ * * Interface of item functionality. */ -#ifndef __ITEMS_H__ -#define __ITEMS_H__ +#pragma once #include "itemdat.h" @@ -354,5 +353,3 @@ extern int ItemInvSnds[]; #endif } - -#endif /* __ITEMS_H__ */ diff --git a/Source/lighting.h b/Source/lighting.h index 9dd3f3e46..aa10319a7 100644 --- a/Source/lighting.h +++ b/Source/lighting.h @@ -3,8 +3,7 @@ * * Interface of light and vision. */ -#ifndef __LIGHTING_H__ -#define __LIGHTING_H__ +#pragma once namespace devilution { @@ -74,5 +73,3 @@ extern const BYTE vCrawlTable[23][30]; #endif } - -#endif /* __LIGHTING_H__ */ diff --git a/Source/loadsave.h b/Source/loadsave.h index 5b12d5fdd..50fd76682 100644 --- a/Source/loadsave.h +++ b/Source/loadsave.h @@ -3,8 +3,7 @@ * * Interface of save game functionality. */ -#ifndef __LOADSAVE_H__ -#define __LOADSAVE_H__ +#pragma once #include "player.h" @@ -40,5 +39,3 @@ void LoadLevel(); #endif } - -#endif /* __LOADSAVE_H__ */ diff --git a/Source/mainmenu.h b/Source/mainmenu.h index 6c059970d..b474dd095 100644 --- a/Source/mainmenu.h +++ b/Source/mainmenu.h @@ -3,8 +3,7 @@ * * Interface of functions for interacting with the main menu. */ -#ifndef __MAINMENU_H__ -#define __MAINMENU_H__ +#pragma once #include "multi.h" @@ -24,5 +23,3 @@ void mainmenu_loop(); #endif } - -#endif /* __MAINMENU_H__ */ diff --git a/Source/minitext.h b/Source/minitext.h index 940be674a..8f9e3377c 100644 --- a/Source/minitext.h +++ b/Source/minitext.h @@ -3,8 +3,7 @@ * * Interface of scrolling dialog text. */ -#ifndef __MINITEXT_H__ -#define __MINITEXT_H__ +#pragma once namespace devilution { @@ -33,5 +32,3 @@ void DrawQText(CelOutputBuffer out); #endif } - -#endif /* __MINITEXT_H__ */ diff --git a/Source/misdat.h b/Source/misdat.h index ef7993891..ae2a84409 100644 --- a/Source/misdat.h +++ b/Source/misdat.h @@ -3,8 +3,7 @@ * * Interface of data related to missiles. */ -#ifndef __MISDAT_H__ -#define __MISDAT_H__ +#pragma once #include "missiles.h" @@ -22,5 +21,3 @@ extern MisFileData misfiledata[]; #endif } - -#endif /* __MISDAT_H__ */ diff --git a/Source/missiles.h b/Source/missiles.h index b6b7f99b5..adb28064b 100644 --- a/Source/missiles.h +++ b/Source/missiles.h @@ -3,8 +3,7 @@ * * Interface of missile functionality. */ -#ifndef __MISSILES_H__ -#define __MISSILES_H__ +#pragma once namespace devilution { @@ -263,5 +262,3 @@ void ClearMissileSpot(int mi); #endif } - -#endif /* __MISSILES_H__ */ diff --git a/Source/monstdat.h b/Source/monstdat.h index 9e6404a58..36b321117 100644 --- a/Source/monstdat.h +++ b/Source/monstdat.h @@ -3,8 +3,7 @@ * * Interface of all monster data. */ -#ifndef __MONSTDAT_H__ -#define __MONSTDAT_H__ +#pragma once namespace devilution { @@ -292,5 +291,3 @@ extern const UniqMonstStruct UniqMonst[]; #endif } - -#endif /* __MONSTDAT_H__ */ diff --git a/Source/monster.h b/Source/monster.h index 4395896ee..cfa705f0b 100644 --- a/Source/monster.h +++ b/Source/monster.h @@ -3,8 +3,7 @@ * * Interface of monster functionality, AI, actions, spawning, loading, etc. */ -#ifndef __MONSTER_H__ -#define __MONSTER_H__ +#pragma once namespace devilution { @@ -271,5 +270,3 @@ extern int offset_y[8]; #endif } - -#endif /* __MONSTER_H__ */ diff --git a/Source/movie.h b/Source/movie.h index 69a6f25a2..54c253f46 100644 --- a/Source/movie.h +++ b/Source/movie.h @@ -3,8 +3,7 @@ * * Interface of video playback. */ -#ifndef __MOVIE_H__ -#define __MOVIE_H__ +#pragma once namespace devilution { @@ -22,5 +21,3 @@ void play_movie(const char *pszMovie, BOOL user_can_close); #endif } - -#endif /* __MOVIE_H__ */ diff --git a/Source/mpqapi.h b/Source/mpqapi.h index 1684a08f7..b8f818dd9 100644 --- a/Source/mpqapi.h +++ b/Source/mpqapi.h @@ -3,8 +3,7 @@ * * Interface of functions for creating and editing MPQ files. */ -#ifndef __MPQAPI_H__ -#define __MPQAPI_H__ +#pragma once #include @@ -53,5 +52,3 @@ BOOL mpqapi_flush_and_close(const char *pszArchive, BOOL bFree, DWORD dwChar); #endif } - -#endif /* __MPQAPI_H__ */ diff --git a/Source/msg.h b/Source/msg.h index 2cce50b71..83c1ea451 100644 --- a/Source/msg.h +++ b/Source/msg.h @@ -3,8 +3,7 @@ * * Interface of function for sending and reciving network messages. */ -#ifndef __MSG_H__ -#define __MSG_H__ +#pragma once namespace devilution { @@ -339,5 +338,3 @@ DWORD ParseCmd(int pnum, TCmd *pCmd); #endif } - -#endif /* __MSG_H__ */ diff --git a/Source/multi.h b/Source/multi.h index ca157a9e7..4e294defd 100644 --- a/Source/multi.h +++ b/Source/multi.h @@ -3,8 +3,7 @@ * * Interface of functions for keeping multiplayer games in sync. */ -#ifndef __MULTI_H__ -#define __MULTI_H__ +#pragma once #include "msg.h" @@ -61,5 +60,3 @@ void recv_plrinfo(int pnum, TCmdPlrInfoHdr *p, BOOL recv); #endif } - -#endif /* __MULTI_H__ */ diff --git a/Source/nthread.h b/Source/nthread.h index 78b47a9e5..90ac9fa05 100644 --- a/Source/nthread.h +++ b/Source/nthread.h @@ -3,8 +3,7 @@ * * Interface of functions for managing game ticks. */ -#ifndef __NTHREAD_H__ -#define __NTHREAD_H__ +#pragma once namespace devilution { @@ -34,5 +33,3 @@ BOOL nthread_has_500ms_passed(); #endif } - -#endif /* __NTHREAD_H__ */ diff --git a/Source/objdat.h b/Source/objdat.h index 3a893fb83..0240fc8fc 100644 --- a/Source/objdat.h +++ b/Source/objdat.h @@ -3,8 +3,7 @@ * * Interface of all object data. */ -#ifndef __OBJDAT_H__ -#define __OBJDAT_H__ +#pragma once namespace devilution { @@ -206,5 +205,3 @@ extern const char *ObjHiveLoadList[]; #endif } - -#endif /* __OBJDAT_H__ */ diff --git a/Source/objects.h b/Source/objects.h index 3872c0bcc..cb46f7224 100644 --- a/Source/objects.h +++ b/Source/objects.h @@ -3,8 +3,7 @@ * * Interface of object functionality, interaction, spawning, loading, etc. */ -#ifndef __OBJECTS_H__ -#define __OBJECTS_H__ +#pragma once namespace devilution { @@ -92,5 +91,3 @@ bool objects_lv_24_454B04(int s); #endif } - -#endif /* __OBJECTS_H__ */ diff --git a/Source/pack.h b/Source/pack.h index 0fc9ab2cd..ffae18ea7 100644 --- a/Source/pack.h +++ b/Source/pack.h @@ -3,8 +3,7 @@ * * Interface of functions for minifying player data structure. */ -#ifndef __PACK_H__ -#define __PACK_H__ +#pragma once #include "items.h" @@ -90,5 +89,3 @@ void UnPackItem(const PkItemStruct *is, ItemStruct *id, bool isHellfire); #endif } - -#endif /* __PACK_H__ */ diff --git a/Source/palette.h b/Source/palette.h index d60807792..c56dfc82f 100644 --- a/Source/palette.h +++ b/Source/palette.h @@ -3,8 +3,7 @@ * * Interface of functions for handling the engines color palette. */ -#ifndef __PALETTE_H__ -#define __PALETTE_H__ +#pragma once namespace devilution { @@ -40,5 +39,3 @@ void palette_update_quest_palette(int n); #endif } - -#endif /* __PALETTE_H__ */ diff --git a/Source/path.h b/Source/path.h index 4c2dba55f..c2a078a26 100644 --- a/Source/path.h +++ b/Source/path.h @@ -3,8 +3,7 @@ * * Interface of the path finding algorithms. */ -#ifndef __PATH_H__ -#define __PATH_H__ +#pragma once namespace devilution { @@ -46,5 +45,3 @@ extern const char pathydir[8]; #endif } - -#endif /* __PATH_H__ */ diff --git a/Source/pfile.h b/Source/pfile.h index 54174b903..f61fcbd8e 100644 --- a/Source/pfile.h +++ b/Source/pfile.h @@ -3,8 +3,7 @@ * * Interface of the save game encoding functionality. */ -#ifndef __PFILE_H__ -#define __PFILE_H__ +#pragma once #include "player.h" #include "../DiabloUI/diabloui.h" @@ -41,5 +40,3 @@ void pfile_update(bool force_save); #endif } - -#endif /* __PFILE_H__ */ diff --git a/Source/player.h b/Source/player.h index a398552dd..7d6c27e21 100644 --- a/Source/player.h +++ b/Source/player.h @@ -3,8 +3,7 @@ * * Interface of player functionality, leveling, actions, creation, loading, etc. */ -#ifndef __PLAYER_H__ -#define __PLAYER_H__ +#pragma once namespace devilution { @@ -326,5 +325,3 @@ extern int ExpLvlsTbl[MAXCHARLEVEL]; #endif } - -#endif /* __PLAYER_H__ */ diff --git a/Source/plrmsg.h b/Source/plrmsg.h index 6e9325b4b..9de5a4cf5 100644 --- a/Source/plrmsg.h +++ b/Source/plrmsg.h @@ -3,8 +3,7 @@ * * Interface of functionality for printing the ingame chat messages. */ -#ifndef __PLRMSG_H__ -#define __PLRMSG_H__ +#pragma once #include "engine.h" @@ -33,5 +32,3 @@ void DrawPlrMsg(CelOutputBuffer out); #endif } - -#endif /* __PLRMSG_H__ */ diff --git a/Source/portal.h b/Source/portal.h index 53cb4ec4c..eac27df86 100644 --- a/Source/portal.h +++ b/Source/portal.h @@ -3,8 +3,7 @@ * * Interface of functionality for handling town portals. */ -#ifndef __PORTAL_H__ -#define __PORTAL_H__ +#pragma once namespace devilution { @@ -42,5 +41,3 @@ BOOL PosOkPortal(int lvl, int x, int y); #endif } - -#endif /* __PORTAL_H__ */ diff --git a/Source/quests.h b/Source/quests.h index 823eabfab..e4856180d 100644 --- a/Source/quests.h +++ b/Source/quests.h @@ -3,8 +3,7 @@ * * Interface of functionality for handling quests. */ -#ifndef __QUESTS_H__ -#define __QUESTS_H__ +#pragma once #include "engine.h" @@ -76,5 +75,3 @@ extern QuestData questlist[]; #endif } - -#endif /* __QUESTS_H__ */ diff --git a/Source/render.h b/Source/render.h index 180c6b716..4faf28ea4 100644 --- a/Source/render.h +++ b/Source/render.h @@ -3,8 +3,7 @@ * * Interface of functionality for rendering the level tiles. */ -#ifndef __RENDER_H__ -#define __RENDER_H__ +#pragma once namespace devilution { @@ -33,5 +32,3 @@ void world_draw_black_tile(CelOutputBuffer out, int sx, int sy); #endif } - -#endif /* __RENDER_H__ */ diff --git a/Source/restrict.h b/Source/restrict.h index 5ab212a56..21ff39a8f 100644 --- a/Source/restrict.h +++ b/Source/restrict.h @@ -3,8 +3,7 @@ * * Interface of functionality for checking if the game will be able run on the system. */ -#ifndef __RESTRICT_H__ -#define __RESTRICT_H__ +#pragma once namespace devilution { @@ -19,5 +18,3 @@ void ReadOnlyTest(); #endif } - -#endif /* __RESTRICT_H__ */ diff --git a/Source/scrollrt.h b/Source/scrollrt.h index 9af11f1f0..a80cad4e8 100644 --- a/Source/scrollrt.h +++ b/Source/scrollrt.h @@ -3,8 +3,7 @@ * * Interface of functionality for rendering the dungeons, monsters and calling other render routines. */ -#ifndef __SCROLLRT_H__ -#define __SCROLLRT_H__ +#pragma once namespace devilution { @@ -52,5 +51,3 @@ void DrawAndBlit(); #endif } - -#endif /* __SCROLLRT_H__ */ diff --git a/Source/setmaps.h b/Source/setmaps.h index eeb386bd2..73a58eb29 100644 --- a/Source/setmaps.h +++ b/Source/setmaps.h @@ -3,8 +3,7 @@ * * Interface of functionality for the special quest dungeons. */ -#ifndef __SETMAPS_H__ -#define __SETMAPS_H__ +#pragma once namespace devilution { @@ -23,5 +22,3 @@ extern const char *const quest_level_names[]; #endif } - -#endif /* __SETMAPS_H__ */ diff --git a/Source/sha.h b/Source/sha.h index e84236bf8..88b8d8064 100644 --- a/Source/sha.h +++ b/Source/sha.h @@ -3,8 +3,7 @@ * * Interface of functionality for calculating X-SHA-1 (a flawed implementation of SHA-1). */ -#ifndef __SHA_H__ -#define __SHA_H__ +#pragma once namespace devilution { @@ -30,5 +29,3 @@ void SHA1Reset(int n); #endif } - -#endif /* __SHA_H__ */ diff --git a/Source/sound.h b/Source/sound.h index 20988e5b0..4df2c33d7 100644 --- a/Source/sound.h +++ b/Source/sound.h @@ -3,8 +3,7 @@ * * Interface of functions setting up the audio pipeline. */ -#ifndef __SOUND_H__ -#define __SOUND_H__ +#pragma once namespace devilution { @@ -47,5 +46,3 @@ extern BOOLEAN gbDupSounds; #endif } - -#endif /* __SOUND_H__ */ diff --git a/Source/spelldat.h b/Source/spelldat.h index b721ecb71..1de56d502 100644 --- a/Source/spelldat.h +++ b/Source/spelldat.h @@ -3,8 +3,7 @@ * * Interface of all spell data. */ -#ifndef __SPELLDAT_H__ -#define __SPELLDAT_H__ +#pragma once namespace devilution { @@ -215,5 +214,3 @@ extern SpellData spelldata[]; #endif } - -#endif /* __SPELLDAT_H__ */ diff --git a/Source/spells.h b/Source/spells.h index 84133d208..b2fcd9675 100644 --- a/Source/spells.h +++ b/Source/spells.h @@ -3,8 +3,7 @@ * * Interface of functionality for casting player spells. */ -#ifndef __SPELLS_H__ -#define __SPELLS_H__ +#pragma once namespace devilution { @@ -28,5 +27,3 @@ int GetSpellStaffLevel(spell_id s); #endif } - -#endif /* __SPELLS_H__ */ diff --git a/Source/stores.h b/Source/stores.h index e63c2b474..1ef9adddd 100644 --- a/Source/stores.h +++ b/Source/stores.h @@ -3,8 +3,7 @@ * * Interface of functionality for stores and towner dialogs. */ -#ifndef __STORES_H__ -#define __STORES_H__ +#pragma once #include "engine.h" @@ -122,5 +121,3 @@ void ReleaseStoreBtn(); #endif } - -#endif /* __STORES_H__ */ diff --git a/Source/sync.h b/Source/sync.h index a1d21b00d..380d4233e 100644 --- a/Source/sync.h +++ b/Source/sync.h @@ -3,8 +3,7 @@ * * Interface of functionality for syncing game state with other players. */ -#ifndef __SYNC_H__ -#define __SYNC_H__ +#pragma once namespace devilution { @@ -21,5 +20,3 @@ void sync_init(); #endif } - -#endif /* __SYNC_H__ */ diff --git a/Source/textdat.h b/Source/textdat.h index bcdc6d366..d8cb4b1cd 100644 --- a/Source/textdat.h +++ b/Source/textdat.h @@ -3,8 +3,7 @@ * * Interface of all dialog texts. */ -#ifndef __TEXTDAT_H__ -#define __TEXTDAT_H__ +#pragma once namespace devilution { @@ -25,5 +24,3 @@ extern const TextDataStruct alltext[]; #endif } - -#endif /* __TEXTDAT_H__ */ diff --git a/Source/themes.h b/Source/themes.h index 75a6cb819..9e3f4a491 100644 --- a/Source/themes.h +++ b/Source/themes.h @@ -3,8 +3,7 @@ * * Interface of the theme room placing algorithms. */ -#ifndef __THEMES_H__ -#define __THEMES_H__ +#pragma once namespace devilution { @@ -31,5 +30,3 @@ void CreateThemeRooms(); } #endif } - -#endif /* __THEMES_H__ */ diff --git a/Source/tmsg.h b/Source/tmsg.h index d2ec6cb83..d4670c153 100644 --- a/Source/tmsg.h +++ b/Source/tmsg.h @@ -3,8 +3,7 @@ * * Interface of functionality transmitting chat messages. */ -#ifndef __TMSG_H__ -#define __TMSG_H__ +#pragma once namespace devilution { @@ -39,5 +38,3 @@ void tmsg_cleanup(); #endif } - -#endif /* __TMSG_H__ */ diff --git a/Source/town.h b/Source/town.h index eb38685e3..94b38596f 100644 --- a/Source/town.h +++ b/Source/town.h @@ -3,8 +3,7 @@ * * Interface of functionality for rendering the town, towners and calling other render routines. */ -#ifndef __TOWN_H__ -#define __TOWN_H__ +#pragma once namespace devilution { @@ -21,5 +20,3 @@ void CreateTown(int entry); #endif } - -#endif /* __TOWN_H__ */ diff --git a/Source/towners.h b/Source/towners.h index 53dee850b..03062b202 100644 --- a/Source/towners.h +++ b/Source/towners.h @@ -3,8 +3,7 @@ * * Interface of functionality for loading and spawning towners. */ -#ifndef __TOWNERS_H__ -#define __TOWNERS_H__ +#pragma once namespace devilution { @@ -86,5 +85,3 @@ extern _speech_id Qtalklist[NUM_TOWNER_TYPES][MAXQUESTS]; #endif } - -#endif /* __TOWNERS_H__ */ diff --git a/Source/track.h b/Source/track.h index 86b1f18df..28fc73dc7 100644 --- a/Source/track.h +++ b/Source/track.h @@ -3,8 +3,7 @@ * * Interface of functionality tracking what the mouse cursor is pointing at. */ -#ifndef __TRACK_H__ -#define __TRACK_H__ +#pragma once namespace devilution { @@ -21,5 +20,3 @@ bool track_isscrolling(); #endif } - -#endif /* __TRACK_H__ */ diff --git a/Source/trigs.h b/Source/trigs.h index b5b7f41c4..7be1b33a2 100644 --- a/Source/trigs.h +++ b/Source/trigs.h @@ -3,8 +3,7 @@ * * Interface of functionality for triggering events when the player enters an area. */ -#ifndef __TRIGS_H__ -#define __TRIGS_H__ +#pragma once namespace devilution { @@ -43,5 +42,3 @@ void CheckTriggers(); #endif } - -#endif /* __TRIGS_H__ */ diff --git a/SourceX/display.cpp b/SourceX/display.cpp index 288aa0de3..4ba1d9b0e 100644 --- a/SourceX/display.cpp +++ b/SourceX/display.cpp @@ -306,4 +306,4 @@ void ScaleSurfaceToOutput(SDL_Surface **surface) #endif } -} // namespace dvl +} // namespace devilution diff --git a/SourceX/display.h b/SourceX/display.h index 8f7336fe2..5e6af3fea 100644 --- a/SourceX/display.h +++ b/SourceX/display.h @@ -93,4 +93,4 @@ void LogicalToOutput(T *x, T *y) #endif } -} // namespace dvl +} // namespace devilution diff --git a/SourceX/dx.cpp b/SourceX/dx.cpp index 400314b96..87a867800 100644 --- a/SourceX/dx.cpp +++ b/SourceX/dx.cpp @@ -321,4 +321,4 @@ void PaletteGetEntries(DWORD dwNumEntries, SDL_Color *lpEntries) lpEntries[i] = system_palette[i]; } } -} // namespace dvl +} // namespace devilution diff --git a/SourceX/qol.cpp b/SourceX/qol.cpp index 8c3b4a54f..2444526bf 100644 --- a/SourceX/qol.cpp +++ b/SourceX/qol.cpp @@ -237,4 +237,4 @@ void AutoGoldPickup(int pnum) } } -} +} // namespace devilution diff --git a/SourceX/qol.h b/SourceX/qol.h index 679016612..c10eb528d 100644 --- a/SourceX/qol.h +++ b/SourceX/qol.h @@ -3,8 +3,7 @@ * * Quality of life features */ -#ifndef __QOL_H__ -#define __QOL_H__ +#pragma once #include "engine.h" @@ -16,6 +15,4 @@ void DrawMonsterHealthBar(CelOutputBuffer out); void DrawXPBar(CelOutputBuffer out); void AutoGoldPickup(int pnum); -} - -#endif /* __QOL_H__ */ +} // namespace devilution diff --git a/SourceX/sound.cpp b/SourceX/sound.cpp index 6c03c2466..638357319 100644 --- a/SourceX/sound.cpp +++ b/SourceX/sound.cpp @@ -292,4 +292,4 @@ int sound_get_or_set_sound_volume(int volume) return sgOptions.Audio.nSoundVolume; } -} // namespace dvl +} // namespace devilution diff --git a/SourceX/soundsample.cpp b/SourceX/soundsample.cpp index 47671c5b7..c60f687ba 100644 --- a/SourceX/soundsample.cpp +++ b/SourceX/soundsample.cpp @@ -122,4 +122,4 @@ int SoundSample::GetLength() return (Uint32)(chunk->alen * ms / bps); }; -} // namespace dvl +} // namespace devilution diff --git a/SourceX/storm_sdl_rw.cpp b/SourceX/storm_sdl_rw.cpp index 5777888e5..c14a53e1c 100644 --- a/SourceX/storm_sdl_rw.cpp +++ b/SourceX/storm_sdl_rw.cpp @@ -95,4 +95,4 @@ SDL_RWops *SFileRw_FromStormHandle(HANDLE handle) return result; } -} // namespace dvl +} // namespace devilution diff --git a/SourceX/storm_sdl_rw.h b/SourceX/storm_sdl_rw.h index 70ca68a8a..0e9ec9af2 100644 --- a/SourceX/storm_sdl_rw.h +++ b/SourceX/storm_sdl_rw.h @@ -13,4 +13,4 @@ namespace devilution { */ SDL_RWops *SFileRw_FromStormHandle(HANDLE handle); -} // namespace dvl +} // namespace devilution diff --git a/SourceX/thread.cpp b/SourceX/thread.cpp index a915a01b6..f9626c3b3 100644 --- a/SourceX/thread.cpp +++ b/SourceX/thread.cpp @@ -75,4 +75,4 @@ int WaitForEvent(event_emul *e) return ret; } -} // namespace dvl +} // namespace devilution