Merge pull request #7 from jonathangray/warn

Clean up some warnings and remove the need for -fpermissive
This commit is contained in:
Zachary J. Slater 2013-05-02 12:04:09 -07:00
commit 6902b84f94
63 changed files with 202 additions and 133 deletions

View File

@ -1,4 +1,6 @@
cmake_minimum_required(VERSION 2.6)
include(CheckCCompilerFlag)
include(CheckCXXCompilerFlag)
project(jasp)
@ -9,23 +11,45 @@ elseif(cpu STREQUAL "x86_64")
set(cpu "amd64")
endif()
if(CMAKE_COMPILER_IS_GNUC OR CMAKE_C_COMPILER_ID STREQUAL "Clang")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pipe -O2")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-strict-aliasing -fno-strict-overflow")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wno-unknown-pragmas")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-write-strings -Wno-missing-braces")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-switch -Wno-comment")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-variable")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-multichar")
endif()
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
add_definitions(-pipe)
add_definitions(-Wall)
add_definitions(-g)
add_definitions(-O2)
add_definitions(-Wno-unknown-pragmas)
add_definitions(-Wno-write-strings)
add_definitions(-Wno-missing-braces)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pipe -O2")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-strict-aliasing -fno-strict-overflow")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-unknown-pragmas")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-write-strings -Wno-missing-braces")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-switch -Wno-comment")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-variable")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-multichar")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-reorder")
endif()
if(CMAKE_COMPILER_IS_GNUCXX)
add_definitions(-Wno-pragmas)
add_definitions(-fpermissive)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-pragmas")
endif()
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
add_definitions(-Wno-parentheses-equality)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-parentheses-equality")
endif()
check_c_compiler_flag(-Wno-unused-but-set-variable cc_has_unused_but_set)
if (cc_has_unused_but_set)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-but-set-variable")
endif()
check_cxx_compiler_flag(-Wno-unused-but-set-variable cxx_has_unused_but_set)
if (cxx_has_unused_but_set)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-but-set-variable")
endif()
add_definitions( -D_M_IX86=1 ) # tested to mean little endian...

View File

@ -282,7 +282,7 @@ public:
{
return 1;
}
#endif;
#endif
};

View File

