Skip to content

Commit

Permalink
♻️ Consistently use pragma once to guard the headers
Browse files Browse the repository at this point in the history
  • Loading branch information
AJenbo committed Apr 6, 2021
1 parent bfb3c11 commit 433edc6
Show file tree
Hide file tree
Showing 82 changed files with 85 additions and 297 deletions.
6 changes: 2 additions & 4 deletions DiabloUI/diabloui.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
//HEADER_GOES_HERE
#ifndef __DIABLOUI_H__
#define __DIABLOUI_H__
#pragma once

namespace devilution {

Expand Down Expand Up @@ -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
5 changes: 1 addition & 4 deletions Source/all.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
*
* Include all application headers.
*/
#ifndef __ALL_H__
#define __ALL_H__
#pragma once

#include <SDL.h>
#include <map>
Expand Down Expand Up @@ -93,5 +92,3 @@
#include "track.h"
#include "trigs.h"
#include "render.h" // linked last, likely .s/.asm

#endif /* __ALL_H__ */
5 changes: 1 addition & 4 deletions Source/automap.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
*
* Interface of the in-game map overlay.
*/
#ifndef __AUTOMAP_H__
#define __AUTOMAP_H__
#pragma once

#include "engine.h"

Expand Down Expand Up @@ -93,5 +92,3 @@ void AutomapZoomReset();
#endif

}

#endif /* __AUTOMAP_H__ */
5 changes: 1 addition & 4 deletions Source/capture.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
*
* Interface of the screenshot function.
*/
#ifndef __CAPTURE_H__
#define __CAPTURE_H__
#pragma once

namespace devilution {

Expand All @@ -19,5 +18,3 @@ void CaptureScreen();
#endif

}

#endif /* __CAPTURE_H__ */
5 changes: 1 addition & 4 deletions Source/codec.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
*
* Interface of save game encryption algorithm.
*/
#ifndef __CODEC_H__
#define __CODEC_H__
#pragma once

namespace devilution {

Expand All @@ -21,5 +20,3 @@ void codec_encode(BYTE *pbSrcDst, DWORD size, int size_64, const char *pszPasswo
#endif

}

#endif /* __CODEC_H__ */
5 changes: 1 addition & 4 deletions Source/control.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -158,5 +157,3 @@ extern RECT32 ChrBtnsRect[4];
#endif

}

#endif /* __CONTROL_H__ */
5 changes: 1 addition & 4 deletions Source/cursor.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
*
* Interface of cursor tracking functionality.
*/
#ifndef __CURSOR_H__
#define __CURSOR_H__
#pragma once

namespace devilution {

Expand Down Expand Up @@ -48,5 +47,3 @@ extern const int InvItemHeight[];
#endif

}

#endif /* __CURSOR_H__ */
5 changes: 1 addition & 4 deletions Source/dead.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
*
* Interface of functions for placing dead monsters.
*/
#ifndef __DEAD_H__
#define __DEAD_H__
#pragma once

namespace devilution {

Expand Down Expand Up @@ -32,5 +31,3 @@ void SetDead();
#endif

}

#endif /* __DEAD_H__ */
5 changes: 1 addition & 4 deletions Source/debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
*
* Interface of debug functions.
*/
#ifndef __DEBUG_H__
#define __DEBUG_H__
#pragma once

namespace devilution {

Expand All @@ -31,5 +30,3 @@ void NextDebugMonster();
#endif

}

#endif /* __DEBUG_H__ */
5 changes: 1 addition & 4 deletions Source/diablo.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
*
* Interface of the main game initialization functions.
*/
#ifndef __DIABLO_H__
#define __DIABLO_H__
#pragma once

#include "pack.h"
#ifdef _DEBUG
Expand Down Expand Up @@ -88,5 +87,3 @@ extern bool gbFriendlyFire;
#endif

}

#endif /* __DIABLO_H__ */
5 changes: 1 addition & 4 deletions Source/doom.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
*
* Interface of the map of the stars quest.
*/
#ifndef __DOOM_H__
#define __DOOM_H__
#pragma once

#include "engine.h"

Expand All @@ -27,5 +26,3 @@ void doom_draw(CelOutputBuffer out);
#endif

}

#endif /* __DOOM_H__ */
5 changes: 1 addition & 4 deletions Source/drlg_l1.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
*
* Interface of the cathedral level generation algorithms.
*/
#ifndef __DRLG_L1_H__
#define __DRLG_L1_H__
#pragma once

namespace devilution {

Expand Down Expand Up @@ -39,5 +38,3 @@ void drlg_l1_crypt_pattern7(int rndper);
#endif

}

#endif /* __DRLG_L1_H__ */
2 changes: 1 addition & 1 deletion Source/drlg_l2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down
5 changes: 1 addition & 4 deletions Source/drlg_l2.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
*
* Interface of the catacombs level generation algorithms.
*/
#ifndef __DRLG_L2_H__
#define __DRLG_L2_H__
#pragma once

