From dbf733b95cdb87a884acb0e3b8f1ab7698d766b8 Mon Sep 17 00:00:00 2001 From: Jonathan Gray Date: Tue, 23 Apr 2013 16:54:20 +1000 Subject: [PATCH] add and use Q_stricmp/Q_strcmpi/Q_strlwr/Q_strupr --- code/0_compiled_first/0_SH_Leak.cpp | 8 +- code/RMG/RM_InstanceFile.cpp | 12 +- code/RMG/RM_Instance_BSP.cpp | 16 +-- code/RMG/RM_Instance_Group.cpp | 16 +-- code/RMG/RM_Instance_Random.cpp | 2 +- code/RMG/RM_Manager.cpp | 6 +- code/RMG/RM_Mission.cpp | 10 +- code/RMG/RM_Objective.cpp | 2 +- code/RMG/RM_Path.cpp | 4 +- code/RMG/RM_Terrain.cpp | 12 +- code/Ratl/ratl_common.h | 8 +- code/Ratl/string_vs.h | 2 +- code/cgame/FxScheduler.cpp | 32 ++--- code/cgame/FxScheduler.h | 2 +- code/cgame/FxTemplate.cpp | 174 ++++++++++++------------ code/cgame/cg_credits.cpp | 16 +-- code/cgame/cg_main.cpp | 2 +- code/cgame/cg_players.cpp | 2 +- code/cgame/cg_servercmds.cpp | 18 +-- code/client/cl_cin.cpp | 8 +- code/client/cl_keys.cpp | 2 +- code/client/snd_ambient.cpp | 8 +- code/client/snd_dma.cpp | 16 +-- code/client/snd_dma_console.cpp | 2 +- code/client/snd_mem.cpp | 12 +- code/client/snd_music.cpp | 4 +- code/ff/ff_ChannelSet.cpp | 6 +- code/ff/ff_ConfigParser.cpp | 10 +- code/ff/ff_ffset.cpp | 8 +- code/ff/ff_system.cpp | 2 +- code/game/NPC_spawn.cpp | 4 +- code/game/NPC_stats.cpp | 20 +-- code/game/Q3_Interface.cpp | 190 +++++++++++++-------------- code/game/g_navigator.cpp | 4 +- code/game/g_ref.cpp | 4 +- code/game/g_roff.cpp | 2 +- code/game/g_utils.cpp | 14 +- code/game/genericparser2.cpp | 14 +- code/game/q_shared.h | 35 ++++- code/ghoul2/G2_bolts.cpp | 2 +- code/ghoul2/G2_bones.cpp | 8 +- code/ghoul2/G2_misc.cpp | 4 +- code/ghoul2/G2_surfaces.cpp | 4 +- code/icarus/IcarusImplementation.cpp | 2 +- code/qcommon/cm_load.cpp | 2 +- code/qcommon/cm_load_xbox.cpp | 2 +- code/qcommon/cm_terrain.cpp | 4 +- code/qcommon/common.cpp | 2 +- code/qcommon/files_common.cpp | 2 +- code/qcommon/files_console.cpp | 4 +- code/qcommon/files_pc.cpp | 18 +-- code/qcommon/sstring.h | 8 +- code/qcommon/stringed_ingame.cpp | 28 ++-- code/renderer/tr_WorldEffects.cpp | 38 +++--- code/renderer/tr_ghoul2.cpp | 2 +- code/renderer/tr_image.cpp | 4 +- code/renderer/tr_init.cpp | 4 +- code/renderer/tr_model.cpp | 2 +- code/renderer/tr_shader.cpp | 8 +- code/renderer/tr_terrain.cpp | 6 +- code/server/sv_client.cpp | 2 +- code/server/sv_savegame.cpp | 10 +- code/ui/ui_debug.cpp | 20 +-- code/ui/ui_main.cpp | 12 +- code/ui/ui_shared.cpp | 12 +- code/unix/linux_glimp.c | 4 +- code/unix/unix_net.c | 2 +- code/unix/unix_shared.c | 8 -- code/win32/win_filecode.cpp | 4 +- code/win32/win_glimp.cpp | 8 +- code/win32/win_glimp_console.cpp | 4 +- code/win32/win_main_console.cpp | 2 +- 72 files changed, 488 insertions(+), 463 deletions(-) diff --git a/code/0_compiled_first/0_SH_Leak.cpp b/code/0_compiled_first/0_SH_Leak.cpp index 780e5df..23a6a9c 100644 --- a/code/0_compiled_first/0_SH_Leak.cpp +++ b/code/0_compiled_first/0_SH_Leak.cpp @@ -173,7 +173,7 @@ MEM_BOOL MEM_CALLBACK MyMemReporter2(MEM_ERROR_INFO *info) { if (StackCache[i]<0||StackCache[i]>=nStack) continue; - if (!strcmpi(start,StackNames[StackCache[i]])) + if (!Q_strcmpi(start,StackNames[StackCache[i]])) break; } if (i<48) @@ -185,7 +185,7 @@ MEM_BOOL MEM_CALLBACK MyMemReporter2(MEM_ERROR_INFO *info) { for (i=0;i=nStack) continue; - if (!strcmpi(start,StackNames[StackCache[i]])) + if (!Q_strcmpi(start,StackNames[StackCache[i]])) break; } if (i<48) @@ -366,7 +366,7 @@ MEM_BOOL MEM_CALLBACK MyMemReporter3(MEM_ERROR_INFO *info) { for (i=0;iGetNext ( ) ) { // Skip it if the name doesnt match - if ( stricmp ( name, group->FindPairValue ( "name", "" ) ) ) + if ( Q_stricmp ( name, group->FindPairValue ( "name", "" ) ) ) { continue; } // Handle the various forms of instance types - if ( !stricmp ( group->GetName ( ), "bsp" ) ) + if ( !Q_stricmp ( group->GetName ( ), "bsp" ) ) { instance = new CRMBSPInstance ( group, *this ); } - else if ( !stricmp ( group->GetName ( ), "npc" ) ) + else if ( !Q_stricmp ( group->GetName ( ), "npc" ) ) { // instance = new CRMNPCInstance ( group, *this ); continue; } - else if ( !stricmp ( group->GetName ( ), "group" ) ) + else if ( !Q_stricmp ( group->GetName ( ), "group" ) ) { instance = new CRMGroupInstance ( group, *this ); } - else if ( !stricmp ( group->GetName ( ), "random" ) ) + else if ( !Q_stricmp ( group->GetName ( ), "random" ) ) { instance = new CRMRandomInstance ( group, *this ); } - else if ( !stricmp ( group->GetName ( ), "void" ) ) + else if ( !Q_stricmp ( group->GetName ( ), "void" ) ) { instance = new CRMVoidInstance ( group, *this ); } diff --git a/code/RMG/RM_Instance_BSP.cpp b/code/RMG/RM_Instance_BSP.cpp index 919191d..448cc1e 100644 --- a/code/RMG/RM_Instance_BSP.cpp +++ b/code/RMG/RM_Instance_BSP.cpp @@ -43,14 +43,14 @@ CRMBSPInstance::CRMBSPInstance(CGPGroup *instGroup, CRMInstanceFile& instFile) mHoleRadius = atof( instGroup->FindPairValue ( "hole", "0" ) ); const char * automapSymName = instGroup->FindPairValue ( "automap_symbol", "building" ); - if (0 == strcmpi(automapSymName, "none")) mAutomapSymbol = AUTOMAP_NONE ; - else if (0 == strcmpi(automapSymName, "building")) mAutomapSymbol = AUTOMAP_BLD ; - else if (0 == strcmpi(automapSymName, "objective")) mAutomapSymbol = AUTOMAP_OBJ ; - else if (0 == strcmpi(automapSymName, "start")) mAutomapSymbol = AUTOMAP_START; - else if (0 == strcmpi(automapSymName, "end")) mAutomapSymbol = AUTOMAP_END ; - else if (0 == strcmpi(automapSymName, "enemy")) mAutomapSymbol = AUTOMAP_ENEMY; - else if (0 == strcmpi(automapSymName, "friend")) mAutomapSymbol = AUTOMAP_FRIEND; - else if (0 == strcmpi(automapSymName, "wall")) mAutomapSymbol = AUTOMAP_WALL; + if (0 == Q_strcmpi(automapSymName, "none")) mAutomapSymbol = AUTOMAP_NONE ; + else if (0 == Q_strcmpi(automapSymName, "building")) mAutomapSymbol = AUTOMAP_BLD ; + else if (0 == Q_strcmpi(automapSymName, "objective")) mAutomapSymbol = AUTOMAP_OBJ ; + else if (0 == Q_strcmpi(automapSymName, "start")) mAutomapSymbol = AUTOMAP_START; + else if (0 == Q_strcmpi(automapSymName, "end")) mAutomapSymbol = AUTOMAP_END ; + else if (0 == Q_strcmpi(automapSymName, "enemy")) mAutomapSymbol = AUTOMAP_ENEMY; + else if (0 == Q_strcmpi(automapSymName, "friend")) mAutomapSymbol = AUTOMAP_FRIEND; + else if (0 == Q_strcmpi(automapSymName, "wall")) mAutomapSymbol = AUTOMAP_WALL; else mAutomapSymbol = atoi( automapSymName ); // optional instance objective strings diff --git a/code/RMG/RM_Instance_Group.cpp b/code/RMG/RM_Instance_Group.cpp index 4ebefad..0660ca5 100644 --- a/code/RMG/RM_Instance_Group.cpp +++ b/code/RMG/RM_Instance_Group.cpp @@ -32,13 +32,13 @@ CRMGroupInstance::CRMGroupInstance ( CGPGroup *instGroup, CRMInstanceFile& instF mConfineRadius = atof ( instGroup->FindPairValue ( "confine", "0" ) ); const char * automapSymName = instGroup->FindPairValue ( "automap_symbol", "none" ); - if (0 == strcmpi(automapSymName, "none")) mAutomapSymbol = AUTOMAP_NONE ; - else if (0 == strcmpi(automapSymName, "building")) mAutomapSymbol = AUTOMAP_BLD ; - else if (0 == strcmpi(automapSymName, "objective")) mAutomapSymbol = AUTOMAP_OBJ ; - else if (0 == strcmpi(automapSymName, "start")) mAutomapSymbol = AUTOMAP_START; - else if (0 == strcmpi(automapSymName, "end")) mAutomapSymbol = AUTOMAP_END ; - else if (0 == strcmpi(automapSymName, "enemy")) mAutomapSymbol = AUTOMAP_ENEMY; - else if (0 == strcmpi(automapSymName, "friend")) mAutomapSymbol = AUTOMAP_FRIEND; + if (0 == Q_strcmpi(automapSymName, "none")) mAutomapSymbol = AUTOMAP_NONE ; + else if (0 == Q_strcmpi(automapSymName, "building")) mAutomapSymbol = AUTOMAP_BLD ; + else if (0 == Q_strcmpi(automapSymName, "objective")) mAutomapSymbol = AUTOMAP_OBJ ; + else if (0 == Q_strcmpi(automapSymName, "start")) mAutomapSymbol = AUTOMAP_START; + else if (0 == Q_strcmpi(automapSymName, "end")) mAutomapSymbol = AUTOMAP_END ; + else if (0 == Q_strcmpi(automapSymName, "enemy")) mAutomapSymbol = AUTOMAP_ENEMY; + else if (0 == Q_strcmpi(automapSymName, "friend")) mAutomapSymbol = AUTOMAP_FRIEND; else mAutomapSymbol = atoi( automapSymName ); // optional instance objective strings @@ -60,7 +60,7 @@ CRMGroupInstance::CRMGroupInstance ( CGPGroup *instGroup, CRMInstanceFile& instF float maxrange; // Make sure only instances are specified as sub groups - assert ( 0 == stricmp ( instGroup->GetName ( ), "instance" ) ); + assert ( 0 == Q_stricmp ( instGroup->GetName ( ), "instance" ) ); // Grab the name name = instGroup->FindPairValue ( "name", "" ); diff --git a/code/RMG/RM_Instance_Random.cpp b/code/RMG/RM_Instance_Random.cpp index 003eb35..eae6a42 100644 --- a/code/RMG/RM_Instance_Random.cpp +++ b/code/RMG/RM_Instance_Random.cpp @@ -38,7 +38,7 @@ CRMRandomInstance::CRMRandomInstance ( CGPGroup *instGroup, CRMInstanceFile& ins group = group->GetNext ( ) ) { // If this isnt an instance group then skip it - if ( stricmp ( group->GetName ( ), "instance" ) ) + if ( Q_stricmp ( group->GetName ( ), "instance" ) ) { continue; } diff --git a/code/RMG/RM_Manager.cpp b/code/RMG/RM_Manager.cpp index 83e1b76..9e2d8a3 100644 --- a/code/RMG/RM_Manager.cpp +++ b/code/RMG/RM_Manager.cpp @@ -111,7 +111,7 @@ bool CRMManager::LoadMission ( qboolean IsServer ) // Grab the arioche variables Cvar_VariableStringBuffer("rmg_usetimelimit", temp, MAX_QPATH); - if (strcmpi(temp, "yes") == 0) + if (Q_strcmpi(temp, "yes") == 0) { mUseTimeLimit = true; } @@ -158,7 +158,7 @@ bool CRMManager::LoadMission ( qboolean IsServer ) if(Com_ParseTextFile(va("ext_data/rmg/%s.teams", temp), parser)) { root = parser.GetBaseParseGroup()->GetSubGroups(); - if (0 == stricmp(root->GetName(), "teams")) + if (0 == Q_stricmp(root->GetName(), "teams")) { SV_SetConfigstring( CS_GAMETYPE_REDTEAM, root->FindPairValue ( "red", "marine" )); SV_SetConfigstring( CS_GAMETYPE_BLUETEAM, root->FindPairValue ( "blue", "thug" )); @@ -285,7 +285,7 @@ void CRMManager::UpdateStatisticCvars ( void ) // show difficulty char difficulty[MAX_QPATH]; gi.Cvar_VariableStringBuffer("g_skill", difficulty, MAX_QPATH); - strupr(difficulty); + Q_strupr(difficulty); gi.Cvar_Set ( "ar_diff", va("&GENERIC_%s&",difficulty) ); // compute rank diff --git a/code/RMG/RM_Mission.cpp b/code/RMG/RM_Mission.cpp index 8f8cc3e..fa1e034 100644 --- a/code/RMG/RM_Mission.cpp +++ b/code/RMG/RM_Mission.cpp @@ -131,7 +131,7 @@ CRMObjective* CRMMission::FindObjective ( const char* name ) for (it = mObjectives.begin(); it != mObjectives.end(); it++) { // Does it match? - if (!stricmp ((*it)->GetName(), name )) + if (!Q_stricmp ((*it)->GetName(), name )) { return (*it); } @@ -744,8 +744,8 @@ bool CRMMission::ParseInstancesOnPath ( CGPGroup* group ) for ( defenseGroup = group->GetSubGroups(); defenseGroup; defenseGroup=defenseGroup->GetNext() ) - if (stricmp ( defenseGroup->GetName ( ), "defenses" )==0 || - stricmp ( defenseGroup->GetName(), "instanceonpath")==0) + if (Q_stricmp ( defenseGroup->GetName ( ), "defenses" )==0 || + Q_stricmp ( defenseGroup->GetName(), "instanceonpath")==0) { const char* defName = defenseGroup->FindPairValue ( "instance", "" ); if ( *defName ) @@ -1206,7 +1206,7 @@ CGPGroup* CRMMission::ParseRandom ( CGPGroup* randomGroup ) group; group = group->GetNext ( ) ) { - if ( stricmp ( group->GetName ( ), "random_choice" ) ) + if ( Q_stricmp ( group->GetName ( ), "random_choice" ) ) { continue; } @@ -1387,7 +1387,7 @@ bool CRMMission::Load ( const char* mission, const char* instances, const char* // Grab the root parser groop and make sure its mission, otherwise this // isnt a valid mission file root = parser.GetBaseParseGroup()->GetSubGroups(); - if(stricmp(root->GetName(), "mission")) + if(Q_stricmp(root->GetName(), "mission")) { Com_Printf("ERROR: '%s' is not a valid mission file\n", mission ); parser.Clean(); diff --git a/code/RMG/RM_Objective.cpp b/code/RMG/RM_Objective.cpp index 2b13451..5cb4680 100644 --- a/code/RMG/RM_Objective.cpp +++ b/code/RMG/RM_Objective.cpp @@ -86,7 +86,7 @@ CRMObjective::CRMObjective ( CGPGroup* group ) } // If the objective names dont match then ignore this trigger - if ( stricmp ( trigger->GetObjectiveName ( ), GetTrigger() ) ) + if ( Q_stricmp ( trigger->GetObjectiveName ( ), GetTrigger() ) ) { continue; } diff --git a/code/RMG/RM_Path.cpp b/code/RMG/RM_Path.cpp index 5805bb4..8131444 100644 --- a/code/RMG/RM_Path.cpp +++ b/code/RMG/RM_Path.cpp @@ -95,7 +95,7 @@ void CRMPathManager::CreateLocation ( const char* name, const int min_depth, int } for (i = mLocations.size()-1; i>=0; --i) - if ( !stricmp ( name, mLocations[i]->GetName ( ) ) ) + if ( !Q_stricmp ( name, mLocations[i]->GetName ( ) ) ) { mLocations[i]->SetMinDepth(min_depth); mLocations[i]->SetMaxDepth(max_depth); @@ -449,7 +449,7 @@ CRMNode* CRMPathManager::FindNodeByName ( const char* name ) for ( j = mNodes.size() - 1; j >=0; j-- ) { - if ( !stricmp ( name, mNodes[j]->GetName ( ) ) ) + if ( !Q_stricmp ( name, mNodes[j]->GetName ( ) ) ) return mNodes[j]; } return NULL; diff --git a/code/RMG/RM_Terrain.cpp b/code/RMG/RM_Terrain.cpp index bb528f6..b128b60 100644 --- a/code/RMG/RM_Terrain.cpp +++ b/code/RMG/RM_Terrain.cpp @@ -85,7 +85,7 @@ void CRMLandScape::LoadMiscentDef(const char *td) items = classes->GetSubGroups(); while(items) { - if(!stricmp(items->GetName(), "miscent")) + if(!Q_stricmp(items->GetName(), "miscent")) { int height, maxheight; @@ -96,7 +96,7 @@ void CRMLandScape::LoadMiscentDef(const char *td) model = items->GetSubGroups(); while(model) { - if(!stricmp(model->GetName(), "model")) + if(!Q_stricmp(model->GetName(), "model")) { CRandomModel hd; @@ -109,19 +109,19 @@ void CRMLandScape::LoadMiscentDef(const char *td) pair = model->GetPairs(); while(pair) { - if(!stricmp(pair->GetName(), "name")) + if(!Q_stricmp(pair->GetName(), "name")) { hd.SetModel(pair->GetTopValue()); } - else if(!stricmp(pair->GetName(), "frequency")) + else if(!Q_stricmp(pair->GetName(), "frequency")) { hd.SetFrequency((float)atof(pair->GetTopValue())); } - else if(!stricmp(pair->GetName(), "minscale")) + else if(!Q_stricmp(pair->GetName(), "minscale")) { hd.SetMinScale((float)atof(pair->GetTopValue())); } - else if(!stricmp(pair->GetName(), "maxscale")) + else if(!Q_stricmp(pair->GetName(), "maxscale")) { hd.SetMaxScale((float)atof(pair->GetTopValue())); } diff --git a/code/Ratl/ratl_common.h b/code/Ratl/ratl_common.h index 33de96e..8cdf7c0 100644 --- a/code/Ratl/ratl_common.h +++ b/code/Ratl/ratl_common.h @@ -225,19 +225,19 @@ namespace str } inline int icmp(const char *s1,const char *s2) { - return stricmp(s1,s2); + return Q_stricmp(s1,s2); } inline int cmpi(const char *s1,const char *s2) { - return stricmp(s1,s2); + return Q_stricmp(s1,s2); } inline bool ieql(const char *s1,const char *s2) { - return !stricmp(s1,s2); + return !Q_stricmp(s1,s2); } inline bool eqli(const char *s1,const char *s2) { - return !stricmp(s1,s2); + return !Q_stricmp(s1,s2); } inline char *tok(char *s,const char *gap) diff --git a/code/Ratl/string_vs.h b/code/Ratl/string_vs.h index 2adf9d0..f796b56 100644 --- a/code/Ratl/string_vs.h +++ b/code/Ratl/string_vs.h @@ -181,7 +181,7 @@ public: //////////////////////////////////////////////////////////////////////////////////// bool operator==(const string_vs &o) const { - if (!stricmp(mData,o.mData)) + if (!Q_stricmp(mData,o.mData)) { return true; } diff --git a/code/cgame/FxScheduler.cpp b/code/cgame/FxScheduler.cpp index 85ed684..0528836 100644 --- a/code/cgame/FxScheduler.cpp +++ b/code/cgame/FxScheduler.cpp @@ -504,7 +504,7 @@ int CFxScheduler::ParseEffect( const char *file, CGPGroup *base ) if ((pair = base->GetPairs())!=0) { grpName = pair->GetName(); - if ( !stricmp( grpName, "repeatDelay" )) + if ( !Q_stricmp( grpName, "repeatDelay" )) { effect->mRepeatDelay = atoi(pair->GetTopValue()); } @@ -521,61 +521,61 @@ int CFxScheduler::ParseEffect( const char *file, CGPGroup *base ) grpName = primitiveGroup->GetName(); // Huge stricmp lists suxor - if ( !stricmp( grpName, "particle" )) + if ( !Q_stricmp( grpName, "particle" )) { type = Particle; } - else if ( !stricmp( grpName, "line" )) + else if ( !Q_stricmp( grpName, "line" )) { type = Line; } - else if ( !stricmp( grpName, "tail" )) + else if ( !Q_stricmp( grpName, "tail" )) { type = Tail; } - else if ( !stricmp( grpName, "sound" )) + else if ( !Q_stricmp( grpName, "sound" )) { type = Sound; } #ifdef _IMMERSION - else if ( !stricmp( grpName, "forcefeedback" )) + else if ( !Q_stricmp( grpName, "forcefeedback" )) { type = Force; } #endif // _IMMERSION - else if ( !stricmp( grpName, "cylinder" )) + else if ( !Q_stricmp( grpName, "cylinder" )) { type = Cylinder; } - else if ( !stricmp( grpName, "electricity" )) + else if ( !Q_stricmp( grpName, "electricity" )) { type = Electricity; } - else if ( !stricmp( grpName, "emitter" )) + else if ( !Q_stricmp( grpName, "emitter" )) { type = Emitter; } - else if ( !stricmp( grpName, "decal" )) + else if ( !Q_stricmp( grpName, "decal" )) { type = Decal; } - else if ( !stricmp( grpName, "orientedparticle" )) + else if ( !Q_stricmp( grpName, "orientedparticle" )) { type = OrientedParticle; } - else if ( !stricmp( grpName, "fxrunner" )) + else if ( !Q_stricmp( grpName, "fxrunner" )) { type = FxRunner; } - else if ( !stricmp( grpName, "light" )) + else if ( !Q_stricmp( grpName, "light" )) { type = Light; } - else if ( !stricmp( grpName, "cameraShake" )) + else if ( !Q_stricmp( grpName, "cameraShake" )) { type = CameraShake; } - else if ( !stricmp( grpName, "flash" )) + else if ( !Q_stricmp( grpName, "flash" )) { type = ScreenFlash; } @@ -758,7 +758,7 @@ CPrimitiveTemplate *CFxScheduler::GetPrimitiveCopy( SEffectTemplate *effectCopy, for ( int i = 0; i < effectCopy->mPrimitiveCount; i++ ) { - if ( !stricmp( effectCopy->mPrimitives[i]->mName, componentName )) + if ( !Q_stricmp( effectCopy->mPrimitives[i]->mName, componentName )) { // we found a match, so return it return effectCopy->mPrimitives[i]; diff --git a/code/cgame/FxScheduler.h b/code/cgame/FxScheduler.h index 585abca..3c48757 100644 --- a/code/cgame/FxScheduler.h +++ b/code/cgame/FxScheduler.h @@ -361,7 +361,7 @@ struct SEffectTemplate bool operator == (const char * name) const { - return !stricmp( mEffectName, name ); + return !Q_stricmp( mEffectName, name ); } void operator=(const SEffectTemplate &that); }; diff --git a/code/cgame/FxTemplate.cpp b/code/cgame/FxTemplate.cpp index 59dbabc..0a2f099 100644 --- a/code/cgame/FxTemplate.cpp +++ b/code/cgame/FxTemplate.cpp @@ -264,23 +264,23 @@ bool CPrimitiveTemplate::ParseGroupFlags( const char *val, int *flags ) return true; } - if ( !stricmp( flag[i], "linear" )) + if ( !Q_stricmp( flag[i], "linear" )) { *flags |= FX_LINEAR; } - else if ( !stricmp( flag[i], "nonlinear" )) + else if ( !Q_stricmp( flag[i], "nonlinear" )) { *flags |= FX_NONLINEAR; } - else if ( !stricmp( flag[i], "wave" )) + else if ( !Q_stricmp( flag[i], "wave" )) { *flags |= FX_WAVE; } - else if ( !stricmp( flag[i], "random" )) + else if ( !Q_stricmp( flag[i], "random" )) { *flags |= FX_RAND; } - else if ( !stricmp( flag[i], "clamp" )) + else if ( !Q_stricmp( flag[i], "clamp" )) { *flags |= FX_CLAMP; } @@ -684,57 +684,57 @@ bool CPrimitiveTemplate::ParseFlags( const char *val ) return true; } - if ( !stricmp( flag[i], "useModel" )) + if ( !Q_stricmp( flag[i], "useModel" )) { mFlags |= FX_ATTACHED_MODEL; } - else if ( !stricmp( flag[i], "useBBox" )) + else if ( !Q_stricmp( flag[i], "useBBox" )) { mFlags |= FX_USE_BBOX; } - else if ( !stricmp( flag[i], "usePhysics" )) + else if ( !Q_stricmp( flag[i], "usePhysics" )) { mFlags |= FX_APPLY_PHYSICS; } - else if ( !stricmp( flag[i], "expensivePhysics" )) + else if ( !Q_stricmp( flag[i], "expensivePhysics" )) { mFlags |= FX_EXPENSIVE_PHYSICS; } //rww - begin g2 stuff - else if ( !stricmp( flag[i], "ghoul2Collision" )) + else if ( !Q_stricmp( flag[i], "ghoul2Collision" )) { mFlags |= (FX_GHOUL2_TRACE|FX_APPLY_PHYSICS|FX_EXPENSIVE_PHYSICS); } - else if ( !stricmp( flag[i], "ghoul2Decals" )) + else if ( !Q_stricmp( flag[i], "ghoul2Decals" )) { mFlags |= FX_GHOUL2_DECALS; } //rww - end - else if ( !stricmp( flag[i], "impactKills" )) + else if ( !Q_stricmp( flag[i], "impactKills" )) { mFlags |= FX_KILL_ON_IMPACT; } - else if ( !stricmp( flag[i], "impactFx" )) + else if ( !Q_stricmp( flag[i], "impactFx" )) { mFlags |= FX_IMPACT_RUNS_FX; } - else if ( !stricmp( flag[i], "deathFx" )) + else if ( !Q_stricmp( flag[i], "deathFx" )) { mFlags |= FX_DEATH_RUNS_FX; } - else if ( !stricmp( flag[i], "useAlpha" )) + else if ( !Q_stricmp( flag[i], "useAlpha" )) { mFlags |= FX_USE_ALPHA; } - else if ( !stricmp( flag[i], "emitFx" )) + else if ( !Q_stricmp( flag[i], "emitFx" )) { mFlags |= FX_EMIT_FX; } - else if ( !stricmp( flag[i], "depthHack" )) + else if ( !Q_stricmp( flag[i], "depthHack" )) { mFlags |= FX_DEPTH_HACK; } - else if ( !stricmp( flag[i], "setShaderTime" )) + else if ( !Q_stricmp( flag[i], "setShaderTime" )) { mFlags |= FX_SET_SHADER_TIME; } @@ -773,59 +773,59 @@ bool CPrimitiveTemplate::ParseSpawnFlags( const char *val ) return true; } - if ( !stricmp( flag[i], "org2fromTrace" )) + if ( !Q_stricmp( flag[i], "org2fromTrace" )) { mSpawnFlags |= FX_ORG2_FROM_TRACE; } - else if ( !stricmp( flag[i], "traceImpactFx" )) + else if ( !Q_stricmp( flag[i], "traceImpactFx" )) { mSpawnFlags |= FX_TRACE_IMPACT_FX; } - else if ( !stricmp( flag[i], "org2isOffset" )) + else if ( !Q_stricmp( flag[i], "org2isOffset" )) { mSpawnFlags |= FX_ORG2_IS_OFFSET; } - else if ( !stricmp( flag[i], "cheapOrgCalc" )) + else if ( !Q_stricmp( flag[i], "cheapOrgCalc" )) { mSpawnFlags |= FX_CHEAP_ORG_CALC; } - else if ( !stricmp( flag[i], "cheapOrg2Calc" )) + else if ( !Q_stricmp( flag[i], "cheapOrg2Calc" )) { mSpawnFlags |= FX_CHEAP_ORG2_CALC; } - else if ( !stricmp( flag[i], "absoluteVel" )) + else if ( !Q_stricmp( flag[i], "absoluteVel" )) { mSpawnFlags |= FX_VEL_IS_ABSOLUTE; } - else if ( !stricmp( flag[i], "absoluteAccel" )) + else if ( !Q_stricmp( flag[i], "absoluteAccel" )) { mSpawnFlags |= FX_ACCEL_IS_ABSOLUTE; } - else if ( !stricmp( flag[i], "orgOnSphere" )) // sphere/ellipsoid + else if ( !Q_stricmp( flag[i], "orgOnSphere" )) // sphere/ellipsoid { mSpawnFlags |= FX_ORG_ON_SPHERE; } - else if ( !stricmp( flag[i], "orgOnCylinder" )) // cylinder/disk + else if ( !Q_stricmp( flag[i], "orgOnCylinder" )) // cylinder/disk { mSpawnFlags |= FX_ORG_ON_CYLINDER; } - else if ( !stricmp( flag[i], "axisFromSphere" )) + else if ( !Q_stricmp( flag[i], "axisFromSphere" )) { mSpawnFlags |= FX_AXIS_FROM_SPHERE; } - else if ( !stricmp( flag[i], "randrotaroundfwd" )) + else if ( !Q_stricmp( flag[i], "randrotaroundfwd" )) { mSpawnFlags |= FX_RAND_ROT_AROUND_FWD; } - else if ( !stricmp( flag[i], "evenDistribution" )) + else if ( !Q_stricmp( flag[i], "evenDistribution" )) { mSpawnFlags |= FX_EVEN_DISTRIBUTION; } - else if ( !stricmp( flag[i], "rgbComponentInterpolation" )) + else if ( !Q_stricmp( flag[i], "rgbComponentInterpolation" )) { mSpawnFlags |= FX_RGB_COMPONENT_INTERP; } - else if ( !stricmp( flag[i], "lessAttenuation" )) + else if ( !Q_stricmp( flag[i], "lessAttenuation" )) { mSpawnFlags |= FX_SND_LESS_ATTENUATION; } @@ -1928,19 +1928,19 @@ bool CPrimitiveTemplate::ParseRGB( CGPGroup *grp ) val = pairs->GetTopValue(); // Huge stricmp lists suxor - if ( !stricmp( key, "start" )) + if ( !Q_stricmp( key, "start" )) { ParseRGBStart( val ); } - else if ( !stricmp( key, "end" )) + else if ( !Q_stricmp( key, "end" )) { ParseRGBEnd( val ); } - else if ( !stricmp( key, "parm" ) || !stricmp( key, "parms" )) + else if ( !Q_stricmp( key, "parm" ) || !Q_stricmp( key, "parms" )) { ParseRGBParm( val ); } - else if ( !stricmp( key, "flags" ) || !stricmp( key, "flag" )) + else if ( !Q_stricmp( key, "flags" ) || !Q_stricmp( key, "flag" )) { ParseRGBFlags( val ); } @@ -1982,19 +1982,19 @@ bool CPrimitiveTemplate::ParseAlpha( CGPGroup *grp ) val = pairs->GetTopValue(); // Huge stricmp lists suxor - if ( !stricmp( key, "start" )) + if ( !Q_stricmp( key, "start" )) { ParseAlphaStart( val ); } - else if ( !stricmp( key, "end" )) + else if ( !Q_stricmp( key, "end" )) { ParseAlphaEnd( val ); } - else if ( !stricmp( key, "parm" ) || !stricmp( key, "parms" )) + else if ( !Q_stricmp( key, "parm" ) || !Q_stricmp( key, "parms" )) { ParseAlphaParm( val ); } - else if ( !stricmp( key, "flags" ) || !stricmp( key, "flag" )) + else if ( !Q_stricmp( key, "flags" ) || !Q_stricmp( key, "flag" )) { ParseAlphaFlags( val ); } @@ -2036,19 +2036,19 @@ bool CPrimitiveTemplate::ParseSize( CGPGroup *grp ) val = pairs->GetTopValue(); // Huge stricmp lists suxor - if ( !stricmp( key, "start" )) + if ( !Q_stricmp( key, "start" )) { ParseSizeStart( val ); } - else if ( !stricmp( key, "end" )) + else if ( !Q_stricmp( key, "end" )) { ParseSizeEnd( val ); } - else if ( !stricmp( key, "parm" ) || !stricmp( key, "parms" )) + else if ( !Q_stricmp( key, "parm" ) || !Q_stricmp( key, "parms" )) { ParseSizeParm( val ); } - else if ( !stricmp( key, "flags" ) || !stricmp( key, "flag" )) + else if ( !Q_stricmp( key, "flags" ) || !Q_stricmp( key, "flag" )) { ParseSizeFlags( val ); } @@ -2090,19 +2090,19 @@ bool CPrimitiveTemplate::ParseSize2( CGPGroup *grp ) val = pairs->GetTopValue(); // Huge stricmp lists suxor - if ( !stricmp( key, "start" )) + if ( !Q_stricmp( key, "start" )) { ParseSize2Start( val ); } - else if ( !stricmp( key, "end" )) + else if ( !Q_stricmp( key, "end" )) { ParseSize2End( val ); } - else if ( !stricmp( key, "parm" ) || !stricmp( key, "parms" )) + else if ( !Q_stricmp( key, "parm" ) || !Q_stricmp( key, "parms" )) { ParseSize2Parm( val ); } - else if ( !stricmp( key, "flags" ) || !stricmp( key, "flag" )) + else if ( !Q_stricmp( key, "flags" ) || !Q_stricmp( key, "flag" )) { ParseSize2Flags( val ); } @@ -2144,19 +2144,19 @@ bool CPrimitiveTemplate::ParseLength( CGPGroup *grp ) val = pairs->GetTopValue(); // Huge stricmp lists suxor - if ( !stricmp( key, "start" )) + if ( !Q_stricmp( key, "start" )) { ParseLengthStart( val ); } - else if ( !stricmp( key, "end" )) + else if ( !Q_stricmp( key, "end" )) { ParseLengthEnd( val ); } - else if ( !stricmp( key, "parm" ) || !stricmp( key, "parms" )) + else if ( !Q_stricmp( key, "parm" ) || !Q_stricmp( key, "parms" )) { ParseLengthParm( val ); } - else if ( !stricmp( key, "flags" ) || !stricmp( key, "flag" )) + else if ( !Q_stricmp( key, "flags" ) || !Q_stricmp( key, "flag" )) { ParseLengthFlags( val ); } @@ -2192,114 +2192,114 @@ bool CPrimitiveTemplate::ParsePrimitive( CGPGroup *grp ) val = pairs->GetTopValue(); // Huge stricmp lists suxor - if ( !stricmp( key, "count" )) + if ( !Q_stricmp( key, "count" )) { ParseCount( val ); } - else if ( !stricmp( key, "shaders" ) || !stricmp( key, "shader" )) + else if ( !Q_stricmp( key, "shaders" ) || !Q_stricmp( key, "shader" )) { ParseShaders( pairs ); } - else if ( !stricmp( key, "models" ) || !stricmp( key, "model" )) + else if ( !Q_stricmp( key, "models" ) || !Q_stricmp( key, "model" )) { ParseModels( pairs ); } - else if ( !stricmp( key, "sounds" ) || !stricmp( key, "sound" )) + else if ( !Q_stricmp( key, "sounds" ) || !Q_stricmp( key, "sound" )) { ParseSounds( pairs ); } #ifdef _IMMERSION - else if ( !stricmp( key, "forces" ) || !stricmp( key, "force" )) + else if ( !Q_stricmp( key, "forces" ) || !Q_stricmp( key, "force" )) { ParseForces( pairs ); } #endif // _IMMERSION - else if ( !stricmp( key, "impactfx" )) + else if ( !Q_stricmp( key, "impactfx" )) { ParseImpactFxStrings( pairs ); } - else if ( !stricmp( key, "deathfx" )) + else if ( !Q_stricmp( key, "deathfx" )) { ParseDeathFxStrings( pairs ); } - else if ( !stricmp( key, "emitfx" )) + else if ( !Q_stricmp( key, "emitfx" )) { ParseEmitterFxStrings( pairs ); } - else if ( !stricmp( key, "playfx" )) + else if ( !Q_stricmp( key, "playfx" )) { ParsePlayFxStrings( pairs ); } - else if ( !stricmp( key, "life" )) + else if ( !Q_stricmp( key, "life" )) { ParseLife( val ); } - else if ( !stricmp( key, "cullrange" )) + else if ( !Q_stricmp( key, "cullrange" )) { mCullRange = atoi( val ); mCullRange *= mCullRange; // Square } - else if ( !stricmp( key, "delay" )) + else if ( !Q_stricmp( key, "delay" )) { ParseDelay( val ); } - else if ( !stricmp( key, "bounce" ) || !stricmp( key, "intensity" )) // me==bad for reusing this...but it shouldn't hurt anything) + else if ( !Q_stricmp( key, "bounce" ) || !Q_stricmp( key, "intensity" )) // me==bad for reusing this...but it shouldn't hurt anything) { ParseElasticity( val ); } - else if ( !stricmp( key, "min" )) + else if ( !Q_stricmp( key, "min" )) { ParseMin( val ); } - else if ( !stricmp( key, "max" )) + else if ( !Q_stricmp( key, "max" )) { ParseMax( val ); } - else if ( !stricmp( key, "angle" ) || !stricmp( key, "angles" )) + else if ( !Q_stricmp( key, "angle" ) || !Q_stricmp( key, "angles" )) { ParseAngle( val ); } - else if ( !stricmp( key, "angleDelta" )) + else if ( !Q_stricmp( key, "angleDelta" )) { ParseAngleDelta( val ); } - else if ( !stricmp( key, "velocity" ) || !stricmp( key, "vel" )) + else if ( !Q_stricmp( key, "velocity" ) || !Q_stricmp( key, "vel" )) { ParseVelocity( val ); } - else if ( !stricmp( key, "acceleration" ) || !stricmp( key, "accel" )) + else if ( !Q_stricmp( key, "acceleration" ) || !Q_stricmp( key, "accel" )) { ParseAcceleration( val ); } - else if ( !stricmp( key, "gravity" )) + else if ( !Q_stricmp( key, "gravity" )) { ParseGravity( val ); } - else if ( !stricmp( key, "density" )) + else if ( !Q_stricmp( key, "density" )) { ParseDensity( val ); } - else if ( !stricmp( key, "variance" )) + else if ( !Q_stricmp( key, "variance" )) { ParseVariance( val ); } - else if ( !stricmp( key, "origin" )) + else if ( !Q_stricmp( key, "origin" )) { ParseOrigin1( val ); } - else if ( !stricmp( key, "origin2" )) + else if ( !Q_stricmp( key, "origin2" )) { ParseOrigin2( val ); } - else if ( !stricmp( key, "radius" )) // part of ellipse/cylinder calcs. + else if ( !Q_stricmp( key, "radius" )) // part of ellipse/cylinder calcs. { ParseRadius( val ); } - else if ( !stricmp( key, "height" )) // part of ellipse/cylinder calcs. + else if ( !Q_stricmp( key, "height" )) // part of ellipse/cylinder calcs. { ParseHeight( val ); } - else if ( !stricmp( key, "rotation" )) + else if ( !Q_stricmp( key, "rotation" )) { ParseRotation( val ); } @@ -2307,15 +2307,15 @@ bool CPrimitiveTemplate::ParsePrimitive( CGPGroup *grp ) { ParseRotationDelta( val ); } - else if ( !stricmp( key, "flags" ) || !stricmp( key, "flag" )) + else if ( !Q_stricmp( key, "flags" ) || !Q_stricmp( key, "flag" )) { // these need to get passed on to the primitive ParseFlags( val ); } - else if ( !stricmp( key, "spawnFlags" ) || !stricmp( key, "spawnFlag" )) + else if ( !Q_stricmp( key, "spawnFlags" ) || !Q_stricmp( key, "spawnFlag" )) { // these are used to spawn things in cool ways, but don't ever get passed on to prims. ParseSpawnFlags( val ); } - else if ( !stricmp( key, "name" )) + else if ( !Q_stricmp( key, "name" )) { if ( val ) { @@ -2338,23 +2338,23 @@ bool CPrimitiveTemplate::ParsePrimitive( CGPGroup *grp ) { key = subGrp->GetName(); - if ( !stricmp( key, "rgb" )) + if ( !Q_stricmp( key, "rgb" )) { ParseRGB( subGrp ); } - else if ( !stricmp( key, "alpha" )) + else if ( !Q_stricmp( key, "alpha" )) { ParseAlpha( subGrp ); } - else if ( !stricmp( key, "size" ) || !stricmp( key, "width" )) + else if ( !Q_stricmp( key, "size" ) || !Q_stricmp( key, "width" )) { ParseSize( subGrp ); } - else if ( !stricmp( key, "size2" ) || !stricmp( key, "width2" )) + else if ( !Q_stricmp( key, "size2" ) || !Q_stricmp( key, "width2" )) { ParseSize2( subGrp ); } - else if ( !stricmp( key, "length" ) || !stricmp( key, "height" )) + else if ( !Q_stricmp( key, "length" ) || !Q_stricmp( key, "height" )) { ParseLength( subGrp ); } diff --git a/code/cgame/cg_credits.cpp b/code/cgame/cg_credits.cpp index f3b5dff..7894b12 100644 --- a/code/cgame/cg_credits.cpp +++ b/code/cgame/cg_credits.cpp @@ -112,7 +112,7 @@ static LPCSTR Capitalize(LPCSTR psTest) // if (!cgi_Language_IsAsian()) // we don't have asian credits, so this is ok to do now { - strupr(sTemp); // capitalise titles (if not asian!!!!) + Q_strupr(sTemp); // capitalise titles (if not asian!!!!) } return sTemp; @@ -132,7 +132,7 @@ static LPCSTR UpperCaseFirstLettersOnly(LPCSTR psTest) // if (!cgi_Language_IsAsian()) // we don't have asian credits, so this is ok to do now { - strlwr(sTemp); + Q_strlwr(sTemp); char *p = sTemp; while (*p) @@ -209,7 +209,7 @@ static int SortBySurname(const void *elem1, const void *elem2) if (isspace(*psSurName1)) psSurName1++; if (isspace(*psSurName2)) psSurName2++; - return stricmp(psSurName1, psSurName2); + return Q_stricmp(psSurName1, psSurName2); } @@ -304,11 +304,11 @@ void CG_Credits_Init( LPCSTR psStripReference, vec4_t *pv4Color) { // have we got a command word?... // - if (!strnicmp(sLine,"(#",2)) + if (!Q_strnicmp(sLine,"(#",2)) { // yep... // - if (!stricmp(sLine, "(#CARD)")) + if (!Q_stricmp(sLine, "(#CARD)")) { if (!bCardsFinished) { @@ -324,21 +324,21 @@ void CG_Credits_Init( LPCSTR psStripReference, vec4_t *pv4Color) break; } else - if (!stricmp(sLine, "(#TITLE)")) + if (!Q_stricmp(sLine, "(#TITLE)")) { eMode = eTitle; bCardsFinished = qtrue; break; } else - if (!stricmp(sLine, "(#LINE)")) + if (!Q_stricmp(sLine, "(#LINE)")) { eMode = eLine; bCardsFinished = qtrue; break; } else - if (!stricmp(sLine, "(#DOTENTRY)")) + if (!Q_stricmp(sLine, "(#DOTENTRY)")) { eMode = eDotEntry; bCardsFinished = qtrue; diff --git a/code/cgame/cg_main.cpp b/code/cgame/cg_main.cpp index d2c7b2b..f4d0f46 100644 --- a/code/cgame/cg_main.cpp +++ b/code/cgame/cg_main.cpp @@ -2095,7 +2095,7 @@ void CG_CreateMiscEntFromGent(gentity_t *ent, const vec3_t scale, float zOff) return; } const int len = strlen(ent->model); - if (len < 4 || stricmp(&ent->model[len-4],".md3")!=0) + if (len < 4 || Q_stricmp(&ent->model[len-4],".md3")!=0) { Com_Error(ERR_DROP, "misc_model_static model(%s) is not an md3.",ent->model); return; diff --git a/code/cgame/cg_players.cpp b/code/cgame/cg_players.cpp index f910a2d..8e6c4cc 100644 --- a/code/cgame/cg_players.cpp +++ b/code/cgame/cg_players.cpp @@ -277,7 +277,7 @@ static const char *GetCustomSound_VariantCapped(const char *ppsTable[], int iEnt // for (int iScanNum=0; iScanNumstring,"english") && stricmp(s_language->string,""); + qboolean bIsForeign = s_language && Q_stricmp(s_language->string,"english") && Q_stricmp(s_language->string,""); LPCSTR psAudioFile = NULL; qhandle_t hCrawl = 0; - if (!stricmp(arg,"video/jk0101_sw.roq")) + if (!Q_stricmp(arg,"video/jk0101_sw.roq")) { psAudioFile = "music/cinematic_1"; if ( Cvar_VariableIntegerValue("com_demo") ) @@ -1733,13 +1733,13 @@ static void PlayCinematic(const char *arg, const char *s, qboolean qbInGame) else if (bIsForeign) { - if (!stricmp(arg,"video/jk05.roq")) + if (!Q_stricmp(arg,"video/jk05.roq")) { psAudioFile = "sound/chars/video/cinematic_5"; bits |= CIN_silent; // knock out existing english track } else - if (!stricmp(arg,"video/jk06.roq")) + if (!Q_stricmp(arg,"video/jk06.roq")) { psAudioFile = "sound/chars/video/cinematic_6"; bits |= CIN_silent; // knock out existing english track diff --git a/code/client/cl_keys.cpp b/code/client/cl_keys.cpp index 6bfbf66..de495db 100644 --- a/code/client/cl_keys.cpp +++ b/code/client/cl_keys.cpp @@ -916,7 +916,7 @@ int Key_StringToKeynum( char *str ) { // scan for a text match for ( i = 0 ; i < MAX_KEYS ; i++ ) { - if ( keynames[i].name && !stricmp( str, keynames[i].name ) ) + if ( keynames[i].name && !Q_stricmp( str, keynames[i].name ) ) { return keynames[i].keynum; } diff --git a/code/client/snd_ambient.cpp b/code/client/snd_ambient.cpp index 726aeed..ffa33d6 100644 --- a/code/client/snd_ambient.cpp +++ b/code/client/snd_ambient.cpp @@ -205,7 +205,7 @@ static int AS_GetSetNameIDForString( const char *name ) for ( int i = 0; i < NUM_AS_SETS; i++ ) { - if ( stricmp( name, setNames[i] ) == 0 ) + if ( Q_stricmp( name, setNames[i] ) == 0 ) return i; } @@ -226,7 +226,7 @@ static int AS_GetKeywordIDForString( const char *name ) for ( int i = 0; i < NUM_AS_KEYWORDS; i++ ) { - if ( stricmp( name, keywordNames[i] ) == 0 ) + if ( Q_stricmp( name, keywordNames[i] ) == 0 ) return i; } @@ -684,7 +684,7 @@ static void AS_ParseHeader( void ) case SET_KEYWORD_TYPE: sscanf( parseBuffer+parsePos, "%s %s", &tempBuffer, &typeBuffer ); - if ( !stricmp( (const char *) typeBuffer, "ambientSet" ) ) + if ( !Q_stricmp( (const char *) typeBuffer, "ambientSet" ) ) { return; } @@ -789,7 +789,7 @@ void AS_AddPrecacheEntry( const char *name ) { return; } - if (!stricmp(name,"#clear")) + if (!Q_stricmp(name,"#clear")) { pMap->clear(); currentSet = -1; diff --git a/code/client/snd_dma.cpp b/code/client/snd_dma.cpp index 13d07d2..143bf62 100644 --- a/code/client/snd_dma.cpp +++ b/code/client/snd_dma.cpp @@ -845,7 +845,7 @@ sfx_t *S_FindName( const char *name ) { sfx = &s_knownSfx[i]; memset (sfx, 0, sizeof(*sfx)); Q_strncpyz(sfx->sSoundName, sSoundNameNoExt, sizeof(sfx->sSoundName)); - strlwr(sfx->sSoundName);//force it down low + Q_strlwr(sfx->sSoundName);//force it down low sfx->next = sfxHash[hash]; sfxHash[hash] = sfx; @@ -3747,28 +3747,28 @@ void S_SoundList_f( void ) { if ( Cmd_Argc() == 2 ) { - if (!stricmp(Cmd_Argv(1), "shouldbeMP3")) + if (!Q_stricmp(Cmd_Argv(1), "shouldbeMP3")) { bShouldBeMP3 = qtrue; } else - if (!stricmp(Cmd_Argv(1), "wavonly")) + if (!Q_stricmp(Cmd_Argv(1), "wavonly")) { bWavOnly = qtrue; } else { - if (!stricmp(Cmd_Argv(1), "1")) + if (!Q_stricmp(Cmd_Argv(1), "1")) { iVariantCap = 1; } else - if (!stricmp(Cmd_Argv(1), "2")) + if (!Q_stricmp(Cmd_Argv(1), "2")) { iVariantCap = 2; } else - if (!stricmp(Cmd_Argv(1), "3")) + if (!Q_stricmp(Cmd_Argv(1), "3")) { iVariantCap = 3; } @@ -3819,7 +3819,7 @@ void S_SoundList_f( void ) { sfx_t *sfx2; for (sfx2 = s_knownSfx, i2=0 ; i2sSoundName)) + if (!Q_stricmp(sFindName,sfx2->sSoundName)) { bDumpThisOne = qfalse; // found a %1-variant of this, so use variant capping and ignore this sfx_t break; @@ -4949,7 +4949,7 @@ static void S_UpdateBackgroundTrack( void ) // standard / non-dynamic one-track music... // LPCSTR psCommand = S_Music_GetRequestedState(); // special check just for "silence" case... - qboolean bShouldBeSilent = (psCommand && !stricmp(psCommand,"silence")); + qboolean bShouldBeSilent = (psCommand && !Q_stricmp(psCommand,"silence")); float fDesiredVolume = bShouldBeSilent ? 0.0f : s_musicVolume->value; // // internal to this code is a volume-smoother... diff --git a/code/client/snd_dma_console.cpp b/code/client/snd_dma_console.cpp index 5c2fc12..f14243d 100644 --- a/code/client/snd_dma_console.cpp +++ b/code/client/snd_dma_console.cpp @@ -717,7 +717,7 @@ int Lip_GetFileCode(const char* name) char* osname = FS_BuildOSPath(name); // Generate hash for file name - strlwr(osname); + Q_strlwr(osname); unsigned int code = crc32(0, (const unsigned char *)osname, strlen(osname)); return code; diff --git a/code/client/snd_mem.cpp b/code/client/snd_mem.cpp index 430fce2..108a494 100644 --- a/code/client/snd_mem.cpp +++ b/code/client/snd_mem.cpp @@ -617,15 +617,15 @@ static qboolean S_LoadSound_FileLoadAndNameAdjuster(char *psFilename, byte **pDa // account for foreign voices... // extern cvar_t* s_language; - if (s_language && stricmp("DEUTSCH",s_language->string)==0) + if (s_language && Q_stricmp("DEUTSCH",s_language->string)==0) { strncpy(psVoice,"chr_d",5); // same number of letters as "chars" } - else if (s_language && stricmp("FRANCAIS",s_language->string)==0) + else if (s_language && Q_stricmp("FRANCAIS",s_language->string)==0) { strncpy(psVoice,"chr_f",5); // same number of letters as "chars" } - else if (s_language && stricmp("ESPANOL",s_language->string)==0) + else if (s_language && Q_stricmp("ESPANOL",s_language->string)==0) { strncpy(psVoice,"chr_e",5); // same number of letters as "chars" } @@ -701,7 +701,7 @@ static qboolean S_LoadSound_DirIsAllowedToKeepMP3s(const char *psFilename) int i; for (i=0; i< (sizeof(psAllowedDirs) / sizeof(psAllowedDirs[0])); i++) { - if (strnicmp(psFilename, psAllowedDirs[i], strlen(psAllowedDirs[i]))==0) + if (Q_strnicmp(psFilename, psAllowedDirs[i], strlen(psAllowedDirs[i]))==0) return qtrue; // found a dir that's allowed to keep MP3s } @@ -743,7 +743,7 @@ static qboolean S_LoadSound_Actual( sfx_t *sfx ) // make up a local filename to try wav/mp3 substitutes... // Q_strncpyz(sLoadName, sfx->sSoundName, sizeof(sLoadName)); - strlwr( sLoadName ); + Q_strlwr( sLoadName ); // // Ensure name has an extension (which it must have, but you never know), and get ptr to it... // @@ -763,7 +763,7 @@ static qboolean S_LoadSound_Actual( sfx_t *sfx ) SND_TouchSFX(sfx); //========= - if (strnicmp(psExt,".mp3",4)==0) + if (Q_strnicmp(psExt,".mp3",4)==0) { // load MP3 file instead... // diff --git a/code/client/snd_music.cpp b/code/client/snd_music.cpp index 02be672..bbdbc7f 100644 --- a/code/client/snd_music.cpp +++ b/code/client/snd_music.cpp @@ -658,7 +658,7 @@ static qboolean Music_ParseLeveldata(const char *psLevelName) // kludge up an enum, only interested in boss or not at the moment, so... // - MusicState_e eMusicState = !stricmp(psMusicStateType,"boss") ? eBGRNDTRACK_BOSS : !stricmp(psMusicStateType,"death") ? eBGRNDTRACK_DEATH : eBGRNDTRACK_EXPLORE; + MusicState_e eMusicState = !Q_stricmp(psMusicStateType,"boss") ? eBGRNDTRACK_BOSS : !Q_stricmp(psMusicStateType,"death") ? eBGRNDTRACK_DEATH : eBGRNDTRACK_EXPLORE; if (!MusicFile.MusicExitTimes.empty()) { @@ -798,7 +798,7 @@ qboolean Music_DynamicDataAvailable(const char *psDynamicMusicLabel) { char sLevelName[MAX_QPATH]; Q_strncpyz(sLevelName,COM_SkipPath( const_cast( (psDynamicMusicLabel&&psDynamicMusicLabel[0])?psDynamicMusicLabel:gsLevelNameFromServer.c_str() ) ),sizeof(sLevelName)); - strlwr(sLevelName); + Q_strlwr(sLevelName); if (strlen(sLevelName)) // avoid error messages when there's no music waiting to be played and we try and restart it... { diff --git a/code/ff/ff_ChannelSet.cpp b/code/ff/ff_ChannelSet.cpp index 91ecea6..8d75b9e 100644 --- a/code/ff/ff_ChannelSet.cpp +++ b/code/ff/ff_ChannelSet.cpp @@ -109,7 +109,7 @@ void FFChannelSet::Display( TNameTable &Unprocessed, TNameTable &Processed ) ; itName != Unprocessed.end() ; ){ - if ( stricmp( "channels", (*itName).c_str() ) == 0 ) + if ( Q_stricmp( "channels", (*itName).c_str() ) == 0 ) { Com_Printf( "[available channels]\n" ); @@ -132,7 +132,7 @@ void FFChannelSet::Display( TNameTable &Unprocessed, TNameTable &Processed ) Processed.push_back( *itName ); itName = Unprocessed.erase( itName ); } - else if ( stricmp( "devices", (*itName).c_str() ) == 0 ) + else if ( Q_stricmp( "devices", (*itName).c_str() ) == 0 ) { Com_Printf( "[initialized devices]\n" ); @@ -159,4 +159,4 @@ void FFChannelSet::Display( TNameTable &Unprocessed, TNameTable &Processed ) #endif // FF_CONSOLECOMMAND -#endif // _IMMERSION \ No newline at end of file +#endif // _IMMERSION diff --git a/code/ff/ff_ConfigParser.cpp b/code/ff/ff_ConfigParser.cpp index e8b1cd1..f25d01c 100644 --- a/code/ff/ff_ConfigParser.cpp +++ b/code/ff/ff_ConfigParser.cpp @@ -64,12 +64,12 @@ qboolean FFConfigParser::Parse( void *file ) && result // fail if any problem ; token = COM_ParseExt( &pos, qtrue ) ){ - if ( !stricmp( token, "ffdefaults" ) ) + if ( !Q_stricmp( token, "ffdefaults" ) ) { result &= ParseDefaults( &pos ); } else - if ( !stricmp( token, "ffsets" ) ) + if ( !Q_stricmp( token, "ffsets" ) ) { result &= ParseSets( &pos ); } @@ -323,12 +323,12 @@ qboolean FFConfigParser::ParseSet( const char **pos, TData &data ) && result // fail if any problem ; token = COM_ParseExt( pos, qtrue ) ){ - if ( !stricmp( token, "includes" ) ) + if ( !Q_stricmp( token, "includes" ) ) { result &= ParseSetIncludes( pos, data.include ); } else - if ( !stricmp( token, "devices" ) ) + if ( !Q_stricmp( token, "devices" ) ) { result &= ParseSetDevices( pos, data.device ); } @@ -480,4 +480,4 @@ const char * FFConfigParser::GetFFSet( CImmDevice *Device ) return ffset; } -#endif // _IMMERSION \ No newline at end of file +#endif // _IMMERSION diff --git a/code/ff/ff_ffset.cpp b/code/ff/ff_ffset.cpp index 167a1b7..a0e9c3b 100644 --- a/code/ff/ff_ffset.cpp +++ b/code/ff/ff_ffset.cpp @@ -102,7 +102,7 @@ MultiEffect* FFSet::Register( const char *path, qboolean create ) temp[0] = 0; afterincludepath[separator] = 0; - if ( stricmp( afterincludepath + separator - 4, ".ifr" ) ) + if ( Q_stricmp( afterincludepath + separator - 4, ".ifr" ) ) { memcpy( temp, afterincludepath + separator + 1, 4 ); sprintf( afterincludepath + separator, ".ifr" ); @@ -263,7 +263,7 @@ void FFSet::Display( TNameTable &Unprocessed, TNameTable &Processed ) ; itName != Unprocessed.end() ; ){ - if ( stricmp( "order", (*itName).c_str() ) == 0 ) + if ( Q_stricmp( "order", (*itName).c_str() ) == 0 ) { if ( ff_developer->integer ) DisplaySearchOrder(); @@ -274,7 +274,7 @@ void FFSet::Display( TNameTable &Unprocessed, TNameTable &Processed ) itName = Unprocessed.erase( itName ); } else - if ( stricmp( "files", (*itName).c_str() ) == 0 ) + if ( Q_stricmp( "files", (*itName).c_str() ) == 0 ) { if ( ff_developer->integer ) DisplayLoadedFiles(); @@ -353,4 +353,4 @@ void FFSet::DisplayLoadedFiles( void ) #endif // FF_CONSOLECOMMAND -#endif // _IMMERSION \ No newline at end of file +#endif // _IMMERSION diff --git a/code/ff/ff_system.cpp b/code/ff/ff_system.cpp index 09b2a50..4f7b6b0 100644 --- a/code/ff/ff_system.cpp +++ b/code/ff/ff_system.cpp @@ -77,7 +77,7 @@ void FFSystem::Display( TNameTable &Unprocessed, TNameTable &Processed ) ; itName != Unprocessed.end() ; ){ - if ( stricmp( "effects", (*itName).c_str() ) == 0 ) + if ( Q_stricmp( "effects", (*itName).c_str() ) == 0 ) { if ( ff_developer->integer ) { diff --git a/code/game/NPC_spawn.cpp b/code/game/NPC_spawn.cpp index d822421..3a516af 100644 --- a/code/game/NPC_spawn.cpp +++ b/code/game/NPC_spawn.cpp @@ -1517,7 +1517,7 @@ gentity_t *NPC_Spawn_Do( gentity_t *ent, qboolean fullSpawnNow ) } else { - newent->NPC_type = strlwr( G_NewString( ent->NPC_type ) ); //get my own copy so i can free it when i die + newent->NPC_type = Q_strlwr( G_NewString( ent->NPC_type ) ); //get my own copy so i can free it when i die } newent->NPC = (gNPC_t*) gi.Malloc(sizeof(gNPC_t), TAG_G_ALLOC, qtrue); @@ -4114,7 +4114,7 @@ static void NPC_Spawn_f(void) gi.linkentity(NPCspawner); - NPCspawner->NPC_type = strlwr( G_NewString( npc_type ) ); + NPCspawner->NPC_type = Q_strlwr( G_NewString( npc_type ) ); NPCspawner->NPC_targetname = G_NewString(gi.argv( 3 )); NPCspawner->count = 1; diff --git a/code/game/NPC_stats.cpp b/code/game/NPC_stats.cpp index 78d0b0a..941d93c 100644 --- a/code/game/NPC_stats.cpp +++ b/code/game/NPC_stats.cpp @@ -521,27 +521,27 @@ static void ParseAnimationEvtBlock(int glaIndex, unsigned short modelIndex, cons { break; } - if ( stricmp( token, "CHAN_VOICE_ATTEN" ) == 0 ) + if ( Q_stricmp( token, "CHAN_VOICE_ATTEN" ) == 0 ) { animEvents[curAnimEvent].eventData[AED_SOUNDCHANNEL] = CHAN_VOICE_ATTEN; } - else if ( stricmp( token, "CHAN_VOICE_GLOBAL" ) == 0 ) + else if ( Q_stricmp( token, "CHAN_VOICE_GLOBAL" ) == 0 ) { animEvents[curAnimEvent].eventData[AED_SOUNDCHANNEL] = CHAN_VOICE_GLOBAL; } - else if ( stricmp( token, "CHAN_ANNOUNCER" ) == 0 ) + else if ( Q_stricmp( token, "CHAN_ANNOUNCER" ) == 0 ) { animEvents[curAnimEvent].eventData[AED_SOUNDCHANNEL] = CHAN_ANNOUNCER; } - else if ( stricmp( token, "CHAN_BODY" ) == 0 ) + else if ( Q_stricmp( token, "CHAN_BODY" ) == 0 ) { animEvents[curAnimEvent].eventData[AED_SOUNDCHANNEL] = CHAN_BODY; } - else if ( stricmp( token, "CHAN_WEAPON" ) == 0 ) + else if ( Q_stricmp( token, "CHAN_WEAPON" ) == 0 ) { animEvents[curAnimEvent].eventData[AED_SOUNDCHANNEL] = CHAN_WEAPON; } - else if ( stricmp( token, "CHAN_VOICE" ) == 0 ) + else if ( Q_stricmp( token, "CHAN_VOICE" ) == 0 ) { animEvents[curAnimEvent].eventData[AED_SOUNDCHANNEL] = CHAN_VOICE; } @@ -795,7 +795,7 @@ void G_ParseAnimationEvtFile(int glaIndex, const char* eventsDirectory, int file assert(fileIndex>=0 && fileIndex5 && !stricmp(&psAnimFileInternalName[strlen(psAnimFileInternalName)-5],"_skip")); + bool bIsFrameSkipped = (psAnimFileInternalName && strlen(psAnimFileInternalName)>5 && !Q_stricmp(&psAnimFileInternalName[strlen(psAnimFileInternalName)-5],"_skip")); // Open The File, Make Sure It Is Safe //------------------------------------- @@ -1101,7 +1101,7 @@ int G_ParseAnimFileSet(const char *skeletonName, const char *modelName=0) // Get The Cinematic GLA Name //---------------------------- - if (stricmp(skeletonName, "_humanoid")==0) + if (Q_stricmp(skeletonName, "_humanoid")==0) { const char* mapName = strrchr( level.mapname, '/' ); if (mapName) @@ -1172,9 +1172,9 @@ int G_ParseAnimFileSet(const char *skeletonName, const char *modelName=0) // Only Do The Event File If The Model Is Not The Same As The Skeleton //--------------------------------------------------------------------- - if (stricmp(skeletonName, modelName)!=0) + if (Q_stricmp(skeletonName, modelName)!=0) { - const int iGLAIndexToCheckForSkip = (stricmp(skeletonName, "_humanoid")?-1:gi.G2API_PrecacheGhoul2Model("models/players/_humanoid/_humanoid.gla")); // ;-) + const int iGLAIndexToCheckForSkip = (Q_stricmp(skeletonName, "_humanoid")?-1:gi.G2API_PrecacheGhoul2Model("models/players/_humanoid/_humanoid.gla")); // ;-) G_ParseAnimationEvtFile(0, modelName, fileIndex, iGLAIndexToCheckForSkip, true); } diff --git a/code/game/Q3_Interface.cpp b/code/game/Q3_Interface.cpp index d560257..a22edef 100644 --- a/code/game/Q3_Interface.cpp +++ b/code/game/Q3_Interface.cpp @@ -719,7 +719,7 @@ static char *Q3_GetAnimBoth( gentity_t *ent ) return NULL; } - if ( stricmp( lowerName, upperName ) ) + if ( Q_stricmp( lowerName, upperName ) ) { #ifdef _DEBUG // sigh, cut down on tester reports that aren't important Quake3Game()->DebugPrint( IGameInterface::WL_WARNING, "Q3_GetAnimBoth: legs and torso animations did not match : returning legs\n" ); @@ -943,7 +943,7 @@ Returns the sequencer of the entity by the given name strncpy( (char *) temp, name, sizeof(temp) ); temp[sizeof(temp)-1] = 0; - ei = ICARUS_EntList.find( strupr( (char *) temp ) ); + ei = ICARUS_EntList.find( Q_strupr( (char *) temp ) ); if ( ei == ICARUS_EntList.end() ) return NULL; @@ -7462,7 +7462,7 @@ void CQuake3GameInterface::FreeEntity( gentity_t *pEntity ) strncpy( (char *) temp, pEntity->script_targetname, 1023 ); temp[ 1023 ] = 0; - entitylist_t::iterator it = m_EntityList.find( strupr(temp) ); + entitylist_t::iterator it = m_EntityList.find( Q_strupr(temp) ); if (it != m_EntityList.end()) { @@ -7511,7 +7511,7 @@ void CQuake3GameInterface::AssociateEntity( gentity_t *pEntity ) strncpy( (char *) temp, pEntity->script_targetname, 1023 ); temp[ 1023 ] = 0; - m_EntityList[ strupr( (char *) temp ) ] = pEntity->s.number; + m_EntityList[ Q_strupr( (char *) temp ) ] = pEntity->s.number; } // Make a valid script name. @@ -7839,7 +7839,7 @@ int CQuake3GameInterface::PlaySound( int taskID, int entID, const char *name, c qboolean type_voice = qfalse; Q_strncpyz( finalName, name, MAX_QPATH, 0 ); - strlwr(finalName); + Q_strlwr(finalName); G_AddSexToPlayerString( finalName, qtrue ); COM_StripExtension( (const char *)finalName, finalName ); @@ -7847,24 +7847,24 @@ int CQuake3GameInterface::PlaySound( int taskID, int entID, const char *name, c int soundHandle = G_SoundIndex( (char *) finalName ); bool bBroadcast = false; - if ( ( stricmp( channel, "CHAN_ANNOUNCER" ) == 0 ) || (ent->classname && Q_stricmp("target_scriptrunner", ent->classname ) == 0) ) { + if ( ( Q_stricmp( channel, "CHAN_ANNOUNCER" ) == 0 ) || (ent->classname && Q_stricmp("target_scriptrunner", ent->classname ) == 0) ) { bBroadcast = true; } // moved here from further down so I can easily check channel-type without code dup... // - if ( stricmp( channel, "CHAN_VOICE" ) == 0 ) + if ( Q_stricmp( channel, "CHAN_VOICE" ) == 0 ) { voice_chan = CHAN_VOICE; type_voice = qtrue; } - else if ( stricmp( channel, "CHAN_VOICE_ATTEN" ) == 0 ) + else if ( Q_stricmp( channel, "CHAN_VOICE_ATTEN" ) == 0 ) { voice_chan = CHAN_VOICE_ATTEN; type_voice = qtrue; } - else if ( stricmp( channel, "CHAN_VOICE_GLOBAL" ) == 0 ) // this should broadcast to everyone, put only casue animation on G_SoundOnEnt... + else if ( Q_stricmp( channel, "CHAN_VOICE_GLOBAL" ) == 0 ) // this should broadcast to everyone, put only casue animation on G_SoundOnEnt... { voice_chan = CHAN_VOICE_GLOBAL; type_voice = qtrue; @@ -8456,58 +8456,58 @@ void CQuake3GameInterface::Set( int taskID, int entID, const char *type_name, co break; case SET_IGNOREPAIN: - if(!stricmp("true", ((char *)data))) + if(!Q_stricmp("true", ((char *)data))) Q3_SetIgnorePain( entID, qtrue); - else if(!stricmp("false", ((char *)data))) + else if(!Q_stricmp("false", ((char *)data))) Q3_SetIgnorePain( entID, qfalse); break; case SET_IGNOREENEMIES: - if(!stricmp("true", ((char *)data))) + if(!Q_stricmp("true", ((char *)data))) Q3_SetIgnoreEnemies( entID, qtrue); - else if(!stricmp("false", ((char *)data))) + else if(!Q_stricmp("false", ((char *)data))) Q3_SetIgnoreEnemies( entID, qfalse); break; case SET_IGNOREALERTS: - if(!stricmp("true", ((char *)data))) + if(!Q_stricmp("true", ((char *)data))) Q3_SetIgnoreAlerts( entID, qtrue); - else if(!stricmp("false", ((char *)data))) + else if(!Q_stricmp("false", ((char *)data))) Q3_SetIgnoreAlerts( entID, qfalse); break; case SET_DONTSHOOT: - if(!stricmp("true", ((char *)data))) + if(!Q_stricmp("true", ((char *)data))) Q3_SetDontShoot( entID, qtrue); - else if(!stricmp("false", ((char *)data))) + else if(!Q_stricmp("false", ((char *)data))) Q3_SetDontShoot( entID, qfalse); break; case SET_DONTFIRE: - if(!stricmp("true", ((char *)data))) + if(!Q_stricmp("true", ((char *)data))) Q3_SetDontFire( entID, qtrue); - else if(!stricmp("false", ((char *)data))) + else if(!Q_stricmp("false", ((char *)data))) Q3_SetDontFire( entID, qfalse); break; case SET_LOCKED_ENEMY: - if(!stricmp("true", ((char *)data))) + if(!Q_stricmp("true", ((char *)data))) Q3_SetLockedEnemy( entID, qtrue); - else if(!stricmp("false", ((char *)data))) + else if(!Q_stricmp("false", ((char *)data))) Q3_SetLockedEnemy( entID, qfalse); break; case SET_NOTARGET: - if(!stricmp("true", ((char *)data))) + if(!Q_stricmp("true", ((char *)data))) Q3_SetNoTarget( entID, qtrue); - else if(!stricmp("false", ((char *)data))) + else if(!Q_stricmp("false", ((char *)data))) Q3_SetNoTarget( entID, qfalse); break; case SET_LEAN: - if(!stricmp("right", ((char *)data))) + if(!Q_stricmp("right", ((char *)data))) Q3_SetLean( entID, LEAN_RIGHT); - else if(!stricmp("left", ((char *)data))) + else if(!Q_stricmp("left", ((char *)data))) Q3_SetLean( entID, LEAN_LEFT); else Q3_SetLean( entID, LEAN_NONE); @@ -8614,7 +8614,7 @@ void CQuake3GameInterface::Set( int taskID, int entID, const char *type_name, co break; case SET_NO_MINDTRICK: - if(!stricmp("true", ((char *)data))) + if(!Q_stricmp("true", ((char *)data))) Q3_SetNoMindTrick( entID, qtrue); else Q3_SetNoMindTrick( entID, qfalse); @@ -8638,133 +8638,133 @@ void CQuake3GameInterface::Set( int taskID, int entID, const char *type_name, co break; case SET_CROUCHED: - if(!stricmp("true", ((char *)data))) + if(!Q_stricmp("true", ((char *)data))) Q3_SetCrouched( entID, qtrue); else Q3_SetCrouched( entID, qfalse); break; case SET_WALKING: - if(!stricmp("true", ((char *)data))) + if(!Q_stricmp("true", ((char *)data))) Q3_SetWalking( entID, qtrue); else Q3_SetWalking( entID, qfalse); break; case SET_RUNNING: - if(!stricmp("true", ((char *)data))) + if(!Q_stricmp("true", ((char *)data))) Q3_SetRunning( entID, qtrue); else Q3_SetRunning( entID, qfalse); break; case SET_CHASE_ENEMIES: - if(!stricmp("true", ((char *)data))) + if(!Q_stricmp("true", ((char *)data))) Q3_SetChaseEnemies( entID, qtrue); else Q3_SetChaseEnemies( entID, qfalse); break; case SET_LOOK_FOR_ENEMIES: - if(!stricmp("true", ((char *)data))) + if(!Q_stricmp("true", ((char *)data))) Q3_SetLookForEnemies( entID, qtrue); else Q3_SetLookForEnemies( entID, qfalse); break; case SET_FACE_MOVE_DIR: - if(!stricmp("true", ((char *)data))) + if(!Q_stricmp("true", ((char *)data))) Q3_SetFaceMoveDir( entID, qtrue); else Q3_SetFaceMoveDir( entID, qfalse); break; case SET_ALT_FIRE: - if(!stricmp("true", ((char *)data))) + if(!Q_stricmp("true", ((char *)data))) Q3_SetAltFire( entID, qtrue); else Q3_SetAltFire( entID, qfalse); break; case SET_DONT_FLEE: - if(!stricmp("true", ((char *)data))) + if(!Q_stricmp("true", ((char *)data))) Q3_SetDontFlee( entID, qtrue); else Q3_SetDontFlee( entID, qfalse); break; case SET_FORCED_MARCH: - if(!stricmp("true", ((char *)data))) + if(!Q_stricmp("true", ((char *)data))) Q3_SetForcedMarch( entID, qtrue); else Q3_SetForcedMarch( entID, qfalse); break; case SET_NO_RESPONSE: - if(!stricmp("true", ((char *)data))) + if(!Q_stricmp("true", ((char *)data))) Q3_SetNoResponse( entID, qtrue); else Q3_SetNoResponse( entID, qfalse); break; case SET_NO_COMBAT_TALK: - if(!stricmp("true", ((char *)data))) + if(!Q_stricmp("true", ((char *)data))) Q3_SetCombatTalk( entID, qtrue); else Q3_SetCombatTalk( entID, qfalse); break; case SET_NO_ALERT_TALK: - if(!stricmp("true", ((char *)data))) + if(!Q_stricmp("true", ((char *)data))) Q3_SetAlertTalk( entID, qtrue); else Q3_SetAlertTalk( entID, qfalse); break; case SET_USE_CP_NEAREST: - if(!stricmp("true", ((char *)data))) + if(!Q_stricmp("true", ((char *)data))) Q3_SetUseCpNearest( entID, qtrue); else Q3_SetUseCpNearest( entID, qfalse); break; case SET_NO_FORCE: - if(!stricmp("true", ((char *)data))) + if(!Q_stricmp("true", ((char *)data))) Q3_SetNoForce( entID, qtrue); else Q3_SetNoForce( entID, qfalse); break; case SET_NO_ACROBATICS: - if(!stricmp("true", ((char *)data))) + if(!Q_stricmp("true", ((char *)data))) Q3_SetNoAcrobatics( entID, qtrue); else Q3_SetNoAcrobatics( entID, qfalse); break; case SET_USE_SUBTITLES: - if(!stricmp("true", ((char *)data))) + if(!Q_stricmp("true", ((char *)data))) Q3_SetUseSubtitles( entID, qtrue); else Q3_SetUseSubtitles( entID, qfalse); break; case SET_NO_FALLTODEATH: - if(!stricmp("true", ((char *)data))) + if(!Q_stricmp("true", ((char *)data))) Q3_SetNoFallToDeath( entID, qtrue); else Q3_SetNoFallToDeath( entID, qfalse); break; case SET_DISMEMBERABLE: - if(!stricmp("true", ((char *)data))) + if(!Q_stricmp("true", ((char *)data))) Q3_SetDismemberable( entID, qtrue); else Q3_SetDismemberable( entID, qfalse); break; case SET_MORELIGHT: - if(!stricmp("true", ((char *)data))) + if(!Q_stricmp("true", ((char *)data))) Q3_SetMoreLight( entID, qtrue); else Q3_SetMoreLight( entID, qfalse); @@ -8780,28 +8780,28 @@ void CQuake3GameInterface::Set( int taskID, int entID, const char *type_name, co break; case SET_UNDYING: - if(!stricmp("true", ((char *)data))) + if(!Q_stricmp("true", ((char *)data))) Q3_SetUndying( entID, qtrue); else Q3_SetUndying( entID, qfalse); break; case SET_INVINCIBLE: - if(!stricmp("true", ((char *)data))) + if(!Q_stricmp("true", ((char *)data))) Q3_SetInvincible( entID, qtrue); else Q3_SetInvincible( entID, qfalse); break; case SET_NOAVOID: - if(!stricmp("true", ((char *)data))) + if(!Q_stricmp("true", ((char *)data))) Q3_SetNoAvoid( entID, qtrue); else Q3_SetNoAvoid( entID, qfalse); break; case SET_SOLID: - if(!stricmp("true", ((char *)data))) + if(!Q_stricmp("true", ((char *)data))) { if ( !Q3_SetSolid( entID, qtrue) ) { @@ -8816,49 +8816,49 @@ void CQuake3GameInterface::Set( int taskID, int entID, const char *type_name, co break; case SET_INVISIBLE: - if( !stricmp("true", ((char *)data)) ) + if( !Q_stricmp("true", ((char *)data)) ) Q3_SetInvisible( entID, qtrue ); else Q3_SetInvisible( entID, qfalse ); break; case SET_VAMPIRE: - if( !stricmp("true", ((char *)data)) ) + if( !Q_stricmp("true", ((char *)data)) ) Q3_SetVampire( entID, qtrue ); else Q3_SetVampire( entID, qfalse ); break; case SET_FORCE_INVINCIBLE: - if( !stricmp("true", ((char *)data)) ) + if( !Q_stricmp("true", ((char *)data)) ) Q3_SetForceInvincible( entID, qtrue ); else Q3_SetForceInvincible( entID, qfalse ); break; case SET_GREET_ALLIES: - if( !stricmp("true", ((char *)data)) ) + if( !Q_stricmp("true", ((char *)data)) ) Q3_SetGreetAllies( entID, qtrue ); else Q3_SetGreetAllies( entID, qfalse ); break; case SET_PLAYER_LOCKED: - if( !stricmp("true", ((char *)data)) ) + if( !Q_stricmp("true", ((char *)data)) ) Q3_SetPlayerLocked( entID, qtrue ); else Q3_SetPlayerLocked( entID, qfalse ); break; case SET_LOCK_PLAYER_WEAPONS: - if( !stricmp("true", ((char *)data)) ) + if( !Q_stricmp("true", ((char *)data)) ) Q3_SetLockPlayerWeapons( entID, qtrue ); else Q3_SetLockPlayerWeapons( entID, qfalse ); break; case SET_NO_IMPACT_DAMAGE: - if( !stricmp("true", ((char *)data)) ) + if( !Q_stricmp("true", ((char *)data)) ) Q3_SetNoImpactDamage( entID, qtrue ); else Q3_SetNoImpactDamage( entID, qfalse ); @@ -8944,7 +8944,7 @@ void CQuake3GameInterface::Set( int taskID, int entID, const char *type_name, co break; case SET_PLAYER_USABLE: - if(!stricmp("true", ((char *)data))) + if(!Q_stricmp("true", ((char *)data))) { Q3_SetPlayerUsable(entID, qtrue); } @@ -8974,7 +8974,7 @@ void CQuake3GameInterface::Set( int taskID, int entID, const char *type_name, co break; case SET_LOOP_ANIM: - if(!stricmp("true", ((char *)data))) + if(!Q_stricmp("true", ((char *)data))) { Q3_SetLoopAnim(entID, qtrue); } @@ -8985,7 +8985,7 @@ void CQuake3GameInterface::Set( int taskID, int entID, const char *type_name, co break; case SET_INTERFACE: - if(!stricmp("true", ((char *)data))) + if(!Q_stricmp("true", ((char *)data))) { Q3_SetInterface(entID, "1"); } @@ -8997,7 +8997,7 @@ void CQuake3GameInterface::Set( int taskID, int entID, const char *type_name, co break; case SET_SHIELDS: - if(!stricmp("true", ((char *)data))) + if(!Q_stricmp("true", ((char *)data))) { Q3_SetShields(entID, qtrue); } @@ -9008,7 +9008,7 @@ void CQuake3GameInterface::Set( int taskID, int entID, const char *type_name, co break; case SET_SABERACTIVE: - if(!stricmp("true", ((char *)data))) + if(!Q_stricmp("true", ((char *)data))) { Q3_SetSaberActive( entID, qtrue ); } @@ -9058,7 +9058,7 @@ void CQuake3GameInterface::Set( int taskID, int entID, const char *type_name, co break; case SET_ADJUST_AREA_PORTALS: - if(!stricmp("true", ((char *)data))) + if(!Q_stricmp("true", ((char *)data))) { Q3_SetAdjustAreaPortals( entID, qtrue ); } @@ -9069,7 +9069,7 @@ void CQuake3GameInterface::Set( int taskID, int entID, const char *type_name, co break; case SET_DMG_BY_HEAVY_WEAP_ONLY: - if(!stricmp("true", ((char *)data))) + if(!Q_stricmp("true", ((char *)data))) { Q3_SetDmgByHeavyWeapOnly( entID, qtrue ); } @@ -9080,7 +9080,7 @@ void CQuake3GameInterface::Set( int taskID, int entID, const char *type_name, co break; case SET_SHIELDED: - if(!stricmp("true", ((char *)data))) + if(!Q_stricmp("true", ((char *)data))) { Q3_SetShielded( entID, qtrue ); } @@ -9091,7 +9091,7 @@ void CQuake3GameInterface::Set( int taskID, int entID, const char *type_name, co break; case SET_NO_GROUPS: - if(!stricmp("true", ((char *)data))) + if(!Q_stricmp("true", ((char *)data))) { Q3_SetNoGroups( entID, qtrue ); } @@ -9102,63 +9102,63 @@ void CQuake3GameInterface::Set( int taskID, int entID, const char *type_name, co break; case SET_FIRE_WEAPON: - if(!stricmp("true", ((char *)data))) + if(!Q_stricmp("true", ((char *)data))) { Q3_SetFireWeapon( entID, qtrue); } - else if(!stricmp("false", ((char *)data))) + else if(!Q_stricmp("false", ((char *)data))) { Q3_SetFireWeapon( entID, qfalse); } break; case SET_FIRE_WEAPON_NO_ANIM: - if(!stricmp("true", ((char *)data))) + if(!Q_stricmp("true", ((char *)data))) { Q3_SetFireWeaponNoAnim( entID, qtrue); } - else if(!stricmp("false", ((char *)data))) + else if(!Q_stricmp("false", ((char *)data))) { Q3_SetFireWeaponNoAnim( entID, qfalse); } break; case SET_SAFE_REMOVE: - if(!stricmp("true", ((char *)data))) + if(!Q_stricmp("true", ((char *)data))) { Q3_SetSafeRemove( entID, qtrue); } - else if(!stricmp("false", ((char *)data))) + else if(!Q_stricmp("false", ((char *)data))) { Q3_SetSafeRemove( entID, qfalse); } break; case SET_BOBA_JET_PACK: - if(!stricmp("true", ((char *)data))) + if(!Q_stricmp("true", ((char *)data))) { Q3_SetBobaJetPack( entID, qtrue); } - else if(!stricmp("false", ((char *)data))) + else if(!Q_stricmp("false", ((char *)data))) { Q3_SetBobaJetPack( entID, qfalse); } break; case SET_INACTIVE: - if(!stricmp("true", ((char *)data))) + if(!Q_stricmp("true", ((char *)data))) { Q3_SetInactive( entID, qtrue); } - else if(!stricmp("false", ((char *)data))) + else if(!Q_stricmp("false", ((char *)data))) { Q3_SetInactive( entID, qfalse); } - else if(!stricmp("unlocked", ((char *)data))) + else if(!Q_stricmp("unlocked", ((char *)data))) { extern void UnLockDoors(gentity_t *const ent); UnLockDoors(&g_entities[entID]); } - else if(!stricmp("locked", ((char *)data))) + else if(!Q_stricmp("locked", ((char *)data))) { extern void LockDoors(gentity_t *const ent); LockDoors(&g_entities[entID]); @@ -9170,18 +9170,18 @@ extern void LockDoors(gentity_t *const ent); break; case SET_FUNC_USABLE_VISIBLE: - if(!stricmp("true", ((char *)data))) + if(!Q_stricmp("true", ((char *)data))) { Q3_SetFuncUsableVisible( entID, qtrue); } - else if(!stricmp("false", ((char *)data))) + else if(!Q_stricmp("false", ((char *)data))) { Q3_SetFuncUsableVisible( entID, qfalse); } break; case SET_NO_KNOCKBACK: - if(!stricmp("true", ((char *)data))) + if(!Q_stricmp("true", ((char *)data))) { Q3_SetNoKnockback(entID, qtrue); } @@ -9203,7 +9203,7 @@ extern void LockDoors(gentity_t *const ent); break; case SET_VIDEO_FADE_IN: - if(!stricmp("true", ((char *)data))) + if(!Q_stricmp("true", ((char *)data))) { gi.cvar_set("cl_VidFadeUp", "1"); } @@ -9214,7 +9214,7 @@ extern void LockDoors(gentity_t *const ent); break; case SET_VIDEO_FADE_OUT: - if(!stricmp("true", ((char *)data))) + if(!Q_stricmp("true", ((char *)data))) { gi.cvar_set("cl_VidFadeDown", "1"); } @@ -9284,7 +9284,7 @@ extern void LockDoors(gentity_t *const ent); break; case SET_DISABLE_SHADER_ANIM: - if(!stricmp("true", ((char *)data))) + if(!Q_stricmp("true", ((char *)data))) { Q3_SetDisableShaderAnims( entID, qtrue); } @@ -9295,7 +9295,7 @@ extern void LockDoors(gentity_t *const ent); break; case SET_SHADER_ANIM: - if(!stricmp("true", ((char *)data))) + if(!Q_stricmp("true", ((char *)data))) { Q3_SetShaderAnim( entID, qtrue); } @@ -9314,7 +9314,7 @@ extern void LockDoors(gentity_t *const ent); break; case SET_HUD: - if(!stricmp("true", ((char *)data))) + if(!Q_stricmp("true", ((char *)data))) { gi.cvar_set("cg_drawHUD", "1"); } @@ -9381,7 +9381,7 @@ extern void LockDoors(gentity_t *const ent); case SET_CLOAK: // Created: 01/08/03 by AReis. //extern void Jedi_Cloak( gentity_t *self ); extern void Saboteur_Cloak( gentity_t *self ); - if( stricmp("true", ((char *)data)) == 0 ) + if( Q_stricmp("true", ((char *)data)) == 0 ) { Saboteur_Cloak( &g_entities[entID] ); } @@ -9437,11 +9437,11 @@ extern cvar_t *g_char_skin_legs; case SET_WINTER_GEAR: // Created: 03/26/03 by AReis. { // If this is a (fake) Player NPC or this IS the Player... - if ( entID == 0 || ( ent->NPC_type && stricmp( ent->NPC_type, "player" ) == 0 ) ) + if ( entID == 0 || ( ent->NPC_type && Q_stricmp( ent->NPC_type, "player" ) == 0 ) ) { char strSkin[MAX_QPATH]; // Set the Winter Gear Skin if true, otherwise set back to normal configuration. - if( stricmp( "true", ((char *)data) ) == 0 ) + if( Q_stricmp( "true", ((char *)data) ) == 0 ) { Com_sprintf( strSkin, sizeof( strSkin ), "models/players/%s/|%s|%s|%s", g_char_model->string, g_char_skin_head->string, "torso_g1", "lower_e1" ); } @@ -9560,11 +9560,11 @@ void CQuake3GameInterface::Kill( int entID, const char *name ) gentity_t *victim = NULL; int o_health; - if( !stricmp( name, "self") ) + if( !Q_stricmp( name, "self") ) { victim = ent; } - else if( !stricmp( name, "enemy" ) ) + else if( !Q_stricmp( name, "enemy" ) ) { victim = ent->enemy; } @@ -9657,7 +9657,7 @@ void CQuake3GameInterface::Play( int taskID, int entID, const char *type, const { gentity_t *ent = &g_entities[entID]; - if ( !stricmp( type, "PLAY_ROFF" ) ) + if ( !Q_stricmp( type, "PLAY_ROFF" ) ) { // Try to load the requested ROFF if ( G_LoadRoff( name ) ) @@ -10802,7 +10802,7 @@ int CQuake3GameInterface::Evaluate( int p1Type, const char *p1, int p2Type, con case TK_STRING: case TK_IDENTIFIER: - return (int) !stricmp( c1, c2 ); //NOTENOTE: The script uses proper string comparison logic (ex. ( a == a ) == true ) + return (int) !Q_stricmp( c1, c2 ); //NOTENOTE: The script uses proper string comparison logic (ex. ( a == a ) == true ) break; default: @@ -10902,7 +10902,7 @@ int CQuake3GameInterface::Evaluate( int p1Type, const char *p1, int p2Type, con case TK_STRING: case TK_IDENTIFIER: - return (int) stricmp( c1, c2 ); + return (int) Q_stricmp( c1, c2 ); break; default: @@ -11109,7 +11109,7 @@ int CQuake3GameInterface::GetByName( const char *name ) strncpy( (char *) temp, name, sizeof(temp) ); temp[sizeof(temp)-1] = 0; - ei = m_EntityList.find( strupr( (char *) temp ) ); + ei = m_EntityList.find( Q_strupr( (char *) temp ) ); if ( ei == m_EntityList.end() ) return -1; @@ -11189,7 +11189,7 @@ void CQuake3GameInterface::PrecacheSound( const char *name ) char finalName[MAX_QPATH]; Q_strncpyz( finalName, name, MAX_QPATH, 0 ); - strlwr(finalName); + Q_strlwr(finalName); if (com_buildScript->integer) { //get the male sound first G_SoundIndex( finalName ); diff --git a/code/game/g_navigator.cpp b/code/game/g_navigator.cpp index bbfed23..5d687a8 100644 --- a/code/game/g_navigator.cpp +++ b/code/game/g_navigator.cpp @@ -1874,8 +1874,8 @@ bool NAV::LoadFromEntitiesAndSaveToFile(const char *filename, int checksum) bool CanGo = false; bool IsDebugEdge = (g_nav1->string[0] && g_nav2->string[0] && - (!stricmp(*(a.mName), g_nav1->string) || !stricmp(*(b.mName), g_nav1->string)) && - (!stricmp(*(a.mName), g_nav2->string) || !stricmp(*(b.mName), g_nav2->string))); + (!Q_stricmp(*(a.mName), g_nav1->string) || !Q_stricmp(*(b.mName), g_nav1->string)) && + (!Q_stricmp(*(a.mName), g_nav2->string) || !Q_stricmp(*(b.mName), g_nav2->string))); // For debugging a connection between two known points: //------------------------------------------------------ diff --git a/code/game/g_ref.cpp b/code/game/g_ref.cpp index af05d3c..6d8f5da 100644 --- a/code/game/g_ref.cpp +++ b/code/game/g_ref.cpp @@ -149,7 +149,7 @@ reference_tag_t *TAG_Find( const char *owner, const char *name ) char tempName[ MAX_REFNAME ]; Q_strncpyz( (char *) tempName, name, MAX_REFNAME ); - strlwr( (char *) tempName ); //NOTENOTE: For case insensitive searches on a map + Q_strlwr( (char *) tempName ); //NOTENOTE: For case insensitive searches on a map rti = tagOwner->tagMap.find( tempName ); @@ -187,7 +187,7 @@ reference_tag_t *TAG_Add( const char *name, const char *owner, vec3_t origin, ve //Copy the name Q_strncpyz( (char *) tag->name, name, MAX_REFNAME ); - strlwr( (char *) tag->name ); //NOTENOTE: For case insensitive searches on a map + Q_strlwr( (char *) tag->name ); //NOTENOTE: For case insensitive searches on a map //Make sure this tag's name isn't alread in use if ( TAG_Find( owner, name ) ) diff --git a/code/game/g_roff.cpp b/code/game/g_roff.cpp index 7c04d67..74fa908 100644 --- a/code/game/g_roff.cpp +++ b/code/game/g_roff.cpp @@ -403,7 +403,7 @@ int G_LoadRoff( const char *fileName ) // See if I'm already precached for ( i = 0; i < num_roffs; i++ ) { - if ( stricmp( file, roffs[i].fileName ) == 0 ) + if ( Q_stricmp( file, roffs[i].fileName ) == 0 ) { // Good, just return me...avoid zero index return i + 1; diff --git a/code/game/g_utils.cpp b/code/game/g_utils.cpp index 0b781c1..7f7974d 100644 --- a/code/game/g_utils.cpp +++ b/code/game/g_utils.cpp @@ -46,7 +46,7 @@ int G_FindConfigstringIndex( const char *name, int start, int max, qboolean crea if ( !s[0] ) { break; } - if ( !stricmp( s, name ) ) { + if ( !Q_stricmp( s, name ) ) { return i; } } @@ -650,7 +650,7 @@ void G_UseTargets2 (gentity_t *ent, gentity_t *activator, const char *string) // if (string) { - if( !stricmp( string, "self") ) + if( !Q_stricmp( string, "self") ) { t = ent; if (t->e_UseFunc != useF_NULL) // check can be omitted @@ -1657,11 +1657,11 @@ static qboolean G_IsTriggerUsable(gentity_t* self, gentity_t* other) if ((!G_ValidActivateBehavior (self, BSET_USE) && !self->target) || (self->target && - (stricmp(self->target, "n") == 0 || - (stricmp(self->target, "neveropen") == 0 || - (stricmp(self->target, "run_gran_drop") == 0) || - (stricmp(self->target, "speaker") == 0) || - (stricmp(self->target, "locked") == 0) + (Q_stricmp(self->target, "n") == 0 || + (Q_stricmp(self->target, "neveropen") == 0 || + (Q_stricmp(self->target, "run_gran_drop") == 0) || + (Q_stricmp(self->target, "speaker") == 0) || + (Q_stricmp(self->target, "locked") == 0) )))) { return qfalse; diff --git a/code/game/genericparser2.cpp b/code/game/genericparser2.cpp index dbe5178..d8e2b18 100644 --- a/code/game/genericparser2.cpp +++ b/code/game/genericparser2.cpp @@ -381,7 +381,7 @@ bool CGPValue::Parse(char **dataPtr, CTextPool **textPool) { // end of data - error! return false; } - else if (strcmpi(token, "]") == 0) + else if (Q_strcmpi(token, "]") == 0) { // ending brace for this list break; } @@ -591,7 +591,7 @@ void CGPGroup::SortObject(CGPObject *object, CGPObject **unsortedList, CGPObject last = 0; while(test) { - if (strcmpi(object->GetName(), test->GetName()) < 0) + if (Q_strcmpi(object->GetName(), test->GetName()) < 0) { break; } @@ -674,7 +674,7 @@ CGPGroup *CGPGroup::FindSubGroup(const char *name) group = mSubGroups; while(group) { - if(!stricmp(name, group->GetName())) + if(!Q_stricmp(name, group->GetName())) { return(group); } @@ -705,7 +705,7 @@ bool CGPGroup::Parse(char **dataPtr, CTextPool **textPool) break; } } - else if (strcmpi(token, "}") == 0) + else if (Q_strcmpi(token, "}") == 0) { // ending brace for this group break; } @@ -714,7 +714,7 @@ bool CGPGroup::Parse(char **dataPtr, CTextPool **textPool) // read ahead to see what we are doing token = GetToken(dataPtr, true, true); - if (strcmpi(token, "{") == 0) + if (Q_strcmpi(token, "{") == 0) { // new sub group newSubGroup = AddGroup(lastToken, textPool); newSubGroup->SetWriteable(mWriteable); @@ -723,7 +723,7 @@ bool CGPGroup::Parse(char **dataPtr, CTextPool **textPool) return false; } } - else if (strcmpi(token, "[") == 0) + else if (Q_strcmpi(token, "[") == 0) { // new pair list newPair = AddPair(lastToken, 0, textPool); if (!newPair->Parse(dataPtr, textPool)) @@ -792,7 +792,7 @@ CGPValue *CGPGroup::FindPair(const char *key) while(pair) { - if (strcmpi(pair->GetName(), key) == 0) + if (Q_strcmpi(pair->GetName(), key) == 0) { return pair; } diff --git a/code/game/q_shared.h b/code/game/q_shared.h index a554bc0..6519728 100644 --- a/code/game/q_shared.h +++ b/code/game/q_shared.h @@ -1212,13 +1212,46 @@ int Q_isalpha( int c ); //char *Q_strrchr( const char* string, int c ); // NON-portable (but faster) versions +#ifdef WIN32 inline int Q_stricmp (const char *s1, const char *s2) { return stricmp(s1, s2); } +inline int Q_strnicmp (const char *s1, const char *s2, int n) { return strnicmp(s1, s2, n); } +inline int Q_strcmpi (const char *s1, const char *s2) { return strcmpi(s1, s2); } inline int Q_strncmp (const char *s1, const char *s2, int n) { return strncmp(s1, s2, n); } inline int Q_stricmpn (const char *s1, const char *s2, int n) { return strnicmp(s1, s2, n); } inline char *Q_strlwr( char *s1 ) { return strlwr(s1); } inline char *Q_strupr( char *s1 ) { return strupr(s1); } -inline char *Q_strrchr( const char* str, int c ) { return strrchr(str, c); } +#else +inline int Q_stricmp (const char *s1, const char *s2) { return strcasecmp(s1, s2); } +inline int Q_strnicmp (const char *s1, const char *s2, int n) { return strncasecmp(s1, s2, n); } +inline int Q_strcmpi (const char *s1, const char *s2) { return strcasecmp(s1, s2); } +inline int Q_strncmp (const char *s1, const char *s2, int n) { return strncasecmp(s1, s2, n); } +inline int Q_stricmpn (const char *s1, const char *s2, int n) { return strncasecmp(s1, s2, n); } +inline char *Q_strlwr( char *s1 ) +{ + char *s; + + s = s1; + while ( *s ) { + *s = tolower(*s); + s++; + } + return s1; +} + +inline char *Q_strupr( char *s1 ) +{ + char *s; + + s = s1; + while ( *s ) { + *s = toupper(*s); + s++; + } + return s1; +} +#endif +inline char *Q_strrchr( const 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 ); diff --git a/code/ghoul2/G2_bolts.cpp b/code/ghoul2/G2_bolts.cpp index 500c11f..8447346 100644 --- a/code/ghoul2/G2_bolts.cpp +++ b/code/ghoul2/G2_bolts.cpp @@ -173,7 +173,7 @@ int G2_Add_Bolt(CGhoul2Info *ghlInfo, boltInfo_v &bltlist, surfaceInfo_v &slist, { skel = (mdxaSkel_t *)((byte *)ghlInfo->aHeader + sizeof(mdxaHeader_t) + offsets->offsets[x]); // if name is the same, we found it - if (!stricmp(skel->name, boneName)) + if (!Q_stricmp(skel->name, boneName)) { break; } diff --git a/code/ghoul2/G2_bones.cpp b/code/ghoul2/G2_bones.cpp index 4679ce0..a713d90 100644 --- a/code/ghoul2/G2_bones.cpp +++ b/code/ghoul2/G2_bones.cpp @@ -56,7 +56,7 @@ int G2_Find_Bone(CGhoul2Info *ghlInfo, boneInfo_v &blist, const char *boneName) skel = (mdxaSkel_t *)((byte *)ghlInfo->aHeader + sizeof(mdxaHeader_t) + offsets->offsets[blist[i].boneNumber]); // if name is the same, we found it - if (!stricmp(skel->name, boneName)) + if (!Q_stricmp(skel->name, boneName)) { return i; } @@ -89,7 +89,7 @@ int G2_Add_Bone (const model_t *mod, boneInfo_v &blist, const char *boneName) { skel = (mdxaSkel_t *)((byte *)mod->mdxa + sizeof(mdxaHeader_t) + offsets->offsets[x]); // if name is the same, we found it - if (!stricmp(skel->name, boneName)) + if (!Q_stricmp(skel->name, boneName)) { break; } @@ -112,7 +112,7 @@ int G2_Add_Bone (const model_t *mod, boneInfo_v &blist, const char *boneName) { skel = (mdxaSkel_t *)((byte *)mod->mdxa + sizeof(mdxaHeader_t) + offsets->offsets[blist[i].boneNumber]); // if name is the same, we found it - if (!stricmp(skel->name, boneName)) + if (!Q_stricmp(skel->name, boneName)) { #if DEBUG_G2_BONES { @@ -1180,7 +1180,7 @@ int G2_Find_Bone_Rag(CGhoul2Info *ghlInfo, boneInfo_v &blist, const char *boneNa //skel = (mdxaSkel_t *)((byte *)aHeader + sizeof(mdxaHeader_t) + offsets->offsets[blist[i].boneNumber]); // if name is the same, we found it - if (!stricmp(skel->name, boneName)) + if (!Q_stricmp(skel->name, boneName)) { return i; } diff --git a/code/ghoul2/G2_misc.cpp b/code/ghoul2/G2_misc.cpp index 8484491..8c23a8b 100644 --- a/code/ghoul2/G2_misc.cpp +++ b/code/ghoul2/G2_misc.cpp @@ -1847,7 +1847,7 @@ int G2_FindConfigStringSpace(char *name, int start, int max) { break; } - if ( !stricmp( s, name ) ) + if ( !Q_stricmp( s, name ) ) { return i; } @@ -1924,4 +1924,4 @@ void G2_LoadGhoul2Model(CGhoul2Info_v &ghoul2, char *buffer) buffer += BOLT_SAVE_BLOCK_SIZE; } } -} \ No newline at end of file +} diff --git a/code/ghoul2/G2_surfaces.cpp b/code/ghoul2/G2_surfaces.cpp index 3fa168d..60e5630 100644 --- a/code/ghoul2/G2_surfaces.cpp +++ b/code/ghoul2/G2_surfaces.cpp @@ -129,7 +129,7 @@ int G2_IsSurfaceLegal(const model_s *mod_m, const char *surfaceName, int *flags) for ( int i = 0 ; i < mod_m->mdxm->numSurfaces ; i++) { - if (!stricmp(surfaceName, surf->name)) + if (!Q_stricmp(surfaceName, surf->name)) { *flags = surf->flags; return i; @@ -172,7 +172,7 @@ const mdxmSurface_t *G2_FindSurface(CGhoul2Info *ghlInfo, surfaceInfo_v &slist, const mdxmSurfHierarchy_t *surfInfo = (mdxmSurfHierarchy_t *)((byte *)surfIndexes + surfIndexes->offsets[surf->thisSurfaceIndex]); // are these the droids we're looking for? - if (!stricmp (surfInfo->name, surfaceName)) + if (!Q_stricmp (surfInfo->name, surfaceName)) { // yup if (surfIndex) diff --git a/code/icarus/IcarusImplementation.cpp b/code/icarus/IcarusImplementation.cpp index 7dea9a3..5190d43 100644 --- a/code/icarus/IcarusImplementation.cpp +++ b/code/icarus/IcarusImplementation.cpp @@ -362,7 +362,7 @@ void CIcarus::Precache(char* buffer, long length) sVal1 = (const char *) block.GetMemberData( 0 ); - if (!stricmp(sVal1,"PLAY_ROFF")) + if (!Q_stricmp(sVal1,"PLAY_ROFF")) { sVal1 = (const char *) block.GetMemberData( 1 ); diff --git a/code/qcommon/cm_load.cpp b/code/qcommon/cm_load.cpp index 7e717ec..e077ed9 100644 --- a/code/qcommon/cm_load.cpp +++ b/code/qcommon/cm_load.cpp @@ -1171,7 +1171,7 @@ int CM_LoadSubBSP(const char *name, qboolean clientload) count = cmg.numSubModels; for(i = 0; i < NumSubBSP; i++) { - if (!stricmp(name, SubBSP[i].name)) + if (!Q_stricmp(name, SubBSP[i].name)) { return count; } diff --git a/code/qcommon/cm_load_xbox.cpp b/code/qcommon/cm_load_xbox.cpp index 200422c..f171b20 100644 --- a/code/qcommon/cm_load_xbox.cpp +++ b/code/qcommon/cm_load_xbox.cpp @@ -1116,7 +1116,7 @@ int CM_LoadSubBSP(const char *name, qboolean clientload) count = cmg.numSubModels; for(i = 0; i < NumSubBSP; i++) { - if (!stricmp(name, SubBSP[i].name)) + if (!Q_stricmp(name, SubBSP[i].name)) { return count; } diff --git a/code/qcommon/cm_terrain.cpp b/code/qcommon/cm_terrain.cpp index d8ce9c2..8e56b3e 100644 --- a/code/qcommon/cm_terrain.cpp +++ b/code/qcommon/cm_terrain.cpp @@ -63,7 +63,7 @@ void CCMLandScape::LoadTerrainDef(const char *td) items = classes->GetSubGroups(); while(items) { - if(!stricmp(items->GetName(), "altitudetexture")) + if(!Q_stricmp(items->GetName(), "altitudetexture")) { int height; const char *shaderName; @@ -83,7 +83,7 @@ void CCMLandScape::LoadTerrainDef(const char *td) } } } - else if(!stricmp(items->GetName(), "water")) + else if(!Q_stricmp(items->GetName(), "water")) { const char *shaderName; CCMShader *shader; diff --git a/code/qcommon/common.cpp b/code/qcommon/common.cpp index 179cf39..e8de03e 100644 --- a/code/qcommon/common.cpp +++ b/code/qcommon/common.cpp @@ -435,7 +435,7 @@ void Com_StartupVariable( const char *match ) { } s = Cmd_Argv(1); - if ( !match || !stricmp( s, match ) ) { + if ( !match || !Q_stricmp( s, match ) ) { Cvar_Set( s, Cmd_Argv(2) ); cv = Cvar_Get( s, "", 0 ); cv->flags |= CVAR_USER_CREATED; diff --git a/code/qcommon/files_common.cpp b/code/qcommon/files_common.cpp index ba593ac..1a29cd1 100644 --- a/code/qcommon/files_common.cpp +++ b/code/qcommon/files_common.cpp @@ -300,7 +300,7 @@ void FS_CreatePath (char *OSPath) { return; } - strlwr(OSPath); + Q_strlwr(OSPath); for (ofs = OSPath+1 ; *ofs ; ofs++) { if (*ofs == PATH_SEP) { diff --git a/code/qcommon/files_console.cpp b/code/qcommon/files_console.cpp index 5bba955..97e576a 100644 --- a/code/qcommon/files_console.cpp +++ b/code/qcommon/files_console.cpp @@ -789,7 +789,7 @@ static int FS_AddFileToList( char *name, char *list[MAX_FOUND_FILES], int nfiles return nfiles; } for ( i = 0 ; i < nfiles ; i++ ) { - if ( !stricmp( name, list[i] ) ) { + if ( !Q_stricmp( name, list[i] ) ) { return nfiles; // allready in list } } @@ -900,7 +900,7 @@ static int FS_AddFileToListBuf( char *name, char *listbuf, int bufsize, int nfil p = listbuf; while ( *p ) { - if ( !stricmp( name, p ) ) { + if ( !Q_stricmp( name, p ) ) { return nfiles; // already in list } p += strlen( p ) + 1; diff --git a/code/qcommon/files_pc.cpp b/code/qcommon/files_pc.cpp index 3cc7dd5..4c6df3e 100644 --- a/code/qcommon/files_pc.cpp +++ b/code/qcommon/files_pc.cpp @@ -435,9 +435,9 @@ int FS_FOpenFileRead( const char *filename, fileHandle_t *file, qboolean uniqueF l = strlen( filename ); - if ( stricmp( filename + l - 4, ".cfg" ) // for config files - && stricmp( filename + l - 4, ".sav" ) // for save games - && stricmp( filename + l - 4, ".dat" ) ) { // for journal files + if ( Q_stricmp( filename + l - 4, ".cfg" ) // for config files + && Q_stricmp( filename + l - 4, ".sav" ) // for save games + && Q_stricmp( filename + l - 4, ".dat" ) ) { // for journal files continue; } } @@ -475,7 +475,7 @@ int FS_FOpenFileRead( const char *filename, fileHandle_t *file, qboolean uniqueF // if we are getting it from the cdpath, optionally copy it // to the basepath - if ( fs_copyfiles->integer && !stricmp( dir->path, fs_cdpath->string ) ) { + if ( fs_copyfiles->integer && !Q_stricmp( dir->path, fs_cdpath->string ) ) { char *copypath; copypath = FS_BuildOSPath( fs_basepath->string, dir->gamedir, filename ); @@ -1002,7 +1002,7 @@ static int FS_AddFileToList( char *name, char *list[MAX_FOUND_FILES], int nfiles return nfiles; } for ( i = 0 ; i < nfiles ; i++ ) { - if ( !stricmp( name, list[i] ) ) { + if ( !Q_stricmp( name, list[i] ) ) { return nfiles; // allready in list } } @@ -1077,7 +1077,7 @@ char **FS_ListFiles( const char *path, const char *extension, int *numfiles ) { continue; } - if ( stricmp( name + length - extensionLength, extension ) ) { + if ( Q_stricmp( name + length - extensionLength, extension ) ) { continue; } @@ -1159,7 +1159,7 @@ static int FS_AddFileToListBuf( char *name, char *listbuf, int bufsize, int nfil p = listbuf; while ( *p ) { - if ( !stricmp( name, p ) ) { + if ( !Q_stricmp( name, p ) ) { return nfiles; // already in list } p += strlen( p ) + 1; @@ -1244,7 +1244,7 @@ int FS_GetFileList( const char *path, const char *extension, char *listbuf, int continue; } - if ( stricmp( name + length - extensionLength, extension ) ) { + if ( Q_stricmp( name + length - extensionLength, extension ) ) { continue; } @@ -1459,7 +1459,7 @@ static int QDECL paksort( const void *a, const void *b ) { aa = *(char **)a; bb = *(char **)b; - return stricmp( aa, bb ); + return Q_stricmp( aa, bb ); } diff --git a/code/qcommon/sstring.h b/code/qcommon/sstring.h index c0a2484..adf4618 100644 --- a/code/qcommon/sstring.h +++ b/code/qcommon/sstring.h @@ -80,7 +80,7 @@ public: } bool operator==(const sstring &o) const { - if (!strcmpi(mStorage.data,o.mStorage.data)) + if (!Q_strcmpi(mStorage.data,o.mStorage.data)) { return true; } @@ -88,7 +88,7 @@ public: } bool operator!=(const sstring &o) const { - if (strcmpi(mStorage.data,o.mStorage.data)!=0) + if (Q_strcmpi(mStorage.data,o.mStorage.data)!=0) { return true; } @@ -96,7 +96,7 @@ public: } bool operator<(const sstring &o) const { - if (strcmpi(mStorage.data,o.mStorage.data)<0) + if (Q_strcmpi(mStorage.data,o.mStorage.data)<0) { return true; } @@ -104,7 +104,7 @@ public: } bool operator>(const sstring &o) const { - if (strcmpi(mStorage.data,o.mStorage.data)>0) + if (Q_strcmpi(mStorage.data,o.mStorage.data)>0) { return true; } diff --git a/code/qcommon/stringed_ingame.cpp b/code/qcommon/stringed_ingame.cpp index 488c0a0..88b761a 100644 --- a/code/qcommon/stringed_ingame.cpp +++ b/code/qcommon/stringed_ingame.cpp @@ -242,7 +242,7 @@ void CStringEdPackage::SetupNewFileParse( LPCSTR psFileName, SE_BOOL bLoadDebug m_strCurrentFileRef_ParseOnly = sString; // eg "OBJECTIVES" m_strLoadingLanguage_ParseOnly = ExtractLanguageFromPath( psFileName ); - m_bLoadingEnglish_ParseOnly = (!stricmp( m_strLoadingLanguage_ParseOnly.c_str(), "english" )) ? SE_TRUE : SE_FALSE; + m_bLoadingEnglish_ParseOnly = (!Q_stricmp( m_strLoadingLanguage_ParseOnly.c_str(), "english" )) ? SE_TRUE : SE_FALSE; m_bLoadDebug = bLoadDebug; } @@ -493,13 +493,13 @@ static char *CopeWithDumbStringData( LPCSTR psSentence, LPCSTR psThisLanguage ) // Ok, bollocks to it, this will have to do. Any other languages that come later and have bugs in their text can // get fixed by them typing it in properly in the first place... // - if (!stricmp(psThisLanguage,"ENGLISH") || - !stricmp(psThisLanguage,"FRENCH") || - !stricmp(psThisLanguage,"GERMAN") || - !stricmp(psThisLanguage,"ITALIAN") || - !stricmp(psThisLanguage,"SPANISH") || - !stricmp(psThisLanguage,"POLISH") || - !stricmp(psThisLanguage,"RUSSIAN") + if (!Q_stricmp(psThisLanguage,"ENGLISH") || + !Q_stricmp(psThisLanguage,"FRENCH") || + !Q_stricmp(psThisLanguage,"GERMAN") || + !Q_stricmp(psThisLanguage,"ITALIAN") || + !Q_stricmp(psThisLanguage,"SPANISH") || + !Q_stricmp(psThisLanguage,"POLISH") || + !Q_stricmp(psThisLanguage,"RUSSIAN") ) { char *p; @@ -690,7 +690,7 @@ LPCSTR CStringEdPackage::ParseLine( LPCSTR psLine ) { // if loading a foreign language... // - SE_BOOL bSentenceIsEnglish = (!stricmp(sThisLanguage,"english")) ? SE_TRUE: SE_FALSE; // see whether this is the english master or not + SE_BOOL bSentenceIsEnglish = (!Q_stricmp(sThisLanguage,"english")) ? SE_TRUE: SE_FALSE; // see whether this is the english master or not // this check can be omitted, I'm just being extra careful here... // @@ -698,7 +698,7 @@ LPCSTR CStringEdPackage::ParseLine( LPCSTR psLine ) { // basically this is just checking that an .STE file override is the same language as the .STR... // - if (stricmp( m_strLoadingLanguage_ParseOnly.c_str(), sThisLanguage )) + if (Q_stricmp( m_strLoadingLanguage_ParseOnly.c_str(), sThisLanguage )) { psErrorMessage = va("Language \"%s\" found when expecting \"%s\"!\n", sThisLanguage, m_strLoadingLanguage_ParseOnly.c_str()); } @@ -797,7 +797,7 @@ void CStringEdPackage::SetString( LPCSTR psLocalReference, LPCSTR psNewString, S { // then this is foreign text (so check for "#same" resolving)... // - if (!stricmp(psNewString, sSE_EXPORT_SAME)) + if (!Q_stricmp(psNewString, sSE_EXPORT_SAME)) { Entry.m_strString = m_strCurrentEntryEnglish_ParseOnly; // foreign "#same" is now english if (m_bLoadDebug) @@ -896,7 +896,7 @@ static LPCSTR SE_GetFoundFile( string &strResult ) strResult.erase(); } -// strlwr(sTemp); // just for consistancy and set<> -> set<> erasure checking etc +// Q_strlwr(sTemp); // just for consistancy and set<> -> set<> erasure checking etc return sTemp; } @@ -1100,7 +1100,7 @@ int SE_GetNumLanguages(void) // if english is available, it should always be first... ( I suppose ) // - if (!stricmp(psLanguage,"english")) + if (!Q_stricmp(psLanguage,"english")) { gvLanguagesAvailable.insert( gvLanguagesAvailable.begin(), psLanguage ); } @@ -1228,7 +1228,7 @@ LPCSTR SE_LoadLanguage( LPCSTR psLanguage, SE_BOOL bLoadDebug /* = SE_TRUE */ ) { LPCSTR psThisLang = TheStringPackage.ExtractLanguageFromPath( p ); - if ( !stricmp( psLanguage, psThisLang ) ) + if ( !Q_stricmp( psLanguage, psThisLang ) ) { psErrorMessage = SE_Load( p, bLoadDebug ); } diff --git a/code/renderer/tr_WorldEffects.cpp b/code/renderer/tr_WorldEffects.cpp index 24a99ba..7652042 100644 --- a/code/renderer/tr_WorldEffects.cpp +++ b/code/renderer/tr_WorldEffects.cpp @@ -1838,7 +1838,7 @@ void R_WorldEffectCommand(const char *command) // Clear - Removes All Particle Clouds And Wind Zones //---------------------------------------------------- - if (strcmpi(token, "clear") == 0) + if (Q_strcmpi(token, "clear") == 0) { for (int p=0; pnumChildren); LL(surfInfo->parentIndex); - strlwr(surfInfo->name); //just in case + Q_strlwr(surfInfo->name); //just in case if ( !strcmp( &surfInfo->name[strlen(surfInfo->name)-4],"_off") ) { surfInfo->name[strlen(surfInfo->name)-4]=0; //remove "_off" from name diff --git a/code/renderer/tr_image.cpp b/code/renderer/tr_image.cpp index 4e21563..b963b8b 100644 --- a/code/renderer/tr_image.cpp +++ b/code/renderer/tr_image.cpp @@ -949,7 +949,7 @@ typedef tmap (int, image_t *) AllocatedImages_t; class CStringComparator { public: - bool operator()(const char *s1, const char *s2) const { return(stricmp(s1, s2) < 0); } + bool operator()(const char *s1, const char *s2) const { return(Q_stricmp(s1, s2) < 0); } }; typedef map AllocatedImages_t; @@ -3016,7 +3016,7 @@ static char *CommaParse( char **data_p ) { class CStringComparator { public: - bool operator()(const char *s1, const char *s2) const { return(stricmp(s1, s2) < 0); } + bool operator()(const char *s1, const char *s2) const { return(Q_stricmp(s1, s2) < 0); } }; */ typedef map AnimationCFGs_t; diff --git a/code/renderer/tr_init.cpp b/code/renderer/tr_init.cpp index 2005dae..a5a1eef 100644 --- a/code/renderer/tr_init.cpp +++ b/code/renderer/tr_init.cpp @@ -302,7 +302,7 @@ void R_Splash() image_t *pImage; /* const char* s = Cvar_VariableString("se_language"); - if (stricmp(s,"english")) + if (Q_stricmp(s,"english")) { pImage = R_FindImageFile( "menu/splash_eur", qfalse, qfalse, qfalse, GL_CLAMP); } @@ -515,7 +515,7 @@ void R_TakeScreenshot( int x, int y, int width, int height, char *fileName ) { byte *buffer; int i, c, temp; - qboolean bSaveAsJPG = !strnicmp(&fileName[strlen(fileName)-4],".jpg",4); + qboolean bSaveAsJPG = !Q_strnicmp(&fileName[strlen(fileName)-4],".jpg",4); if (bSaveAsJPG) { diff --git a/code/renderer/tr_model.cpp b/code/renderer/tr_model.cpp index ea3ab57..1da774d 100644 --- a/code/renderer/tr_model.cpp +++ b/code/renderer/tr_model.cpp @@ -743,7 +743,7 @@ qhandle_t RE_RegisterModel( const char *name ) qhandle_t q = RE_RegisterModel_Actual( name ); -if (stricmp(&name[strlen(name)-4],".gla")){ +if (Q_stricmp(&name[strlen(name)-4],".gla")){ gbInsideRegisterModel = qfalse; // GLA files recursively call this, so don't turn off half way. A reference count would be nice, but if any ERR_DROP ever occurs within the load then the refcount will be knackered from then on } diff --git a/code/renderer/tr_shader.cpp b/code/renderer/tr_shader.cpp index f9a361c..e8a00e2 100644 --- a/code/renderer/tr_shader.cpp +++ b/code/renderer/tr_shader.cpp @@ -2302,7 +2302,7 @@ static void ParseMaterial( const char **text ) } for(i = 0; i < MATERIAL_LAST; i++) { - if ( !stricmp( token, materialNames[i] ) ) + if ( !Q_stricmp( token, materialNames[i] ) ) { shader.surfaceFlags &= ~MATERIAL_MASK;//safety, clear it first shader.surfaceFlags |= i; @@ -2424,7 +2424,7 @@ static qboolean ParseShader( const char **text ) } // material deprecated as of 11 Jan 01 // material undeprecated as of 7 May 01 - q3map_material deprecated - else if ( !stricmp( token, "material" ) || !stricmp( token, "q3map_material" ) ) + else if ( !Q_stricmp( token, "material" ) || !Q_stricmp( token, "q3map_material" ) ) { ParseMaterial( text ); } @@ -3310,7 +3310,7 @@ static const char *FindShaderInShaderText( const char *shadername ) { char sLowerCaseName[MAX_QPATH]; Q_strncpyz(sLowerCaseName,shadername,sizeof(sLowerCaseName)); - strlwr(sLowerCaseName); // Q_strlwr is pretty gay, so I'm not using it + Q_strlwr(sLowerCaseName); return ShaderEntryPtrs_Lookup(sLowerCaseName); @@ -3744,7 +3744,7 @@ static void SetupShaderEntryPtrs(void) } else { - strlwr(token); // token is always a ptr to com_token here, not the original buffer. + Q_strlwr(token); // token is always a ptr to com_token here, not the original buffer. // (Not that it matters, except for reasons of speed by not strlwr'ing the whole buffer) // token = a string of this shader name, p = ptr within s_shadertext it's found at, so store it... diff --git a/code/renderer/tr_terrain.cpp b/code/renderer/tr_terrain.cpp index ad10695..bf199ee 100644 --- a/code/renderer/tr_terrain.cpp +++ b/code/renderer/tr_terrain.cpp @@ -561,7 +561,7 @@ void CTRLandScape::LoadTerrainDef(const char *td) { const char* type = items->GetName ( ); - if(!stricmp( type, "altitudetexture")) + if(!Q_stricmp( type, "altitudetexture")) { int height; const char *shaderName; @@ -581,11 +581,11 @@ void CTRLandScape::LoadTerrainDef(const char *td) } } } - else if(!stricmp(type, "water")) + else if(!Q_stricmp(type, "water")) { mWaterShader = R_GetShaderByHandle(RE_RegisterShader(items->FindPairValue("shader", ""))); } - else if(!stricmp(type, "flattexture")) + else if(!Q_stricmp(type, "flattexture")) { mFlatShader = RE_RegisterShader ( items->FindPairValue("shader", "") ); } diff --git a/code/server/sv_client.cpp b/code/server/sv_client.cpp index 8317c00..86aad8e 100644 --- a/code/server/sv_client.cpp +++ b/code/server/sv_client.cpp @@ -483,7 +483,7 @@ static void SV_UserMove( client_t *cl, msg_t *msg ) { if ( eSavedGameJustLoaded == eNO ) { SG_WriteSavegame("auto",qtrue); - if ( strnicmp(sv_mapname->string, "academy", 7) != 0) + if ( Q_strnicmp(sv_mapname->string, "academy", 7) != 0) { Com_sprintf (savename, sizeof(savename), "auto_%s",sv_mapname->string); SG_WriteSavegame(savename,qtrue);//can't use va becuase it's nested diff --git a/code/server/sv_savegame.cpp b/code/server/sv_savegame.cpp index 8c8eeb8..5c87d5b 100644 --- a/code/server/sv_savegame.cpp +++ b/code/server/sv_savegame.cpp @@ -495,7 +495,7 @@ void SV_WipeGame_f(void) Com_Printf (S_COLOR_RED "USAGE: wipe \n"); return; } - if (!stricmp (Cmd_Argv(1), "auto") ) + if (!Q_stricmp (Cmd_Argv(1), "auto") ) { Com_Printf (S_COLOR_RED "Can't wipe 'auto'\n"); return; @@ -560,7 +560,7 @@ void SV_LoadGame_f(void) } #ifndef _XBOX // VVFIXME : Part of super-bootleg SG hackery - if (!stricmp (psFilename, "current")) + if (!Q_stricmp (psFilename, "current")) { Com_Printf (S_COLOR_RED "Can't load from \"current\"\n"); return; @@ -570,7 +570,7 @@ void SV_LoadGame_f(void) // special case, if doing a respawn then check that the available auto-save (if any) is from the same map // as we're currently on (if in a map at all), if so, load that "auto", else re-load the last-loaded file... // - if (!stricmp(psFilename, "*respawn")) + if (!Q_stricmp(psFilename, "*respawn")) { psFilename = "auto"; // default to standard respawn behaviour @@ -672,7 +672,7 @@ void SV_SaveGame_f(void) char *psFilename = Cmd_Argv(1); - if (!stricmp (psFilename, "current")) + if (!Q_stricmp (psFilename, "current")) { Com_Printf (S_COLOR_RED "Can't save to 'current'\n"); return; @@ -687,7 +687,7 @@ void SV_SaveGame_f(void) if (!SG_GameAllowedToSaveHere(qfalse)) //full check return; // this prevents people saving via quick-save now during cinematics. - if ( !stricmp (psFilename, "auto") ) + if ( !Q_stricmp (psFilename, "auto") ) { #ifdef _XBOX diff --git a/code/ui/ui_debug.cpp b/code/ui/ui_debug.cpp index 4c86b7c..19c3bee 100644 --- a/code/ui/ui_debug.cpp +++ b/code/ui/ui_debug.cpp @@ -37,11 +37,11 @@ struct Reference_t // bool operator < (const Reference_t& _X) const { - int i = stricmp(sMenu.c_str(),_X.sMenu.c_str()); + int i = Q_stricmp(sMenu.c_str(),_X.sMenu.c_str()); if (i) return i<0; - return !!(stricmp(sReference.c_str(),_X.sReference.c_str()) < 0); + return !!(Q_stricmp(sReference.c_str(),_X.sReference.c_str()) < 0); } }; #include @@ -114,7 +114,7 @@ static LPCSTR CreateUniqueReference(LPCSTR psText) p[i] = '_'; } } - strupr(p); + Q_strupr(p); // remove any trailing underscores... // @@ -174,7 +174,7 @@ static LPCSTR CreateUniqueReference(LPCSTR psText) p[i] = '_'; } } - strupr(p); + Q_strupr(p); // remove any trailing underscores... // @@ -267,9 +267,9 @@ static void EnterRef(LPCSTR psReference, LPCSTR psText, LPCSTR psMenuFile) CorrectionDataItem_t CorrectionDataItem; CorrectionDataItem.sMenuFile = psMenuFile; - CorrectionDataItem.sTextToFind = strlen(psReference) ? ( /* !stricmp(psReference,psNewReference) ? "" :*/ va("@%s",psReference) ) + CorrectionDataItem.sTextToFind = strlen(psReference) ? ( /* !Q_stricmp(psReference,psNewReference) ? "" :*/ va("@%s",psReference) ) : va("\"%s\"",psText); - CorrectionDataItem.sTextToReplaceWith = /* !stricmp(psReference,psNewReference) ? "" : */va("@%s",psNewReference); + CorrectionDataItem.sTextToReplaceWith = /* !Q_stricmp(psReference,psNewReference) ? "" : */va("@%s",psNewReference); // CorrectionDataItem.sStripEdReference = psNewReference; CorrectionDataItem.sStripEdText = psText; @@ -295,7 +295,7 @@ static void EnterRef(LPCSTR psReference, LPCSTR psText, LPCSTR psMenuFile) // only enter correction data if references are different... // -// if (stricmp(psReference,psNewReference)) +// if (Q_stricmp(psReference,psNewReference)) { CorrectionDataItem_t CorrectionDataItem; CorrectionDataItem.sMenuFile = psMenuFile; @@ -722,9 +722,9 @@ void UI_Debug_EnterReference(LPCSTR ps4LetterType, LPCSTR psItemString) { if (psItemString && psItemString[0]) { - if ( !stricmp(psItemString,"english") || - !stricmp(psItemString,"francais") || - !stricmp(psItemString,"deutsch") + if ( !Q_stricmp(psItemString,"english") || + !Q_stricmp(psItemString,"francais") || + !Q_stricmp(psItemString,"deutsch") ) { // then don't localise it! diff --git a/code/ui/ui_main.cpp b/code/ui/ui_main.cpp index 0db92fc..bfd7751 100644 --- a/code/ui/ui_main.cpp +++ b/code/ui/ui_main.cpp @@ -2431,7 +2431,7 @@ static void UI_BuildPlayerModel_List( qboolean inGameLoad ) if (bIsImageFile(dirptr, skinname, building)) { //if it exists - if (strnicmp(skinname,"head_",5) == 0) + if (Q_strnicmp(skinname,"head_",5) == 0) { if (uiInfo.playerSpecies[uiInfo.playerSpeciesCount].SkinHeadCount < MAX_PLAYERMODELS) { @@ -2439,7 +2439,7 @@ static void UI_BuildPlayerModel_List( qboolean inGameLoad ) iSkinParts |= 1<<0; } } else - if (strnicmp(skinname,"torso_",6) == 0) + if (Q_strnicmp(skinname,"torso_",6) == 0) { if (uiInfo.playerSpecies[uiInfo.playerSpeciesCount].SkinTorsoCount < MAX_PLAYERMODELS) { @@ -2447,7 +2447,7 @@ static void UI_BuildPlayerModel_List( qboolean inGameLoad ) iSkinParts |= 1<<1; } } else - if (strnicmp(skinname,"lower_",6) == 0) + if (Q_strnicmp(skinname,"lower_",6) == 0) { if (uiInfo.playerSpecies[uiInfo.playerSpeciesCount].SkinLegCount < MAX_PLAYERMODELS) { @@ -4282,7 +4282,7 @@ static void UI_GetCharacterCvars ( void ) for (int i = 0; i < uiInfo.playerSpeciesCount; i++) { - if ( !stricmp(model, uiInfo.playerSpecies[i].Name) ) + if ( !Q_stricmp(model, uiInfo.playerSpecies[i].Name) ) { uiInfo.playerSpeciesIndex = i; } @@ -4301,12 +4301,12 @@ static void UI_UpdateSaberCvars ( void ) static void UI_UpdateFightingStyleChoices ( void ) { // - if (!strcmpi("staff",Cvar_VariableString ( "ui_saber_type" ))) + if (!Q_strcmpi("staff",Cvar_VariableString ( "ui_saber_type" ))) { Cvar_Set ( "ui_fightingstylesallowed", "0" ); Cvar_Set ( "ui_newfightingstyle", "4" ); // SS_STAFF } - else if (!strcmpi("dual",Cvar_VariableString ( "ui_saber_type" ))) + else if (!Q_strcmpi("dual",Cvar_VariableString ( "ui_saber_type" ))) { Cvar_Set ( "ui_fightingstylesallowed", "0" ); Cvar_Set ( "ui_newfightingstyle", "3" ); // SS_DUAL diff --git a/code/ui/ui_shared.cpp b/code/ui/ui_shared.cpp index 984e50f..976936a 100644 --- a/code/ui/ui_shared.cpp +++ b/code/ui/ui_shared.cpp @@ -2739,7 +2739,7 @@ qboolean Script_SetCvar(itemDef_t *item, const char **args) const char *cvar, *val; if (String_Parse(args, &cvar) && String_Parse(args, &val)) { - if(!stricmp(val,"(NULL)")) + if(!Q_stricmp(val,"(NULL)")) { DC->setCVar(cvar, ""); } @@ -3189,7 +3189,7 @@ qboolean ItemParse_asset_model( itemDef_t *item ) } char modelPath[MAX_QPATH]; - if (!stricmp(temp,"ui_char_model") ) + if (!Q_stricmp(temp,"ui_char_model") ) { Com_sprintf( modelPath, sizeof( modelPath ), "models/players/%s/model.glm", Cvar_VariableString ( "g_char_model" ) ); } @@ -4456,7 +4456,7 @@ qboolean ItemParse_cvarFloat( itemDef_t *item) !PC_ParseFloat(&editPtr->minVal) && !PC_ParseFloat(&editPtr->maxVal)) { - if (!stricmp(item->cvar,"r_ext_texture_filter_anisotropic")) + if (!Q_stricmp(item->cvar,"r_ext_texture_filter_anisotropic")) {//hehe, hook up the correct max value here. editPtr->maxVal=glConfig.maxTextureFilterAnisotropy; } @@ -4491,17 +4491,17 @@ qboolean ItemParse_cvarStrList( itemDef_t *item) return qfalse; } - if (!stricmp(token,"feeder") && item->special == FEEDER_PLAYER_SPECIES) + if (!Q_stricmp(token,"feeder") && item->special == FEEDER_PLAYER_SPECIES) { for (; multiPtr->count < uiInfo.playerSpeciesCount; multiPtr->count++) { - multiPtr->cvarList[multiPtr->count] = String_Alloc(strupr(va("@MENUS_%s",uiInfo.playerSpecies[multiPtr->count].Name ))); //look up translation + multiPtr->cvarList[multiPtr->count] = String_Alloc(Q_strupr(va("@MENUS_%s",uiInfo.playerSpecies[multiPtr->count].Name ))); //look up translation multiPtr->cvarStr[multiPtr->count] = uiInfo.playerSpecies[multiPtr->count].Name; //value } return qtrue; } // languages - if (!stricmp(token,"feeder") && item->special == FEEDER_LANGUAGES) + if (!Q_stricmp(token,"feeder") && item->special == FEEDER_LANGUAGES) { for (; multiPtr->count < uiInfo.languageCount; multiPtr->count++) { diff --git a/code/unix/linux_glimp.c b/code/unix/linux_glimp.c index 63e5632..b84066c 100644 --- a/code/unix/linux_glimp.c +++ b/code/unix/linux_glimp.c @@ -1073,7 +1073,7 @@ void GLimp_Init( void ) // chipset specific configuration // strcpy( buf, glConfig.renderer_string ); - strlwr( buf ); + Q_strlwr( buf ); if ( Q_stricmp( lastValidRenderer->string, glConfig.renderer_string ) ) { @@ -1163,7 +1163,7 @@ void GLimp_EndFrame (void) #endif // don't flip if drawing to front buffer - if ( stricmp( r_drawBuffer->string, "GL_FRONT" ) != 0 ) + if ( Q_stricmp( r_drawBuffer->string, "GL_FRONT" ) != 0 ) { qglXSwapBuffers(dpy, win); } diff --git a/code/unix/unix_net.c b/code/unix/unix_net.c index ec2bbf4..e6757be 100644 --- a/code/unix/unix_net.c +++ b/code/unix/unix_net.c @@ -373,7 +373,7 @@ int NET_IPSocket (char *net_interface, int port) return 0; } - if (!net_interface || !net_interface[0] || !stricmp(net_interface, "localhost")) + if (!net_interface || !net_interface[0] || !Q_stricmp(net_interface, "localhost")) address.sin_addr.s_addr = INADDR_ANY; else Sys_StringToSockaddr (net_interface, (struct sockaddr *)&address); diff --git a/code/unix/unix_shared.c b/code/unix/unix_shared.c index 486cf40..dd58961 100644 --- a/code/unix/unix_shared.c +++ b/code/unix/unix_shared.c @@ -45,14 +45,6 @@ void Sys_Mkdir( const char *path ) mkdir (path, 0777); } -char *strlwr (char *s) -{ - while (*s) { - *s = tolower(*s); - s++; - } -} - //============================================ /* Like glob_match, but match PATTERN against any final segment of TEXT. */ diff --git a/code/win32/win_filecode.cpp b/code/win32/win_filecode.cpp index a1cca35..30ee36b 100644 --- a/code/win32/win_filecode.cpp +++ b/code/win32/win_filecode.cpp @@ -70,7 +70,7 @@ int _buildFileList(const char* path, bool insert, bool buildList) if(insert || buildList) { // Regular file -- add it to the table - strlwr(full); + Q_strlwr(full); unsigned int code = crc32(0, (const byte *)full, strlen(full)); FileInfo info; @@ -286,7 +286,7 @@ int Sys_GetFileCode(const char* name) char* osname = FS_BuildOSPath(name); // Generate hash for file name - strlwr(osname); + Q_strlwr(osname); unsigned int code = crc32(0, (const byte *)osname, strlen(osname)); // Check if the file exists diff --git a/code/win32/win_glimp.cpp b/code/win32/win_glimp.cpp index b5ca5e4..8ae68b3 100644 --- a/code/win32/win_glimp.cpp +++ b/code/win32/win_glimp.cpp @@ -1529,7 +1529,7 @@ static qboolean GLW_LoadOpenGL() char buffer[1024]; qboolean cdsFullscreen; - strlwr( strcpy( buffer, OPENGL_DRIVER_NAME ) ); + Q_strlwr( strcpy( buffer, OPENGL_DRIVER_NAME ) ); // // load the driver and bind our function pointers to it @@ -1582,7 +1582,7 @@ void GLimp_EndFrame (void) // don't flip if drawing to front buffer - //if ( stricmp( r_drawBuffer->string, "GL_FRONT" ) != 0 ) + //if ( Q_stricmp( r_drawBuffer->string, "GL_FRONT" ) != 0 ) { SwapBuffers( glw_state.hDC ); } @@ -1663,7 +1663,7 @@ void GLimp_Init( void ) // chipset specific configuration // strcpy( buf, glConfig.renderer_string ); - strlwr( buf ); + Q_strlwr( buf ); // // NOTE: if changing cvars, do it within this block. This allows them @@ -1812,4 +1812,4 @@ void GLimp_LogComment( char *comment ) if ( glw_state.log_fp ) { fprintf( glw_state.log_fp, "%s", comment ); } -} \ No newline at end of file +} diff --git a/code/win32/win_glimp_console.cpp b/code/win32/win_glimp_console.cpp index 0c3dc0f..e7b75d0 100644 --- a/code/win32/win_glimp_console.cpp +++ b/code/win32/win_glimp_console.cpp @@ -126,7 +126,7 @@ static qboolean GLW_LoadOpenGL() { char buffer[1024]; - strlwr( strcpy( buffer, OPENGL_DRIVER_NAME ) ); + Q_strlwr( strcpy( buffer, OPENGL_DRIVER_NAME ) ); // // load the driver and bind our function pointers to it @@ -149,7 +149,7 @@ static qboolean GLW_LoadOpenGL() void GLimp_EndFrame (void) { // don't flip if drawing to front buffer -// if ( stricmp( r_drawBuffer->string, "GL_FRONT" ) != 0 ) +// if ( Q_stricmp( r_drawBuffer->string, "GL_FRONT" ) != 0 ) { } } diff --git a/code/win32/win_main_console.cpp b/code/win32/win_main_console.cpp index 7b6b122..808f2d3 100644 --- a/code/win32/win_main_console.cpp +++ b/code/win32/win_main_console.cpp @@ -199,7 +199,7 @@ void Sys_Log( const char *file, const void *buffer, int size, bool flush ) { FileInfo* cur = NULL; for (int f = 0; f < num_files; ++f) { - if (!stricmp(file, files[f].name)) + if (!Q_stricmp(file, files[f].name)) { cur = &files[f]; break;