Skip to content

Commit

Permalink
Convert include guards that use !defined to pragma once
Browse files Browse the repository at this point in the history
Resolves twhl-community#50

(cherry picked from commit 58c150d)
  • Loading branch information
SamVanheer authored and LogicAndTrick committed Dec 24, 2021
1 parent fe675d6 commit f238e0f
Show file tree
Hide file tree
Showing 38 changed files with 32 additions and 205 deletions.
6 changes: 0 additions & 6 deletions cl_dll/GameStudioModelRenderer.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@
// $NoKeywords: $
//=============================================================================

#if !defined( GAMESTUDIOMODELRENDERER_H )
#define GAMESTUDIOMODELRENDERER_H
#if defined( _WIN32 )
#pragma once
#endif

/*
====================
Expand All @@ -22,5 +18,3 @@ class CGameStudioModelRenderer : public CStudioModelRenderer
public:
CGameStudioModelRenderer();
};

#endif // GAMESTUDIOMODELRENDERER_H
6 changes: 0 additions & 6 deletions cl_dll/StudioModelRenderer.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@
// $NoKeywords: $
//=============================================================================

#if !defined ( STUDIOMODELRENDERER_H )
#define STUDIOMODELRENDERER_H
#if defined( _WIN32 )
#pragma once
#endif

/*
====================
Expand Down Expand Up @@ -185,5 +181,3 @@ class CStudioModelRenderer
float (*m_pbonetransform) [ MAXSTUDIOBONES ][ 3 ][ 4 ];
float (*m_plighttransform)[ MAXSTUDIOBONES ][ 3 ][ 4 ];
};

#endif // STUDIOMODELRENDERER_H
7 changes: 1 addition & 6 deletions cl_dll/com_weapons.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,8 @@

// com_weapons.h
// Shared weapons common function prototypes
#if !defined( COM_WEAPONSH )
#define COM_WEAPONSH
#ifdef _WIN32

#pragma once
#endif

#include "Exports.h"

Expand Down Expand Up @@ -40,5 +37,3 @@ extern Vector v_angles;
extern Vector v_client_aimangles;
extern float g_lastFOV;
extern struct local_state_s *g_finalstate;

#endif
4 changes: 0 additions & 4 deletions cl_dll/demo.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
// $NoKeywords: $
//=============================================================================

#if !defined( DEMOH )
#define DEMOH
#pragma once

// Types of demo messages we can write/parse
Expand All @@ -23,5 +21,3 @@ extern int g_demosniperdamage;
extern float g_demosniperorg[3];
extern float g_demosniperangles[3];
extern float g_demozoom;

#endif
5 changes: 1 addition & 4 deletions cl_dll/ev_hldm.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
// $NoKeywords: $
//=============================================================================

#if !defined ( EV_HLDMH )
#define EV_HLDMH
#pragma once

void EV_HLDM_GunshotDecalTrace( pmtrace_t *pTrace, char *decalName );
void EV_HLDM_DecalGunshot( pmtrace_t *pTrace, int iBulletType );
Expand Down Expand Up @@ -36,5 +35,3 @@ void EV_SnarkFire(event_args_t* args);


void EV_TrainPitchAdjust(event_args_t* args);

#endif // EV_HLDMH
6 changes: 2 additions & 4 deletions cl_dll/eventscripts.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
//=============================================================================

// eventscripts.h
#if !defined ( EVENTSCRIPTSH )
#define EVENTSCRIPTSH

#pragma once

// Some of these are HL/TFC specific?
void EV_EjectBrass( float *origin, float *velocity, float rotation, int model, int soundtype );
Expand All @@ -20,5 +20,3 @@ void EV_CreateTracer( float *start, float *end );
struct cl_entity_s *GetEntity( int idx );
struct cl_entity_s *GetViewEntity();
void EV_MuzzleFlash();

#endif // EVENTSCRIPTSH
5 changes: 0 additions & 5 deletions cl_dll/in_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
// $NoKeywords: $
//=============================================================================

#if !defined( IN_DEFSH )
#define IN_DEFSH
#pragma once

// up / down
Expand All @@ -15,6 +13,3 @@
#define YAW 1
// fall over
#define ROLL 2


#endif
4 changes: 0 additions & 4 deletions cl_dll/kbutton.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,10 @@
// $NoKeywords: $
//=============================================================================

#if !defined( KBUTTONH )
#define KBUTTONH
#pragma once

typedef struct kbutton_s
{
int down[2]; // key nums holding it down
int state; // low bit is down state
} kbutton_t;

#endif // !KBUTTONH
6 changes: 0 additions & 6 deletions cl_dll/studio_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@
// $NoKeywords: $
//=============================================================================

#if !defined( STUDIO_UTIL_H )
#define STUDIO_UTIL_H
#if defined( WIN32 )
#pragma once
#endif

#ifndef PITCH
// MOVEMENT INFO
Expand All @@ -32,5 +28,3 @@ void MatrixCopy( float in[3][4], float out[3][4] );
void QuaternionMatrix( vec4_t quaternion, float (*matrix)[4] );
void QuaternionSlerp( vec4_t p, vec4_t q, float t, vec4_t qt );
void AngleQuaternion( float *angles, vec4_t quaternion );

#endif // STUDIO_UTIL_H
4 changes: 0 additions & 4 deletions cl_dll/view.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@
// $NoKeywords: $
//=============================================================================

#if !defined ( VIEWH )
#define VIEWH
#pragma once

void V_StartPitchDrift();
void V_StopPitchDrift();

#endif // !VIEWH
7 changes: 1 addition & 6 deletions common/beamdef.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,8 @@
* without written permission from Valve LLC.
*
****/
#if !defined ( BEAMDEFH )
#define BEAMDEFH
#ifdef _WIN32