@ -1948,7 +1948,7 @@ void CPoly::Rotate()
//----------------------------
bool CPoly::Update()
{
vec3_t mOldOrigin;
vec3_t mOldOrigin = {0, 0, 0};
//FIXME: Handle Relative and Bolted Effects
/*

View File

@ -76,7 +76,7 @@ typedef enum
#define NUM_CHUNK_MODELS 4
typedef enum
enum
{
CHUNK_METAL1 = 0,
CHUNK_METAL2,
@ -410,4 +410,4 @@ typedef struct {
extern cgs_t cgs;
#endif //__CG_MEDIA_H_
#endif //__CG_MEDIA_H_

View File

@ -251,10 +251,10 @@ static const char *GetCustomSound_VariantCapped(const char *ppsTable[], int iEnt
if (iVariantCap || bForceVariant1)
{
char *p = strchr(ppsTable[iEntryNum],'.');
if (p && p-2 > ppsTable[iEntryNum] && isdigit(p[-1]) && !isdigit(p[-2]))
const char *pt = strchr(ppsTable[iEntryNum],'.');
if (pt && pt-2 > ppsTable[iEntryNum] && isdigit(pt[-1]) && !isdigit(pt[-2]))
{
int iThisVariant = p[-1]-'0';
int iThisVariant = pt[-1]-'0';
if (iThisVariant > iVariantCap || bForceVariant1)
{
@ -265,7 +265,7 @@ static const char *GetCustomSound_VariantCapped(const char *ppsTable[], int iEnt
char sName[MAX_QPATH];
Q_strncpyz(sName, ppsTable[iEntryNum], sizeof(sName));
p = strchr(sName,'.');
char *p = strchr(sName,'.');
if (p)
{
*p = '\0';
@ -1739,7 +1739,7 @@ static qboolean CG_CheckLookTarget( centity_t *cent, vec3_t lookAngles, float *l
//Now calc head angle to lookTarget, if any
if ( cent->gent->client->renderInfo.lookTarget >= 0 && cent->gent->client->renderInfo.lookTarget < ENTITYNUM_WORLD )
{
vec3_t lookDir, lookOrg, eyeOrg;
vec3_t lookDir, lookOrg = {0, 0, 0}, eyeOrg;
if ( cent->gent->client->renderInfo.lookMode == LM_ENT )
{
centity_t *lookCent = &cg_entities[cent->gent->client->renderInfo.lookTarget];
@ -8540,4 +8540,4 @@ void CG_ResetPlayerEntity( centity_t *cent ) {
cent->pe.torso.yawing = qfalse;
cent->pe.torso.pitchAngle = cent->lerpAngles[PITCH];
cent->pe.torso.pitching = qfalse;
}
}

View File

@ -211,4 +211,4 @@ Ghoul2 Insert End
//----------------------------------------------
#endif _CG_PUBLIC_H
#endif // _CG_PUBLIC_H

View File

@ -900,7 +900,7 @@ the K_* names are matched up.
to be configured even if they don't have defined names.
===================
*/
int Key_StringToKeynum( char *str ) {
int Key_StringToKeynum( const char *str ) {
int i;
if ( !str || !str[0] )

View File

@ -354,7 +354,7 @@ void CL_WritePacket( void );
void IN_CenterView (void);
float CL_KeyState (kbutton_t *key);
int Key_StringToKeynum( char *str );
int Key_StringToKeynum( const char *str );
const char *Key_KeynumToString( int keynum/*, qboolean bTranslate*/ ); //note: translate is only called for menu display not configs
//

View File

@ -7642,7 +7642,6 @@ int CQuake3GameInterface::RegisterScript( const char *strFileName, void **ppBuf,
// Precache all the resources needed by a Script and it's Entity (or vice-versa).
int CQuake3GameInterface::PrecacheEntity( gentity_t *pEntity )
{
extern stringID_table_t BSTable[];
int i;
for ( i = 0; i < NUM_BSETS; i++ )

View File

@ -373,7 +373,7 @@ saberMoveName_t transitionMove[Q_NUM_QUADS][Q_NUM_QUADS] =
void PM_VelocityForSaberMove( playerState_t *ps, vec3_t throwDir )
{
vec3_t vForward, vRight, vUp, startQ, endQ;
vec3_t vForward, vRight, vUp, startQ = {0, 0, 0}, endQ = {0, 0, 0};
AngleVectors( ps->viewangles, vForward, vRight, vUp );

View File

@ -1026,7 +1026,7 @@ void G_Victory( gentity_t *ent )
}
}
typedef enum
enum
{
TAUNT_TAUNT = 0,
TAUNT_BOW,

View File

@ -4,7 +4,7 @@
#define __ITEMS_H__
// Items enums
typedef enum
enum
{
ITM_NONE,
@ -77,7 +77,7 @@ ITM_NUM_ITEMS
};
// Inventory item enums
typedef enum //# item_e
enum //# item_e
{
INV_ELECTROBINOCULARS,
INV_BACTA_CANISTER,

View File

@ -85,4 +85,4 @@ void G_Roff( gentity_t *ent );
void G_SaveCachedRoffs();
void G_LoadCachedRoffs();
#endif`
#endif

View File

@ -573,7 +573,7 @@ static void EvaluateField(const save_field_t *pField, byte *pbBase, byte *pbOrig
for (int i=0; i<MAX_ALERT_EVENTS; i++)
{
p[i].owner = GetGEntityPtr((int)(p[i].owner));
p[i].owner = GetGEntityPtr((intptr_t)(p[i].owner));
}
}
break;
@ -584,8 +584,8 @@ static void EvaluateField(const save_field_t *pField, byte *pbBase, byte *pbOrig
for (int i=0; i<MAX_FRAME_GROUPS; i++)
{
p[i].enemy = GetGEntityPtr((int)(p[i].enemy));
p[i].commander = GetGEntityPtr((int)(p[i].commander));
p[i].enemy = GetGEntityPtr((intptr_t)(p[i].enemy));
p[i].commander = GetGEntityPtr((intptr_t)(p[i].commander));
}
}
break;
@ -599,9 +599,9 @@ static void EvaluateField(const save_field_t *pField, byte *pbBase, byte *pbOrig
for ( int j=0; j<MAX_ANIM_EVENTS; j++ )
{
pO = pbOriginalRefData ? level.knownAnimFileSets[i].torsoAnimEvents[j].stringData : NULL;
p[i].torsoAnimEvents[j].stringData = GetStringPtr((int)p[i].torsoAnimEvents[j].stringData, pO);
p[i].torsoAnimEvents[j].stringData = GetStringPtr((intptr_t)p[i].torsoAnimEvents[j].stringData, pO);
pO = pbOriginalRefData ? level.knownAnimFileSets[i].legsAnimEvents[j].stringData : NULL;
p[i].legsAnimEvents[j].stringData = GetStringPtr((int)p[i].legsAnimEvents[j].stringData, pO);
p[i].legsAnimEvents[j].stringData = GetStringPtr((intptr_t)p[i].legsAnimEvents[j].stringData, pO);
}
}
}

View File

@ -3259,7 +3259,7 @@ qboolean WP_LobFire( gentity_t *self, vec3_t start, vec3_t target, vec3_t mins,
//---------------------------------------------------------
{
float targetDist, shotSpeed, speedInc = 100, travelTime, impactDist, bestImpactDist = Q3_INFINITE;//fireSpeed,
vec3_t targetDir, shotVel, failCase;
vec3_t targetDir, shotVel, failCase = {0, 0, 0};
trace_t trace;
trajectory_t tr;
qboolean blocked;
@ -5354,4 +5354,4 @@ void SP_misc_weapon_shooter( gentity_t *self )
{
self->wait = 500;
}
}
}

View File

@ -1,7 +1,7 @@
#ifndef HITLOCS_H
#define HITLOCS_H
typedef enum //# hitloc_e
enum //# hitloc_e
{
HL_NONE = 0,
HL_FOOT_RT,

View File

@ -1283,7 +1283,7 @@ inline char *Q_strupr( char *s1 )
return s1;
}
#endif
inline char *Q_strrchr( const char* str, int c ) { return strrchr(str, c); }
inline char *Q_strrchr( char* str, int c ) { return strrchr(str, c); }
// buffer size safe library replacements
void Q_strncpyz( char *dest, const char *src, int destsize, qboolean bBarfIfTooLong=qfalse );

View File

@ -58,7 +58,7 @@ typedef enum
LOCK_FORCE_DRAIN
} sabersLockMode_t;
typedef enum
enum
{
SABERLOCK_TOP,
SABERLOCK_SIDE,
@ -69,7 +69,7 @@ typedef enum
SABERLOCK_LOSE
};
typedef enum
enum
{
DIR_RIGHT,
DIR_LEFT,
@ -148,7 +148,7 @@ extern char *saberColorStringForColor[];
#define MASK_FORCE_PUSH (MASK_OPAQUE|CONTENTS_SOLID)
typedef enum
enum
{
FORCE_LEVEL_0,
FORCE_LEVEL_1,
@ -159,7 +159,7 @@ typedef enum
#define FORCE_LEVEL_4 (FORCE_LEVEL_3+1)
#define FORCE_LEVEL_5 (FORCE_LEVEL_4+1)
typedef enum
enum
{
FJ_FORWARD,
FJ_BACKWARD,

View File

@ -236,7 +236,7 @@ public:
SSkinGoreData *initgore):
#else
float fRadius):
#endif ):
#endif
surfaceNum(initsurfaceNum),
rootSList(initrootSList),

View File

@ -2497,7 +2497,7 @@ void CM_TraceThroughPatchCollide( traceWork_t *tw, const struct patchCollide_s *
float offset, enterFrac, leaveFrac, t;
patchPlane_t *planes;
facet_t *facet;
float plane[4], bestplane[4];
float plane[4], bestplane[4] = {0, 0, 0, 0};
vec3_t startp, endp;
#ifndef BSPC
static cvar_t *cv;

View File

@ -73,5 +73,5 @@ void CM_TM_Upload(vec3_t player_origin, vec3_t player_angles);
void CM_TM_SaveImageToDisk(const char * terrainName, const char * missionName, const char * seed);
void CM_TM_ConvertPosition(int &x, int &y, int Width, int Height);
#endif CM_TERRAINMAP_H_INC
#endif // CM_TERRAINMAP_H_INC

View File

@ -832,7 +832,7 @@ void CM_TraceThroughTree( traceWork_t *tw, clipMap_t *local, int num, float p1f,
#ifdef _XBOX
plane = cmg.planes + tr.world->nodes[num].planeNum;
#else mnode_s
#else
plane = node->plane;
#endif

View File

@ -1273,6 +1273,8 @@ try
int msec, minMsec;
static int lastTime;
timeBeforeFirstEvents = timeBeforeServer = timeBeforeEvents = timeBeforeClient = 0;
// write config file if anything changed
#ifndef _XBOX
Com_WriteConfiguration();

View File

@ -845,6 +845,6 @@ struct Lump
}
}
};
#endif _XBOX
#endif // _XBOX
#endif //__QCOMMON_H__
#endif //__QCOMMON_H__

View File

@ -568,7 +568,7 @@ typedef struct {
int patchHeight;
} dsurface_t;
#endif _XBOX
#endif // _XBOX
typedef enum //# hunkAllocType_e
{

View File

@ -751,24 +751,28 @@ void CStringEdPackage::AddEntry( LPCSTR psLocalReference )
LPCSTR Leetify( LPCSTR psString )
{
static string str;
str = psString;
if (sp_leet->integer == 42) // very specific test, so you won't hit it accidentally
{
static const
char cReplace[]={ 'o','0','l','1','e','3','a','4','s','5','t','7','i','!','h','#',
'O','0','L','1','E','3','A','4','S','5','T','7','I','!','H','#' // laziness because of strchr()
};
static char *str;
char *p;
free(str);
str = strdup(psString);
for (int i=0; i<sizeof(cReplace); i+=2)
{
while ((p=strchr(str.c_str(),cReplace[i]))!=NULL)
while ((p=strchr(str,cReplace[i]))!=NULL)
*p = cReplace[i+1];
}
}
return str.c_str();
return str;
} else {
return psString;
}
}

View File

@ -215,7 +215,7 @@ static void R_LoadLightmaps( lump_t *l, const char *psMapName, world_t &worldDat
float g = buf_p[j*3+1];
float b = buf_p[j*3+2];
float intensity;
float out[3];
float out[3] = {0, 0, 0};
intensity = 0.33f * r + 0.685f * g + 0.063f * b;

View File

@ -77,7 +77,7 @@ static int vidRestartTime = 0;
IN_PrintKey
===============
*/
static void IN_PrintKey( const SDL_keysym *keysym, fakeAscii_t key, qboolean down )
static void IN_PrintKey( const SDL_keysym *keysym, int key, qboolean down )
{
if( down )
Com_Printf( "+ " );
@ -120,7 +120,7 @@ static void IN_PrintKey( const SDL_keysym *keysym, fakeAscii_t key, qboolean dow
IN_IsConsoleKey
===============
*/
static qboolean IN_IsConsoleKey( fakeAscii_t key, const unsigned char character )
static qboolean IN_IsConsoleKey( int key, const unsigned char character )
{
typedef struct consoleKey_s
{
@ -132,7 +132,7 @@ static qboolean IN_IsConsoleKey( fakeAscii_t key, const unsigned char character
union
{
fakeAscii_t key;
int key;
unsigned char character;
} u;
} consoleKey_t;
@ -144,7 +144,7 @@ static qboolean IN_IsConsoleKey( fakeAscii_t key, const unsigned char character
// Only parse the variable when it changes
if( cl_consoleKeys->modified )
{
char *text_p, *token;
const char *text_p, *token;
cl_consoleKeys->modified = qfalse;
text_p = cl_consoleKeys->string;
@ -212,7 +212,7 @@ IN_TranslateSDLToQ3Key
===============
*/
static const char *IN_TranslateSDLToQ3Key( SDL_keysym *keysym,
fakeAscii_t *key, qboolean down )
int *key, qboolean down )
{
static unsigned char buf[ 2 ] = { '\0', '\0' };
@ -878,7 +878,7 @@ static void IN_ProcessEvents( void )
{
SDL_Event e;
const char *character = NULL;
fakeAscii_t key = 0;
int key = 0;
if( !SDL_WasInit( SDL_INIT_VIDEO ) )
return;

View File

@ -148,13 +148,16 @@ static const char *GetString_FailedToOpenSaveGame(const char *psFilename, qboole
static LPCSTR SG_AddSavePath( LPCSTR psPathlessBaseName )
{
static char sSaveName[8][MAX_OSPATH];
char tpath[MAX_OSPATH];
static int i=0;
i=++i&7;
Q_strncpyz(tpath, psPathlessBaseName, sizeof(tpath));
if(psPathlessBaseName)
{
char *p = strchr(psPathlessBaseName,'/');
char *p = strchr(tpath,'/');
if (p)
{
while (p)
@ -164,7 +167,7 @@ static LPCSTR SG_AddSavePath( LPCSTR psPathlessBaseName )
}
}
}
Com_sprintf( sSaveName[i], MAX_OSPATH, "saves/%s.sav", psPathlessBaseName );
Com_sprintf( sSaveName[i], MAX_OSPATH, "saves/%s.sav", tpath );
return sSaveName[i];
}

View File

@ -146,7 +146,7 @@ void UI_AdjustSaveGameListBox( int currentLine );
void Menus_CloseByName(const char *p);
// Movedata Sounds
typedef enum
enum
{
MDS_NONE = 0,
MDS_FORCE_JUMP,
@ -155,7 +155,7 @@ typedef enum
MDS_MOVE_SOUNDS_MAX
};
typedef enum
enum
{
MD_ACROBATICS = 0,
MD_SINGLE_FAST,
@ -1511,7 +1511,7 @@ static float UI_GetValue(int ownerDraw)
}
//Force Warnings
typedef enum
enum
{
FW_VERY_LIGHT = 0,
FW_SEMI_LIGHT,

View File

@ -1,4 +1,6 @@
cmake_minimum_required(VERSION 2.6)
include(CheckCCompilerFlag)
include(CheckCXXCompilerFlag)
project(jamp)
@ -18,24 +20,45 @@ endif()
if(CMAKE_COMPILER_IS_GNUC OR CMAKE_C_COMPILER_ID STREQUAL "Clang")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pipe -O2")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wno-unknown-pragmas -Wno-write-strings -Wno-missing-braces")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-strict-aliasing -fno-strict-overflow")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wno-unknown-pragmas")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-write-strings -Wno-missing-braces")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-switch -Wno-comment")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-variable")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-multichar")
endif()
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pipe -O2")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-unknown-pragmas -Wno-write-strings -Wno-missing-braces")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-strict-aliasing -fno-strict-overflow")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-unknown-pragmas")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-write-strings -Wno-missing-braces")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-switch -Wno-comment")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-variable")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-multichar")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-reorder")
endif()
if(CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-pragmas -fpermissive")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-pragmas")
endif()
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-parentheses-equality")
endif()
check_c_compiler_flag(-Wno-unused-but-set-variable cc_has_unused_but_set)
if (cc_has_unused_but_set)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-but-set-variable")
endif()
check_cxx_compiler_flag(-Wno-unused-but-set-variable cxx_has_unused_but_set)
if (cxx_has_unused_but_set)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-but-set-variable")
endif()
# avoid -rdynamic or loaded libraries will stomp over cvars
set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")
set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "")

View File

@ -280,7 +280,7 @@ public:
{
return 1;
}
#endif;
#endif
};

View File

@ -1050,8 +1050,8 @@ int AAS_Reachability_Step_Barrier_WaterJump_WalkOffLedge(int area1num, int area2
float length, ground_bestlength, water_bestlength, ground_bestdist, water_bestdist;
vec3_t v1, v2, v3, v4, tmpv, p1area1, p1area2, p2area1, p2area2;
vec3_t normal, ort, edgevec, start, end, dir;
vec3_t ground_beststart, ground_bestend, ground_bestnormal;
vec3_t water_beststart, water_bestend, water_bestnormal;
vec3_t ground_beststart = {0, 0, 0}, ground_bestend = {0, 0, 0}, ground_bestnormal = {0, 0, 0};
vec3_t water_beststart = {0, 0, 0}, water_bestend = {0, 0, 0}, water_bestnormal = {0, 0, 0};
vec3_t invgravity = {0, 0, 1};
vec3_t testpoint;
aas_plane_t *plane;
@ -2368,7 +2368,7 @@ int AAS_Reachability_Ladder(int area1num, int area2num)
float face1area, face2area, bestface1area, bestface2area;
float phys_jumpvel, maxjumpheight;
vec3_t area1point, area2point, v1, v2, up = {0, 0, 1};
vec3_t mid, lowestpoint, start, end, sharededgevec, dir;
vec3_t mid, lowestpoint = {0, 0}, start, end, sharededgevec, dir;
aas_area_t *area1, *area2;
aas_face_t *face1, *face2, *ladderface1, *ladderface2;
aas_plane_t *plane1, *plane2;

View File

@ -72,7 +72,7 @@ typedef struct campspot_s
} campspot_t;
//FIXME: these are game specific
typedef enum {
enum {
GT_FFA, // free for all
GT_HOLOCRON, // holocron match
GT_JEDIMASTER, // jedi master

View File

@ -27,7 +27,7 @@ extern int cg_vehicleAmmoWarning;
extern int cg_vehicleAmmoWarningTime;
//I know, not siege, but...
typedef enum
enum
{
TAUNT_TAUNT = 0,
TAUNT_BOW,

View File

@ -1046,7 +1046,7 @@ extern cgscreffects_t cgScreenEffects;
void CGCam_Shake( float intensity, int duration );
void CGCam_SetMusicMult( float multiplier, int duration );
typedef enum
enum
{
CHUNK_METAL1 = 0,
CHUNK_METAL2,

View File

@ -275,7 +275,7 @@ typedef struct {
} refdef_t;
typedef enum {
enum {
STEREO_CENTER,
STEREO_LEFT,
STEREO_RIGHT

View File

@ -724,7 +724,7 @@ static void keyConcatArgs( void ) {
}
static void ConcatRemaining( const char *src, const char *start ) {
char *str;
const char *str;
str = strstr(src, start);
if (!str) {
@ -1023,7 +1023,7 @@ the K_* names are matched up.
to be configured even if they don't have defined names.
===================
*/
int Key_StringToKeynum( char *str ) {
int Key_StringToKeynum( const char *str ) {
int i;
if ( !str || !str[0] )

View File

@ -501,7 +501,7 @@ void IN_CenterView (void);
void CL_VerifyCode( void );
float CL_KeyState (kbutton_t *key);
int Key_StringToKeynum( char *str );
int Key_StringToKeynum( const char *str );
const char *Key_KeynumToString( int keynum/*, qboolean bTranslate */ ); //note: translate is only called for menu display not configs
//

View File

@ -180,7 +180,7 @@ typedef enum
//for supplier class items
#define TOSS_DEBOUNCE_TIME 5000
typedef enum {
enum {
GT_FFA, // free for all
GT_HOLOCRON, // holocron ffa
GT_JEDIMASTER, // jedi master
@ -206,7 +206,7 @@ extern vec3_t WP_MuzzlePoint[WP_NUM_WEAPONS];
extern int forcePowerSorted[NUM_FORCE_POWERS];
#include "../namespace_end.h"
typedef enum
enum
{
SABERLOCK_TOP,
SABERLOCK_SIDE,
@ -217,7 +217,7 @@ typedef enum
SABERLOCK_LOSE
};
typedef enum
enum
{
DIR_RIGHT,
DIR_LEFT,
@ -380,7 +380,7 @@ typedef enum {
} weaponstate_t;
typedef enum {
enum {
FORCE_MASTERY_UNINITIATED,
FORCE_MASTERY_INITIATE,
FORCE_MASTERY_PADAWAN,
@ -649,7 +649,7 @@ typedef enum {
} effectTypes_t;
// NOTE: may not have more than 16
typedef enum {
enum {
PW_NONE,
PW_QUAD,
@ -683,7 +683,7 @@ typedef enum {
};
typedef int powerup_t;
typedef enum {
enum {
HI_NONE,
HI_SEEKER,
@ -1006,7 +1006,7 @@ typedef enum {
typedef enum {
enum {
TEAM_FREE,
TEAM_RED,
TEAM_BLUE,
@ -1102,7 +1102,7 @@ typedef enum {
//---------------------------------------------------------
// gitem_t->type
typedef enum {
enum {
IT_BAD,
IT_WEAPON, // EFX: rotate + upscale + minlight
IT_AMMO, // EFX: rotate
@ -1286,7 +1286,7 @@ typedef struct
#undef LS_NONE
#endif
typedef enum {
enum {
//totally invalid
LS_INVALID = -1,
// Invalid, or saber not armed

View File

@ -403,7 +403,7 @@ extern int numVehicles;
#define VEH_MOUNT_THROW_RIGHT -6
typedef enum
enum
{
VEH_EJECT_LEFT,
VEH_EJECT_RIGHT,

View File

@ -5,7 +5,7 @@
#ifndef __WEAPONS_H__
#define __WEAPONS_H__
typedef enum {
enum {
WP_NONE,
WP_STUN_BATON,

View File

@ -1650,7 +1650,7 @@ void G_HeldByMonster( gentity_t *ent, usercmd_t **ucmd )
(*ucmd)->upmove = 0;
}
typedef enum
enum
{
TAUNT_TAUNT = 0,
TAUNT_BOW,

View File

@ -95,7 +95,7 @@ typedef enum {
#define SP_PODIUM_MODEL "models/mapobjects/podium/podium4.md3"
typedef enum
enum
{
HL_NONE = 0,
HL_FOOT_RT,
@ -363,7 +363,7 @@ struct gentity_s {
#define DAMAGEREDIRECT_RLEG 2
#define DAMAGEREDIRECT_LLEG 3
typedef enum {
enum {
CON_DISCONNECTED,
CON_CONNECTING,
CON_CONNECTED

View File

@ -617,7 +617,7 @@ typedef enum {
typedef enum
enum
{
SABER_RED,
SABER_ORANGE,
@ -630,7 +630,7 @@ typedef enum
};
typedef int saber_colors_t;
typedef enum
enum
{
FP_FIRST = 0,//marker
FP_HEAL = 0,//instant
@ -883,7 +883,7 @@ typedef struct
} saberInfo_t;
#define MAX_SABERS 2
typedef enum
enum
{
FORCE_LEVEL_0,
FORCE_LEVEL_1,
@ -1007,7 +1007,7 @@ enum sharedEIKMoveState
};
//material stuff needs to be shared
typedef enum //# material_e
enum //# material_e
{
MAT_METAL = 0, // scorched blue-grey metal
MAT_GLASS, // not a real chunk type, just plays an effect with glass sprites
@ -1995,7 +1995,7 @@ typedef struct {
// sound channels
// channel 0 never willingly overrides
// other channels will allways override a playing sound on that channel
typedef enum {
enum {
CHAN_AUTO, //## %s !!"W:\game\base\!!sound\*.wav;*.mp3" # Auto-picks an empty channel to play sound on
CHAN_LOCAL, //## %s !!"W:\game\base\!!sound\*.wav;*.mp3" # menu sounds, etc
CHAN_WEAPON,//## %s !!"W:\game\base\!!sound\*.wav;*.mp3"
@ -3082,7 +3082,7 @@ typedef struct qtime_s {
#define AS_MPLAYER 3 // (Obsolete)
// cinematic states
typedef enum {
enum {
FMV_IDLE,
FMV_PLAY, // play
FMV_EOF, // all other conditions, i.e. stop/EOF/abort
@ -3093,7 +3093,7 @@ typedef enum {
};
typedef int e_status;
typedef enum _flag_status {
enum _flag_status {
FLAG_ATBASE = 0,
FLAG_TAKEN, // CTF
FLAG_TAKEN_RED, // One Flag CTF
@ -3136,7 +3136,7 @@ typedef struct {
// For ghoul2 axis use
typedef enum Eorientations
enum Eorientations
{
ORIGIN = 0,
POSITIVE_X,
@ -3154,7 +3154,7 @@ Ghoul2 Insert End
// define the new memory tags for the zone, used by all modules now
//
#define TAGDEF(blah) TAG_ ## blah
typedef enum {
enum {
#include "../qcommon/tags.h"
};
typedef char memtag_t;

View File

@ -1,7 +1,7 @@
#ifndef TEAMS_H
#define TEAMS_H
typedef enum //# team_e
enum //# team_e
{
NPCTEAM_FREE, // also TEAM_FREE - caution, some code checks a team_t via "if (!team_t_varname)" so I guess this should stay as entry 0, great or what? -slc
NPCTEAM_ENEMY, // also TEAM_RED

View File

@ -32,7 +32,7 @@
#define FORCE_LIGHTNING_RADIUS 300
#define MAX_DRAIN_DISTANCE 512
typedef enum
enum
{
FJ_FORWARD,
FJ_BACKWARD,

View File

@ -220,5 +220,5 @@ protected:
static keywordArray_t m_conditionalKeywords[]; //Conditional
};
#endif __cplusplus
#endif // __cplusplus
#endif //__INTERPRETER__

View File

@ -14,4 +14,4 @@ using namespace ui;
//#error Including namespace_end.h, but not in UI/GAME/CGAME
#endif
#endif _XBOX
#endif // _XBOX

View File

@ -832,6 +832,11 @@ qboolean CROFFSystem::ApplyROFF( SROFFEntity *roff_ent, CROFFSystem::CROFF *roff
origin = originTemp;
VM_Call( cgvm, CG_GET_ANGLES, roff_ent->mEntID, angleTemp );
angle = angleTemp;
#else
originTrajectory = NULL;
angleTrajectory = NULL;
origin = NULL;
angle = NULL;
#endif
}
else
@ -978,6 +983,11 @@ qboolean CROFFSystem::ClearLerp( SROFFEntity *roff_ent )
origin = originTemp;
VM_Call( cgvm, CG_GET_ANGLES, roff_ent->mEntID, angleTemp );
angle = angleTemp;
#else
originTrajectory = NULL;
angleTrajectory = NULL;
origin = NULL;
angle = NULL;
#endif
}
else

View File

@ -1395,7 +1395,7 @@ void CM_TraceThroughPatchCollide( traceWork_t *tw, trace_t &trace, const struct
float offset, enterFrac, leaveFrac, t;
patchPlane_t *planes;
facet_t *facet;
float plane[4], bestplane[4];
float plane[4], bestplane[4] = {0, 0, 0, 0};
vec3_t startp, endp;
#ifndef BSPC
static cvar_t *cv;

View File

@ -79,5 +79,5 @@ void CM_TM_Upload(vec3_t player_origin, vec3_t player_angles);
void CM_TM_SaveImageToDisk(const char * terrainName, const char * missionName, const char * seed);
void CM_TM_ConvertPosition(int &x, int &y, int Width, int Height);
#endif CM_TERRAINMAP_H_INC
#endif // CM_TERRAINMAP_H_INC

View File

@ -646,7 +646,7 @@ bool FS_FileCacheable(const char* const filename)
FS_ShiftedStrStr
===========
*/
char *FS_ShiftedStrStr(const char *string, const char *substring, int shift) {
const char *FS_ShiftedStrStr(const char *string, const char *substring, int shift) {
char buf[MAX_STRING_TOKENS];
int i;

View File

@ -3269,7 +3269,7 @@ void MSG_initHuffman() {
Cbuf_AddText( "condump dump.txt\n" );
}
#endif _USINGNEWHUFFTABLE_
#endif // _USINGNEWHUFFTABLE_
void MSG_shutdownHuffman()
{

View File

@ -1129,6 +1129,6 @@ struct Lump
}
}
};
#endif _XBOX
#endif // _XBOX
#endif // _QCOMMON_H_

View File

@ -751,24 +751,28 @@ void CStringEdPackage::AddEntry( LPCSTR psLocalReference )
LPCSTR Leetify( LPCSTR psString )
{
static string str;
str = psString;
if (sp_leet->integer == 42) // very specific test, so you won't hit it accidentally
{
static const
char cReplace[]={ 'o','0','l','1','e','3','a','4','s','5','t','7','i','!','h','#',
'O','0','L','1','E','3','A','4','S','5','T','7','I','!','H','#' // laziness because of strchr()
};
static char *str;
char *p;
free(str);
str = strdup(psString);
for (int i=0; i<sizeof(cReplace); i+=2)
{
while ((p=strchr(str.c_str(),cReplace[i]))!=NULL)
while ((p=strchr(str,cReplace[i]))!=NULL)
*p = cReplace[i+1];
}
}
return str.c_str();
return str;
} else {
return psString;
}
}

View File

@ -210,7 +210,7 @@ static void R_LoadLightmaps( lump_t *l, const char *psMapName, world_t &worldDat
float g = buf_p[j*3+1];
float b = buf_p[j*3+2];
float intensity;
float out[3];
float out[3] = {0, 0, 0};
intensity = 0.33f * r + 0.685f * g + 0.063f * b;

View File

@ -1206,7 +1206,7 @@ image_t *R_CreateImage( const char *name, const byte *pic, int width, int height
if (name[0] == '*')
{
char *psLightMapNameSearchPos = strrchr(name,'/');
const char *psLightMapNameSearchPos = strrchr(name,'/');
if ( psLightMapNameSearchPos && !strncmp( psLightMapNameSearchPos+1, "lightmap", 8 ) ) {
isLightmap = qtrue;
}

View File

@ -1190,7 +1190,7 @@ void GLimp_EndFrame( void )
needToToggle = (!!r_fullscreen->integer != fullscreen) ? qtrue : qfalse;
if( needToToggle )
sdlToggled = SDL_WM_ToggleFullScreen( s );
sdlToggled = SDL_WM_ToggleFullScreen( s ) ? qtrue : qfalse;
}
if( needToToggle )

View File

@ -77,7 +77,7 @@ static int vidRestartTime = 0;
IN_PrintKey
===============
*/
static void IN_PrintKey( const SDL_keysym *keysym, fakeAscii_t key, qboolean down )
static void IN_PrintKey( const SDL_keysym *keysym, int key, qboolean down )
{
if( down )
Com_Printf( "+ " );
@ -120,7 +120,7 @@ static void IN_PrintKey( const SDL_keysym *keysym, fakeAscii_t key, qboolean dow
IN_IsConsoleKey
===============
*/
static qboolean IN_IsConsoleKey( fakeAscii_t key, const unsigned char character )
static qboolean IN_IsConsoleKey( int key, const unsigned char character )
{
typedef struct consoleKey_s
{
@ -132,7 +132,7 @@ static qboolean IN_IsConsoleKey( fakeAscii_t key, const unsigned char character
union
{
fakeAscii_t key;
int key;
unsigned char character;
} u;
} consoleKey_t;
@ -144,7 +144,7 @@ static qboolean IN_IsConsoleKey( fakeAscii_t key, const unsigned char character
// Only parse the variable when it changes
if( cl_consoleKeys->modified )
{
char *text_p, *token;
const char *text_p, *token;
cl_consoleKeys->modified = qfalse;
text_p = cl_consoleKeys->string;
@ -212,7 +212,7 @@ IN_TranslateSDLToQ3Key
===============
*/
static const char *IN_TranslateSDLToQ3Key( SDL_keysym *keysym,
fakeAscii_t *key, qboolean down )
int *key, qboolean down )
{
static unsigned char buf[ 2 ] = { '\0', '\0' };
@ -878,7 +878,7 @@ static void IN_ProcessEvents( void )
{
SDL_Event e;
const char *character = NULL;
fakeAscii_t key = 0;
int key = 0;
if( !SDL_WasInit( SDL_INIT_VIDEO ) )
return;

View File

@ -138,7 +138,7 @@ class CNavigator
#if __NEWCOLLECT
typedef struct nodeList_t
struct nodeList_t
{
int nodeID;
unsigned int distance;
@ -277,4 +277,4 @@ private:
extern CNavigator navigator;
#endif //__G_NAVIGATOR__
#endif //__G_NAVIGATOR__

View File

@ -363,7 +363,7 @@ void UI_XBL_FriendsListScript(char **args, const char *name)
#endif // _XBOX
// Movedata Sounds
typedef enum
enum
{
MDS_NONE = 0,
MDS_FORCE_JUMP,
@ -372,7 +372,7 @@ typedef enum
MDS_MOVE_SOUNDS_MAX
};
typedef enum
enum
{
MD_ACROBATICS = 0,
MD_SINGLE_FAST,

View File

@ -191,7 +191,7 @@ Ghoul2 Insert End
*/
} uiImport_t;
typedef enum {
enum {
UIMENU_NONE,
UIMENU_MAIN,
UIMENU_INGAME,