namespace devilution {

Expand Down Expand Up @@ -41,5 +40,3 @@ void CreateL2Dungeon(DWORD rseed, int entry);
#endif

}

#endif /* __DRLG_L2_H__ */
5 changes: 1 addition & 4 deletions Source/drlg_l3.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
*
* Interface of the caves level generation algorithms.
*/
#ifndef __DRLG_L3_H__
#define __DRLG_L3_H__
#pragma once

namespace devilution {

Expand All @@ -22,5 +21,3 @@ void LoadPreL3Dungeon(const char *sFileName, int vx, int vy);
#endif

}

#endif /* __DRLG_L3_H__ */
5 changes: 1 addition & 4 deletions Source/drlg_l4.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
*
* Interface of the hell level generation algorithms.
*/
#ifndef __DRLG_L4_H__
#define __DRLG_L4_H__
#pragma once

namespace devilution {

Expand All @@ -29,5 +28,3 @@ void CreateL4Dungeon(DWORD rseed, int entry);
#endif

}

#endif /* __DRLG_L4_H__ */
5 changes: 1 addition & 4 deletions Source/dthread.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
*
* Interface of functions for updating game state from network commands.
*/
#ifndef __DTHREAD_H__
#define __DTHREAD_H__
#pragma once

namespace devilution {

Expand All @@ -23,5 +22,3 @@ void dthread_cleanup();
#endif

}

#endif /* __DTHREAD_H__ */
5 changes: 1 addition & 4 deletions Source/dx.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
*
* Interface of functions setting up the graphics pipeline.
*/
#ifndef __DX_H__
#define __DX_H__
#pragma once

namespace devilution {

Expand All @@ -22,5 +21,3 @@ void RenderPresent();
void PaletteGetEntries(DWORD dwNumEntries, SDL_Color *lpEntries);

}

#endif /* __DX_H__ */
5 changes: 1 addition & 4 deletions Source/effects.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
*
* Interface of functions for loading and playing sounds.
*/
#ifndef __EFFECTS_H__
#define __EFFECTS_H__
#pragma once

#include "sound.h"

Expand Down Expand Up @@ -44,5 +43,3 @@ int GetSFXLength(int nSFX);
#endif

}

#endif /* __EFFECTS_H__ */
5 changes: 1 addition & 4 deletions Source/encrypt.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
*
* Interface of functions for compression and decompressing MPQ data.
*/
#ifndef __ENCRYPT_H__
#define __ENCRYPT_H__
#pragma once

namespace devilution {

Expand Down Expand Up @@ -32,5 +31,3 @@ void PkwareDecompress(BYTE *pbInBuff, int recv_size, int dwMaxBytes);
#endif

}

#endif /* __ENCRYPT_H__ */
5 changes: 1 addition & 4 deletions Source/engine.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
* - File loading
* - Video playback
*/
#ifndef __ENGINE_H__
#define __ENGINE_H__
#pragma once

#include <algorithm>
#include <cstddef>
Expand Down Expand Up @@ -441,5 +440,3 @@ void Cl2ApplyTrans(BYTE *p, BYTE *ttbl, int nCel);
void PlayInGameMovie(const char *pszMovie);

}

#endif /* __ENGINE_H__ */
5 changes: 1 addition & 4 deletions Source/error.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
*
* Interface of in-game message functions.
*/
#ifndef __ERROR_H__
#define __ERROR_H__
#pragma once

#include "engine.h"

Expand All @@ -26,5 +25,3 @@ void DrawDiabloMsg(CelOutputBuffer out);
#endif

}

#endif /* __ERROR_H__ */
5 changes: 1 addition & 4 deletions Source/gamemenu.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
*
* Interface of the in-game menu functions.
*/
#ifndef __GAMEMENU_H__
#define __GAMEMENU_H__
#pragma once

namespace devilution {

Expand Down Expand Up @@ -36,5 +35,3 @@ void gamemenu_color_cycling(BOOL bActivate);
#endif

}

#endif /* __GAMEMENU_H__ */
5 changes: 1 addition & 4 deletions Source/gendung.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
*
* Interface of general dungeon generation code.
*/
#ifndef __GENDUNG_H__
#define __GENDUNG_H__
#pragma once

namespace devilution {

Expand Down Expand Up @@ -122,5 +121,3 @@ void InitLevels();
#endif

}

#endif /* __GENDUNG_H__ */
5 changes: 1 addition & 4 deletions Source/gmenu.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
*
* Interface of the in-game navigation and interaction.
*/
#ifndef __GMENU_H__
#define __GMENU_H__
#pragma once

#include "engine.h"

Expand Down Expand Up @@ -41,5 +40,3 @@ void gmenu_slider_steps(TMenuItem *pItem, int dwTicks);
#endif

}

#endif /* __GMENU_H__ */
Loading

0 comments on commit 433edc6

Please sign in to comment.