From fb2f55824f0c9ea7e17b96361beea5cb8c06308f Mon Sep 17 00:00:00 2001 From: Jonathan Gray Date: Fri, 26 Apr 2013 16:12:21 +1000 Subject: [PATCH] avoid redefining typedefs which is allowed in c++ but not c99 --- codemp/game/bg_pmove.c | 1 - codemp/game/bg_public.h | 4 ++-- codemp/game/bg_vehicles.h | 4 ++-- codemp/game/g_public.h | 4 ++-- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/codemp/game/bg_pmove.c b/codemp/game/bg_pmove.c index 369d4d6..9a347ca 100644 --- a/codemp/game/bg_pmove.c +++ b/codemp/game/bg_pmove.c @@ -709,7 +709,6 @@ void BG_VehicleTurnRateForSpeed( Vehicle_t *pVeh, float speed, float *mPitchOver // Following couple things don't belong in the DLL namespace! #ifdef QAGAME -typedef struct gentity_s gentity_t; gentity_t *G_PlayEffectID(const int fxID, vec3_t org, vec3_t ang); #endif diff --git a/codemp/game/bg_public.h b/codemp/game/bg_public.h index aeb4cbc..111a066 100644 --- a/codemp/game/bg_public.h +++ b/codemp/game/bg_public.h @@ -420,7 +420,7 @@ extern int bgForcePowerCost[NUM_FORCE_POWERS][NUM_FORCE_POWER_LEVELS]; #define MAXTOUCH 32 -typedef struct bgEntity_s +struct bgEntity_s { entityState_t s; playerState_t *playerState; @@ -430,7 +430,7 @@ typedef struct bgEntity_s vec3_t modelScale; //needed for g2 collision //Data type(s) must directly correspond to the head of the gentity and centity structures -} bgEntity_t; +}; typedef struct { // state (in / out) diff --git a/codemp/game/bg_vehicles.h b/codemp/game/bg_vehicles.h index a386762..e4073de 100644 --- a/codemp/game/bg_vehicles.h +++ b/codemp/game/bg_vehicles.h @@ -474,7 +474,7 @@ typedef struct } vehTurretStatus_t; // This is the implementation of the vehicle interface and any of the other variables needed. This // is what actually represents a vehicle. -AReis. -typedef struct Vehicle_s +struct Vehicle_s { // The entity who pilots/drives this vehicle. // NOTE: This is redundant (since m_pParentEntity->owner _should_ be the pilot). This makes things clearer though. @@ -620,7 +620,7 @@ typedef struct Vehicle_s //the guy who was previously the pilot bgEntity_t * m_pOldPilot; -} Vehicle_t; +}; #include "../namespace_begin.h" extern int BG_VehicleGetIndex( const char *vehicleName ); diff --git a/codemp/game/g_public.h b/codemp/game/g_public.h index 6cb8686..203274d 100644 --- a/codemp/game/g_public.h +++ b/codemp/game/g_public.h @@ -6,6 +6,8 @@ #define G_PUBLIC_H +#include "../game/bg_vehicles.h" + #define Q3_INFINITE 16777216 #define GAME_API_VERSION 8 @@ -672,8 +674,6 @@ typedef struct #define MAX_FAILED_NODES 8 -typedef struct Vehicle_s Vehicle_t; - // the server looks at a sharedEntity, which is the start of the game's gentity_t structure //mod authors should not touch this struct typedef struct {