Skip to content

Commit 67804ad

Browse files
tamlin-mikeXottab-DUTY
authored andcommitted
Compile-time refactoring.
Replace POSIX function names with ISO C++ conformant underscore-prepended names (strupr, strlwr, stricmp, strcmpi, unlink, itoa). Xottab_DUTY: This is cherry-pick from commits: tamlin-mike@bcb0051 tamlin-mike@86699fe
1 parent 922e892 commit 67804ad

File tree

6 files changed

+21
-21
lines changed

6 files changed

+21
-21
lines changed

src/Layers/xrRenderGL/Blender_Recorder_GL.cpp

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

7878
// Last Stage - disable
79-
if (0==stricmp(_ps,"null")) {
79+
if (0==_stricmp(_ps,"null")) {
8080
RS.SetTSS (0,D3DTSS_COLOROP,D3DTOP_DISABLE);
8181
RS.SetTSS (0,D3DTSS_ALPHAOP,D3DTOP_DISABLE);
8282
}

src/Layers/xrRenderGL/glHW.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ struct _uniq_mode
274274
{
275275
_uniq_mode(LPCSTR v):_val(v){}
276276
LPCSTR _val;
277-
bool operator() (LPCSTR _other) {return !stricmp(_val,_other);}
277+
bool operator() (LPCSTR _other) {return !_stricmp(_val,_other);}
278278
};
279279

280280
#ifndef _EDITOR

src/Layers/xrRenderGL/glSH_Texture.cpp

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

144144
flags.bUser = false;
145145
flags.MemoryUsage = 0;
146-
if (0 == stricmp(*cName, "$null")) return;
146+
if (0 == _stricmp(*cName, "$null")) return;
147147
if (0 != strstr(*cName, "$user$")) {
148148
flags.bUser = true;
149149
return;
@@ -233,7 +233,7 @@ void CTexture::Load ()
233233

234234
flags.seqCycles = FALSE;
235235
_fs->r_string(buffer, sizeof(buffer));
236-
if (0 == stricmp(buffer, "cycled"))
236+
if (0 == _stricmp(buffer, "cycled"))
237237
{
238238
flags.seqCycles = TRUE;
239239
_fs->r_string(buffer, sizeof(buffer));

src/Layers/xrRenderPC_GL/glResourceManager_Resources.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ SVS* CResourceManager::_CreateVS (LPCSTR _name)
177177
m_vs.insert (std::make_pair(_vs->set_name(name),_vs));
178178
//_vs->vs = NULL;
179179
//_vs->signature = NULL;
180-
VERIFY(strcmpi(name, "null") != 0);
180+
VERIFY(_strcmpi(name, "null") != 0);
181181

182182
string_path shName;
183183
{
@@ -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-
VERIFY(strcmpi(name, "null") != 0);
269+
VERIFY(_strcmpi(name, "null") != 0);
270270

271271
string_path shName;
272272
const char* pchr = strchr(_name, '(');
@@ -345,7 +345,7 @@ SGS* CResourceManager::_CreateGS (LPCSTR name)
345345
SGS* _gs = new SGS ();
346346
_gs->dwFlags |= xr_resource_flagged::RF_REGISTERED;
347347
m_gs.insert (std::make_pair(_gs->set_name(name),_gs));
348-
if (0==stricmp(name,"null")) {
348+
if (0==_stricmp(name,"null")) {
349349
_gs->gs = NULL;
350350
return _gs;
351351
}
@@ -574,7 +574,7 @@ void CResourceManager::DBG_VerifyTextures ()
574574
CMatrix* CResourceManager::_CreateMatrix (LPCSTR Name)
575575
{
576576
R_ASSERT(Name && Name[0]);
577-
if (0==stricmp(Name,"$null")) return NULL;
577+
if (0==_stricmp(Name,"$null")) return NULL;
578578

579579
LPSTR N = LPSTR(Name);
580580
map_Matrix::iterator I = m_matrices.find (N);
@@ -608,7 +608,7 @@ void CResourceManager::ED_UpdateMatrix (LPCSTR Name, CMatrix* data)
608608
CConstant* CResourceManager::_CreateConstant (LPCSTR Name)
609609
{
610610
R_ASSERT(Name && Name[0]);
611-
if (0==stricmp(Name,"$null")) return NULL;
611+
if (0==_stricmp(Name,"$null")) return NULL;
612612

613613
LPSTR N = LPSTR(Name);
614614
map_Constant::iterator I = m_constants.find (N);

src/Layers/xrRenderPC_GL/glTexture.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ void fix_texture_name(LPSTR fn)
1010
{
1111
LPSTR _ext = strext(fn);
1212
if (_ext &&
13-
(0 == stricmp(_ext, ".tga") ||
14-
0 == stricmp(_ext, ".dds") ||
15-
0 == stricmp(_ext, ".bmp") ||
16-
0 == stricmp(_ext, ".ogm")))
13+
(0 == _stricmp(_ext, ".tga") ||
14+
0 == _stricmp(_ext, ".dds") ||
15+
0 == _stricmp(_ext, ".bmp") ||
16+
0 == _stricmp(_ext, ".ogm")))
1717
*_ext = 0;
1818
}
1919

@@ -154,7 +154,7 @@ GLuint CRender::texture_load(LPCSTR fRName, u32& ret_msize, GLenum& ret_desc)
154154
_DDS_3D:
155155
{
156156
// Check for LMAP and compress if needed
157-
strlwr(fn);
157+
_strlwr(fn);
158158

159159

160160
// Load SYS-MEM-surface, bound to device restrictions
@@ -191,7 +191,7 @@ GLuint CRender::texture_load(LPCSTR fRName, u32& ret_msize, GLenum& ret_desc)
191191
_DDS_2D:
192192
{
193193
// Check for LMAP and compress if needed
194-
strlwr(fn);
194+
_strlwr(fn);
195195

196196

197197
// Load SYS-MEM-surface, bound to device restrictions

src/Layers/xrRenderPC_GL/rgl.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ class CGlow : public IRender_Glow
2323
CGlow() : bActive(false) { }
2424
virtual void set_active (bool b) { bActive=b; }
2525
virtual bool get_active () { return bActive; }
26-
virtual void set_position (const Fvector& P) { }
27-
virtual void set_direction (const Fvector& D) { }
28-
virtual void set_radius (float R) { }
29-
virtual void set_texture (LPCSTR name) { }
30-
virtual void set_color (const Fcolor& C) { }
31-
virtual void set_color (float r, float g, float b) { }
26+
virtual void set_position (const Fvector& /*P*/) { }
27+
virtual void set_direction (const Fvector& /*D*/) { }
28+
virtual void set_radius (float /*R*/) { }
29+
virtual void set_texture (LPCSTR /*name*/) { }
30+
virtual void set_color (const Fcolor& /*C*/) { }
31+
virtual void set_color (float /*r*/, float /*g*/, float /*b*/) { }
3232
};
3333

3434
float r_dtex_range = 50.f;

0 commit comments

Comments
 (0)