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;

0 commit comments

Comments
 (0)