Skip to content

Commit 82bfa36

Browse files
tamlin-mikeXottab-DUTY
authored andcommitted
Replace POSIX function names with ISO C++ conformant underscore-prepended names (strupr, strlwr, stricmp, strcmpi, unlink, itoa).
1 parent 3ea5183 commit 82bfa36

File tree

132 files changed

+297
-297
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

132 files changed

+297
-297
lines changed

src/Layers/xrRender/Blender_Recorder_R2.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ void CBlender_Compile::r_Pass(LPCSTR _vs, LPCSTR _ps, bool bFog, BOOL bZtest, BO
4040
ctable.merge(&vs->constants);
4141

4242
// Last Stage - disable
43-
if (0 == stricmp(_ps, "null"))
43+
if (0 == _stricmp(_ps, "null"))
4444
{
4545
RS.SetTSS(0, D3DTSS_COLOROP, D3DTOP_DISABLE);
4646
RS.SetTSS(0, D3DTSS_ALPHAOP, D3DTOP_DISABLE);

src/Layers/xrRender/FHierrarhyVisual.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ void FHierrarhyVisual::Load(const char* N, IReader* data, u32 dwFlags)
7171
xr_strcpy(short_name, N);
7272
if (strext(short_name))
7373
*strext(short_name) = 0;
74-
strconcat(sizeof(name_load), name_load, short_name, ":", itoa(count, num, 10));
74+
strconcat(sizeof(name_load), name_load, short_name, ":", _itoa(count, num, 10));
7575
children.push_back((dxRender_Visual*)GlobalEnv.Render->model_CreateChild(name_load, O));
7676
O->close();
7777
O = OBJ->open_chunk(count);

src/Layers/xrRender/HW.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,7 @@ struct _uniq_mode
590590
{
591591
_uniq_mode(LPCSTR v) : _val(v) {}
592592
LPCSTR _val;
593-
bool operator()(LPCSTR _other) { return !stricmp(_val, _other); }
593+
bool operator()(LPCSTR _other) { return !_stricmp(_val, _other); }
594594
};
595595

596596
#ifndef _EDITOR

src/Layers/xrRender/ModelPool.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ dxRender_Visual* CModelPool::Create(const char* name, IReader* data)
220220
string_path low_name;
221221
VERIFY(xr_strlen(name) < sizeof(low_name));
222222
xr_strcpy(low_name, name);
223-
strlwr(low_name);
223+
_strlwr(low_name);
224224
if (strext(low_name))
225225
*strext(low_name) = 0;
226226
// Msg ("-CREATE %s",low_name);
@@ -266,7 +266,7 @@ dxRender_Visual* CModelPool::CreateChild(LPCSTR name, IReader* data)
266266
string256 low_name;
267267
VERIFY(xr_strlen(name) < 256);
268268
xr_strcpy(low_name, name);
269-
strlwr(low_name);
269+
_strlwr(low_name);
270270
if (strext(low_name))
271271
*strext(low_name) = 0;
272272

src/Layers/xrRender/PSLibrary.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ bool CPSLibrary::Load2()
155155
#endif
156156

157157
xr_sprintf(_path, sizeof(_path), "%s%s", p_path, p_name);
158-
if (0 == stricmp(p_ext, ".pe"))
158+
if (0 == _stricmp(p_ext, ".pe"))
159159
{
160160
PS::CPEDef* def = new PS::CPEDef();
161161
def->m_Name = _path;
@@ -164,7 +164,7 @@ bool CPSLibrary::Load2()
164164
else
165165
xr_delete(def);
166166
}
167-
else if (0 == stricmp(p_ext, ".pg"))
167+
else if (0 == _stricmp(p_ext, ".pg"))
168168
{
169169
PS::CPGDef* def = new PS::CPGDef();
170170
def->m_Name = _path;

src/Layers/xrRender/ResourceManager.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ void fix_texture_name(LPSTR fn);
2121
void fix_texture_name(LPSTR fn)
2222
{
2323
LPSTR _ext = strext(fn);
24-
if( _ext &&
25-
(0==stricmp(_ext,".tga") ||
26-
0==stricmp(_ext,".dds") ||
27-
0==stricmp(_ext,".bmp") ||
28-
0==stricmp(_ext,".ogm") ) )
24+
if (_ext &&
25+
(0==_stricmp(_ext, ".tga") ||
26+
0==_stricmp(_ext, ".dds") ||
27+
0==_stricmp(_ext, ".bmp") ||
28+
0==_stricmp(_ext, ".ogm")))
2929
*_ext = 0;
3030
}
3131
*/
@@ -120,7 +120,7 @@ void CResourceManager::_ParseList(sh_list& dest, LPCSTR names)
120120
{
121121
// flush
122122
N.push_back(0);
123-
strlwr(N.begin());
123+
_strlwr(N.begin());
124124

125125
fix_texture_name(N.begin());
126126
//. andy if (strext(N.begin())) *strext(N.begin())=0;
@@ -137,7 +137,7 @@ void CResourceManager::_ParseList(sh_list& dest, LPCSTR names)
137137
{
138138
// flush
139139
N.push_back(0);
140-
strlwr(N.begin());
140+
_strlwr(N.begin());
141141

142142
fix_texture_name(N.begin());
143143
//. andy if (strext(N.begin())) *strext(N.begin())=0;

src/Layers/xrRender/ResourceManager_Resources.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ SVS* CResourceManager::_CreateVS(LPCSTR _name)
180180
SVS* _vs = new SVS();
181181
_vs->dwFlags |= xr_resource_flagged::RF_REGISTERED;
182182
m_vs.insert(std::make_pair(_vs->set_name(name), _vs));
183-
if (0 == stricmp(_name, "null"))
183+
if (0 == _stricmp(_name, "null"))
184184
{
185185
_vs->vs = NULL;
186186
return _vs;
@@ -266,7 +266,7 @@ SPS* CResourceManager::_CreatePS(LPCSTR name)
266266
SPS* _ps = new SPS();
267267
_ps->dwFlags |= xr_resource_flagged::RF_REGISTERED;
268268
m_ps.insert(std::make_pair(_ps->set_name(name), _ps));
269-
if (0 == stricmp(name, "null"))
269+
if (0 == _stricmp(name, "null"))
270270
{
271271
_ps->ps = NULL;
272272
return _ps;
@@ -558,7 +558,7 @@ void CResourceManager::DBG_VerifyTextures()
558558
CMatrix* CResourceManager::_CreateMatrix(LPCSTR Name)
559559
{
560560
R_ASSERT(Name && Name[0]);
561-
if (0 == stricmp(Name, "$null"))
561+
if (0 == _stricmp(Name, "$null"))
562562
return NULL;
563563

564564
LPSTR N = LPSTR(Name);
@@ -596,7 +596,7 @@ void CResourceManager::ED_UpdateMatrix(LPCSTR Name, CMatrix* data)
596596
CConstant* CResourceManager::_CreateConstant(LPCSTR Name)
597597
{
598598
R_ASSERT(Name && Name[0]);
599-
if (0 == stricmp(Name, "$null"))
599+
if (0 == _stricmp(Name, "$null"))
600600
return NULL;
601601

602602
LPSTR N = LPSTR(Name);
@@ -784,7 +784,7 @@ SVS* CResourceManager::_CreateVS(LPCSTR _name)
784784
SVS* _vs = new SVS();
785785
_vs->dwFlags |= xr_resource_flagged::RF_REGISTERED;
786786
m_vs.insert(mk_pair(_vs->set_name(name), _vs));
787-
if (0 == stricmp(_name, "null"))
787+
if (0 == _stricmp(_name, "null"))
788788
{
789789
_vs->vs = NULL;
790790
return _vs;
@@ -906,7 +906,7 @@ SPS* CResourceManager::_CreatePS(LPCSTR name)
906906
SPS* _ps = new SPS();
907907
_ps->dwFlags |= xr_resource_flagged::RF_REGISTERED;
908908
m_ps.insert(mk_pair(_ps->set_name(name), _ps));
909-
if (0 == stricmp(name, "null"))
909+
if (0 == _stricmp(name, "null"))
910910
{
911911
_ps->ps = NULL;
912912
return _ps;

src/Layers/xrRender/SH_Texture.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ void CTexture::Load()
158158

159159
flags.bUser = false;
160160
flags.MemoryUsage = 0;
161-
if (0 == stricmp(*cName, "$null"))
161+
if (0 == _stricmp(*cName, "$null"))
162162
return;
163163
if (0 != strstr(*cName, "$user$"))
164164
{
@@ -245,7 +245,7 @@ void CTexture::Load()
245245

246246
flags.seqCycles = FALSE;
247247
_fs->r_string(buffer, sizeof(buffer));
248-
if (0 == stricmp(buffer, "cycled"))
248+
if (0 == _stricmp(buffer, "cycled"))
249249
{
250250
flags.seqCycles = TRUE;
251251
_fs->r_string(buffer, sizeof(buffer));

src/Layers/xrRender/ShaderResourceTraits.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ inline T* CResourceManager::CreateShader(const char* name)
9494

9595
sh->dwFlags |= xr_resource_flagged::RF_REGISTERED;
9696
sh_map.insert(std::make_pair(sh->set_name(name), sh));
97-
if (0 == stricmp(name, "null"))
97+
if (0 == _stricmp(name, "null"))
9898
{
9999
sh->sh = NULL;
100100
return sh;

src/Layers/xrRender/SkeletonAnimated.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ u16 CKinematicsAnimated::LL_PartID(LPCSTR B)
175175
CPartDef& P = (*m_Partition)[id];
176176
if (0 == P.Name)
177177
continue;
178-
if (0 == stricmp(B, *P.Name))
178+
if (0 == _stricmp(B, *P.Name))
179179
return id;
180180
}
181181
return BI_NONE;

src/Layers/xrRender/SkeletonCustom.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ void CKinematics::Load(const char* N, IReader* data, u32 dwFlags)
237237
// Bone
238238
u16 ID = u16(bones->size());
239239
data->r_stringZ(buf, sizeof(buf));
240-
strlwr(buf);
240+
_strlwr(buf);
241241
CBoneData* pBone = CreateBoneData(ID);
242242
pBone->name = shared_str(buf);
243243
pBone->child_faces.resize(children.size());
@@ -247,7 +247,7 @@ void CKinematics::Load(const char* N, IReader* data, u32 dwFlags)
247247

248248
// It's parent
249249
data->r_stringZ(buf, sizeof(buf));
250-
strlwr(buf);
250+
_strlwr(buf);
251251
L_parents.push_back(buf);
252252

253253
data->r(&pBone->obb, sizeof(Fobb));

src/Layers/xrRender/Texture.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
void fix_texture_name(LPSTR fn)
1414
{
1515
LPSTR _ext = strext(fn);
16-
if (_ext && (!stricmp(_ext, ".tga") || !stricmp(_ext, ".dds") ||
17-
!stricmp(_ext, ".bmp") || !stricmp(_ext, ".ogm")))
16+
if (_ext && (!_stricmp(_ext, ".tga") || !_stricmp(_ext, ".dds") ||
17+
!_stricmp(_ext, ".bmp") || !_stricmp(_ext, ".ogm")))
1818
{
1919
*_ext = 0;
2020
}
@@ -367,7 +367,7 @@ ID3DBaseTexture* CRender::texture_load(LPCSTR fRName, u32& ret_msize)
367367
}
368368
_DDS_2D:
369369
{
370-
strlwr(fn);
370+
_strlwr(fn);
371371
// Load SYS-MEM-surface, bound to device restrictions
372372
ID3DTexture2D* T_sysmem;
373373
HRESULT const result =
@@ -380,7 +380,7 @@ ID3DBaseTexture* CRender::texture_load(LPCSTR fRName, u32& ret_msize)
380380
Msg("! Can't load texture '%s'", fn);
381381
string_path temp;
382382
R_ASSERT(FS.exist(temp, "$game_textures$", "ed\\ed_not_existing_texture", ".dds"));
383-
strlwr(temp);
383+
_strlwr(temp);
384384
R_ASSERT(xr_strcmp(temp, fn));
385385
xr_strcpy(fn, temp);
386386
goto _DDS;

src/Layers/xrRender/TextureDescrManager.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ class cl_dt_scaler : public R_constant_setup
1717
void fix_texture_thm_name(LPSTR fn)
1818
{
1919
LPSTR _ext = strext(fn);
20-
if (_ext && (!stricmp(_ext, ".tga") || !stricmp(_ext, ".thm") || !stricmp(_ext, ".dds") ||
21-
!stricmp(_ext, ".bmp") || !stricmp(_ext, ".ogm")))
20+
if (_ext && (!_stricmp(_ext, ".tga") || !_stricmp(_ext, ".thm") || !_stricmp(_ext, ".dds") ||
21+
!_stricmp(_ext, ".bmp") || !_stricmp(_ext, ".ogm")))
2222
{
2323
*_ext = 0;
2424
}

src/Layers/xrRender/blenders/Blender.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ void CBlender_DESC::Setup(LPCSTR N)
1616
VERIFY(xr_strlen(N) < 128);
1717
VERIFY(0 == strchr(N, '.'));
1818
xr_strcpy(cName, N);
19-
strlwr(cName);
19+
_strlwr(cName);
2020

2121
xr_strcpy(cComputer, Core.CompName); // Computer
2222
#ifndef _EDITOR

src/Layers/xrRender/blenders/Blender_Palette.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
//////////////////////////////////////////////////////////////////////
77
#include "blender_clsid.h"
8-
IC bool p_sort(IBlender* A, IBlender* B) { return stricmp(A->getComment(), B->getComment()) < 0; }
8+
IC bool p_sort(IBlender* A, IBlender* B) { return _stricmp(A->getComment(), B->getComment()) < 0; }
99
#ifdef __BORLANDC__
1010
#define TYPES_EQUAL(A, B) (typeid(A) == typeid(B))
1111
#else

src/Layers/xrRender/blenders/Blender_Recorder.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,13 +205,13 @@ void CBlender_Compile::PassEnd()
205205
void CBlender_Compile::PassSET_PS(LPCSTR name)
206206
{
207207
xr_strcpy(pass_ps, name);
208-
strlwr(pass_ps);
208+
_strlwr(pass_ps);
209209
}
210210

211211
void CBlender_Compile::PassSET_VS(LPCSTR name)
212212
{
213213
xr_strcpy(pass_vs, name);
214-
strlwr(pass_vs);
214+
_strlwr(pass_vs);
215215
}
216216

217217
void CBlender_Compile::PassSET_ZB(BOOL bZTest, BOOL bZWrite, BOOL bInvertZTest)

src/Layers/xrRenderDX10/Blender_Recorder_R3.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ void CBlender_Compile::r_Pass(LPCSTR _vs, LPCSTR _gs, LPCSTR _ps, bool bFog, BOO
203203
ctable.merge(&gs->constants);
204204

205205
// Last Stage - disable
206-
if (0 == stricmp(_ps, "null"))
206+
if (0 == _stricmp(_ps, "null"))
207207
{
208208
RS.SetTSS(0, D3DTSS_COLOROP, D3DTOP_DISABLE);
209209
RS.SetTSS(0, D3DTSS_ALPHAOP, D3DTOP_DISABLE);

src/Layers/xrRenderDX10/dx10HW.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -758,7 +758,7 @@ struct _uniq_mode
758758
{
759759
_uniq_mode(LPCSTR v) : _val(v) {}
760760
LPCSTR _val;
761-
bool operator()(LPCSTR _other) { return !stricmp(_val, _other); }
761+
bool operator()(LPCSTR _other) { return !_stricmp(_val, _other); }
762762
};
763763

764764
#ifndef _EDITOR

src/Layers/xrRenderDX10/dx10ResourceManager_Resources.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ SVS* CResourceManager::_CreateVS(LPCSTR _name)
142142
m_vs.insert(std::make_pair(_vs->set_name(name), _vs));
143143
//_vs->vs = NULL;
144144
//_vs->signature = NULL;
145-
if (0 == stricmp(_name, "null"))
145+
if (0 == _stricmp(_name, "null"))
146146
{
147147
return _vs;
148148
}
@@ -265,7 +265,7 @@ SPS* CResourceManager::_CreatePS(LPCSTR _name)
265265
SPS* _ps = new SPS();
266266
_ps->dwFlags |= xr_resource_flagged::RF_REGISTERED;
267267
m_ps.insert(std::make_pair(_ps->set_name(name), _ps));
268-
if (0 == stricmp(_name, "null"))
268+
if (0 == _stricmp(_name, "null"))
269269
{
270270
_ps->ps = NULL;
271271
return _ps;
@@ -370,7 +370,7 @@ SGS* CResourceManager::_CreateGS(LPCSTR name)
370370
SGS* _gs = new SGS();
371371
_gs->dwFlags |= xr_resource_flagged::RF_REGISTERED;
372372
m_gs.insert(std::make_pair(_gs->set_name(name), _gs));
373-
if (0 == stricmp(name, "null"))
373+
if (0 == _stricmp(name, "null"))
374374
{
375375
_gs->gs = NULL;
376376
return _gs;
@@ -687,7 +687,7 @@ void CResourceManager::DBG_VerifyTextures()
687687
CMatrix* CResourceManager::_CreateMatrix(LPCSTR Name)
688688
{
689689
R_ASSERT(Name && Name[0]);
690-
if (0 == stricmp(Name, "$null"))
690+
if (0 == _stricmp(Name, "$null"))
691691
return NULL;
692692

693693
LPSTR N = LPSTR(Name);
@@ -725,7 +725,7 @@ void CResourceManager::ED_UpdateMatrix(LPCSTR Name, CMatrix* data)
725725
CConstant* CResourceManager::_CreateConstant(LPCSTR Name)
726726
{
727727
R_ASSERT(Name && Name[0]);
728-
if (0 == stricmp(Name, "$null"))
728+
if (0 == _stricmp(Name, "$null"))
729729
return NULL;
730730

731731
LPSTR N = LPSTR(Name);

src/Layers/xrRenderDX10/dx10SH_Texture.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ void CTexture::Load()
375375

376376
flags.bUser = false;
377377
flags.MemoryUsage = 0;
378-
if (0 == stricmp(*cName, "$null"))
378+
if (0 == _stricmp(*cName, "$null"))
379379
return;
380380
if (0 != strstr(*cName, "$user$"))
381381
{
@@ -498,7 +498,7 @@ void CTexture::Load()
498498

499499
flags.seqCycles = FALSE;
500500
_fs->r_string(buffer, sizeof(buffer));
501-
if (0 == stricmp(buffer, "cycled"))
501+
if (0 == _stricmp(buffer, "cycled"))
502502
{
503503
flags.seqCycles = TRUE;
504504
_fs->r_string(buffer, sizeof(buffer));

src/Layers/xrRenderDX10/dx10Texture.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
void fix_texture_name(LPSTR fn)
1212
{
1313
LPSTR _ext = strext(fn);
14-
if (_ext && (!stricmp(_ext, ".tga") || !stricmp(_ext, ".dds") || !stricmp(_ext, ".bmp") ||
15-
!stricmp(_ext, ".ogm")))
14+
if (_ext && (!_stricmp(_ext, ".tga") || !_stricmp(_ext, ".dds") || !_stricmp(_ext, ".bmp") ||
15+
!_stricmp(_ext, ".ogm")))
1616
{
1717
*_ext = 0;
1818
}

src/Layers/xrRenderPC_R1/Blender_LaEmB.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ void CBlender_LaEmB::Compile(CBlender_Compile& C)
4242
{
4343
IBlender::Compile(C);
4444

45-
BOOL bConstant = (0 != stricmp(oT2_const, "$null"));
45+
BOOL bConstant = (0 != _stricmp(oT2_const, "$null"));
4646
if (C.bEditor)
4747
{
4848
if (bConstant)

src/Layers/xrRenderPC_R4/CSCompiler.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ void CSCompiler::end()
179179

180180
void CSCompiler::compile(const char* name)
181181
{
182-
if (0 == stricmp(name, "null"))
182+
if (0 == _stricmp(name, "null"))
183183
{
184184
m_cs = 0;
185185
return;

src/editors/ActorEditor/BonePart.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ void __fastcall TfrmBonePart::ebLoadFromClick(TObject* Sender)
282282
CInifile::SectCIt e = S.Data.end();
283283
for (; it != e; ++it)
284284
{
285-
if (0 != stricmp(it->first.c_str(), "partition_name"))
285+
if (0 != _stricmp(it->first.c_str(), "partition_name"))
286286
{
287287
FHelper.AppendObject(T[i], it->first.c_str(), false, true);
288288
}

0 commit comments

Comments
 (0)