#pragma once
#endif

#define FBEAM_STARTENTITY 0x00000001
#define FBEAM_ENDENTITY 0x00000002
Expand Down Expand Up @@ -58,5 +55,3 @@ struct beam_s
struct model_s *pFollowModel;
struct particle_s *particles;
};

#endif
7 changes: 1 addition & 6 deletions common/cl_entity.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,8 @@
*
****/
// cl_entity.h
#if !defined( CL_ENTITYH )
#define CL_ENTITYH
#ifdef _WIN32

#pragma once
#endif

typedef struct efrag_s
{
Expand Down Expand Up @@ -111,5 +108,3 @@ struct cl_entity_s
int visframe; // last frame this entity was found in an active leaf
colorVec cvFloorColor;
};

#endif // !CL_ENTITYH
7 changes: 1 addition & 6 deletions common/com_model.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,8 @@
//=============================================================================

// com_model.h
#if !defined( COM_MODEL_H )
#define COM_MODEL_H
#if defined( _WIN32 )

#pragma once
#endif

#define STUDIO_RENDER 1
#define STUDIO_EVENTS 2
Expand Down Expand Up @@ -350,5 +347,3 @@ typedef struct player_info_s
char hashedcdkey[16];
uint64 m_nSteamID;
} player_info_t;

#endif // #define COM_MODEL_H
7 changes: 1 addition & 6 deletions common/con_nprint.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,8 @@
* without written permission from Valve LLC.
*
****/
#if !defined( CON_NPRINTH )
#define CON_NPRINTH
#ifdef _WIN32

#pragma once
#endif

typedef struct con_nprint_s
{
Expand All @@ -27,5 +24,3 @@ typedef struct con_nprint_s

void Con_NPrintf( int idx, char *fmt, ... );
void Con_NXPrintf( struct con_nprint_s *info, char *fmt, ... );

#endif
7 changes: 1 addition & 6 deletions common/demo_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,8 @@
* without written permission from Valve LLC.
*
****/
#if !defined ( DEMO_APIH )
#define DEMO_APIH
#ifdef _WIN32

#pragma once
#endif

typedef struct demo_api_s
{
Expand All @@ -27,5 +24,3 @@ typedef struct demo_api_s
} demo_api_t;

extern demo_api_t demoapi;

#endif
7 changes: 1 addition & 6 deletions common/dlight.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,8 @@
* without written permission from Valve LLC.
*
****/
#if !defined ( DLIGHTH )
#define DLIGHTH
#ifdef _WIN32

#pragma once
#endif

typedef struct dlight_s
{
Expand All @@ -29,5 +26,3 @@ typedef struct dlight_s
int key;
qboolean dark; // subtracts light instead of adding
} dlight_t;

#endif
7 changes: 1 addition & 6 deletions common/entity_state.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,8 @@
* without written permission from Valve LLC.
*
****/
#if !defined( ENTITY_STATEH )
#define ENTITY_STATEH
#ifdef _WIN32

#pragma once
#endif

// For entityType below
#define ENTITY_NORMAL (1<<0)
Expand Down Expand Up @@ -189,5 +186,3 @@ typedef struct local_state_s
clientdata_t client;
weapon_data_t weapondata[ 64 ];
} local_state_t;

#endif // !ENTITY_STATEH
6 changes: 2 additions & 4 deletions common/entity_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,12 @@
*
****/
// entity_types.h
#if !defined( ENTITY_TYPESH )
#define ENTITY_TYPESH

#pragma once

#define ET_NORMAL 0
#define ET_PLAYER 1
#define ET_TEMPENTITY 2
#define ET_BEAM 3
// BMODEL or SPRITE that was split across BSP nodes
#define ET_FRAGMENTED 4

#endif // !ENTITY_TYPESH
7 changes: 1 addition & 6 deletions common/event_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,8 @@
* without written permission from Valve LLC.
*
****/
#if !defined ( EVENT_APIH )
#define EVENT_APIH
#ifdef _WIN32

#pragma once
#endif

#define EVENT_API_VERSION 1

Expand Down Expand Up @@ -47,5 +44,3 @@ typedef struct event_api_s
} event_api_t;

extern event_api_t eventapi;

#endif
7 changes: 1 addition & 6 deletions common/event_args.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,8 @@
* without written permission from Valve LLC.
*
****/
#if !defined( EVENT_ARGSH )
#define EVENT_ARGSH
#ifdef _WIN32

#pragma once
#endif

// Event was invoked with stated origin
#define FEVENT_ORIGIN ( 1<<0 )
Expand Down Expand Up @@ -46,5 +43,3 @@ typedef struct event_args_s
int bparam1;
int bparam2;
} event_args_t;

#endif
7 changes: 1 addition & 6 deletions common/event_flags.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,8 @@
* without written permission from Valve LLC.
*
****/
#if !defined( EVENT_FLAGSH )
#define EVENT_FLAGSH
#ifdef _WIN32

#pragma once
#endif

// Skip local host for event send.
#define FEV_NOTHOST (1<<0)
Expand All @@ -43,5 +40,3 @@

// Only issue event client side ( from shared code )
#define FEV_CLIENT (1<<6)

#endif
6 changes: 0 additions & 6 deletions common/net_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@
// $NoKeywords: $
//=============================================================================

#if !defined( NET_APIH )
#define NET_APIH
#ifdef _WIN32
#pragma once
#endif

#if !defined ( NETADRH )
#include "netadr.h"
Expand Down Expand Up @@ -95,5 +91,3 @@ typedef struct net_api_s
} net_api_t;

extern net_api_t netapi;

#endif // NET_APIH
Loading

0 comments on commit f238e0f

Please sign in to comment.