Skip to content

Commit 276eb24

Browse files
tamlin-mikeXottab-DUTY
authored andcommitted
Compiler warnings removed.
1 parent 9380c4f commit 276eb24

File tree

12 files changed

+46
-34
lines changed

12 files changed

+46
-34
lines changed

src/Layers/xrRender/HOM.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class CHOM
5151
void Render_ZB();
5252
// void Debug ();
5353

54-
void occlude(Fbox2& space) {}
54+
void occlude(Fbox2& /*space*/) {}
5555
void Disable();
5656
void Enable();
5757

src/Layers/xrRender/LightTrack.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,9 @@ class CROS_impl : public IRender_ObjectSpecific
8282
virtual void force_mode(u32 mode) { MODE = mode; };
8383
virtual float get_luminocity()
8484
{
85-
float result = _max(approximate.x, _max(approximate.y, approximate.z));
86-
clamp(result, 0.f, 1.f);
87-
return (result);
85+
float result_ = _max(approximate.x, _max(approximate.y, approximate.z));
86+
clamp(result_, 0.f, 1.f);
87+
return (result_);
8888
};
8989
virtual float get_luminocity_hemi() { return get_hemi(); }
9090
virtual float* get_luminocity_hemi_cube() { return hemi_cube_smooth; }

src/Layers/xrRender/light.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ class light : public IRender_Light, public SpatialBase
113113
virtual void set_rotation(const Fvector& D, const Fvector& R);
114114
virtual void set_cone(float angle);
115115
virtual void set_range(float R);
116-
virtual void set_virtual_size(float R){};
116+
virtual void set_virtual_size(float /*R*/){};
117117
virtual void set_color(const Fcolor& C) { color.set(C); }
118118
virtual void set_color(float r, float g, float b) { color.set(r, g, b, 1); }
119119
virtual void set_texture(LPCSTR name);

src/Layers/xrRenderGL/glBufferUtils.cpp

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ void CreateIndexBuffer(GLuint* pBuffer, const void* pData, UINT DataSize, bool b
2424
return CreateBuffer(pBuffer, pData, DataSize, bImmutable, true);
2525
}
2626

27-
GLsizei VertexSizeList[] =
27+
const GLsizei VertexSizeList[] =
2828
{
2929
1, // D3DDECLTYPE_FLOAT1
3030
2, // D3DDECLTYPE_FLOAT2
@@ -45,7 +45,7 @@ GLsizei VertexSizeList[] =
4545
4 // D3DDECLTYPE_FLOAT16_4
4646
};
4747

48-
GLenum VertexTypeList[] =
48+
const GLenum VertexTypeList[] =
4949
{
5050
GL_FLOAT, // D3DDECLTYPE_FLOAT1
5151
GL_FLOAT, // D3DDECLTYPE_FLOAT2
@@ -66,7 +66,7 @@ GLenum VertexTypeList[] =
6666
GL_HALF_FLOAT // D3DDECLTYPE_FLOAT16_4
6767
};
6868

69-
GLboolean VertexNormalizedList[] =
69+
const GLboolean VertexNormalizedList[] =
7070
{
7171
GL_FALSE, // D3DDECLTYPE_FLOAT1
7272
GL_FALSE, // D3DDECLTYPE_FLOAT2
@@ -87,7 +87,7 @@ GLboolean VertexNormalizedList[] =
8787
GL_FALSE // D3DDECLTYPE_FLOAT16_4
8888
};
8989

90-
GLsizei VertexTypeSizeList[] =
90+
const GLsizei VertexTypeSizeList[] =
9191
{
9292
sizeof(GLfloat), // D3DDECLTYPE_FLOAT1
9393
sizeof(GLfloat), // D3DDECLTYPE_FLOAT2
@@ -108,22 +108,22 @@ GLsizei VertexTypeSizeList[] =
108108
sizeof(GLhalf) // D3DDECLTYPE_FLOAT16_4
109109
};
110110

111-
GLuint VertexUsageList[] =
111+
const GLuint VertexUsageList[] =
112112
{
113113
3, // D3DDECLUSAGE_POSITION
114-
-1, // D3DDECLUSAGE_BLENDWEIGHT
115-
-1, // D3DDECLUSAGE_BLENDINDICES
114+
~0u, // D3DDECLUSAGE_BLENDWEIGHT
115+
~0u, // D3DDECLUSAGE_BLENDINDICES
116116
5, // D3DDECLUSAGE_NORMAL
117-
-1, // D3DDECLUSAGE_PSIZE
117+
~0u, // D3DDECLUSAGE_PSIZE
118118
8, // D3DDECLUSAGE_TEXCOORD
119119
4, // D3DDECLUSAGE_TANGENT
120120
6, // D3DDECLUSAGE_BINORMAL
121-
-1, // D3DDECLUSAGE_TESSFACTOR
122-
-1, // D3DDECLUSAGE_POSITIONT
121+
~0u, // D3DDECLUSAGE_TESSFACTOR
122+
~0u, // D3DDECLUSAGE_POSITIONT
123123
0, // D3DDECLUSAGE_COLOR
124124
7, // D3DDECLUSAGE_FOG
125-
-1, // D3DDECLUSAGE_DEPTH
126-
-1, // D3DDECLUSAGE_SAMPLE
125+
~0u, // D3DDECLUSAGE_DEPTH
126+
~0u, // D3DDECLUSAGE_SAMPLE
127127
};
128128

129129
GLsizei GetDeclVertexSize(const D3DVERTEXELEMENT9* decl)
@@ -145,6 +145,7 @@ void ConvertVertexDeclaration(const D3DVERTEXELEMENT9* dxdecl, SDeclaration* dec
145145
{
146146
RCache.set_Format(decl);
147147

148+
// XXX: tamlin: use 'stride', or drop it.
148149
GLsizei stride = GetDeclVertexSize(dxdecl);
149150
for (int i = 0; i < MAXD3DDECLLENGTH; ++i)
150151
{
@@ -279,4 +280,4 @@ u32 GetDeclLength(const D3DVERTEXELEMENT9 *decl)
279280
return element - decl;
280281
}
281282

282-
};
283+
} // namespace glBufferUtils

src/Layers/xrRenderGL/glHW.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ void free_render_mode_list () {}
2323

2424
CHW HW;
2525

26-
void CALLBACK OnDebugCallback(GLenum source, GLenum type, GLuint id, GLenum severity,
27-
GLsizei length, const GLchar* message, const void* userParam)
26+
void CALLBACK OnDebugCallback(GLenum /*source*/, GLenum /*type*/, GLuint id, GLenum severity,
27+
GLsizei /*length*/, const GLchar* message, const void* /*userParam*/)
2828
{
2929
if (severity != GL_DEBUG_SEVERITY_NOTIFICATION)
3030
Log(message, id);

src/Layers/xrRenderGL/glR_Backend_Runtime.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,9 @@ ICF void CBackend::set_PS(GLuint _ps, LPCSTR _n)
7070
{
7171
if (ps != _ps)
7272
{
73+
#ifdef RBackend_PGO
7374
string_path name;
75+
#endif
7476
PGO(glGetObjectLabel(GL_PROGRAM, _ps, sizeof(name), nullptr, name));
7577
PGO(Msg("PGO:Pshader:%d,%s", _ps, _n ? _n : name));
7678
stat.ps++;
@@ -86,7 +88,9 @@ ICF void CBackend::set_GS(GLuint _gs, LPCSTR _n)
8688
{
8789
if (gs != _gs)
8890
{
91+
#ifdef RBackend_PGO
8992
string_path name;
93+
#endif
9094
PGO(glGetObjectLabel(GL_PROGRAM, _ps, sizeof(name), nullptr, name));
9195
PGO(Msg("PGO:Gshader:%d,%s", _ps, _n ? _n : name));
9296
// TODO: OGL: Get statistics for G Shader change
@@ -103,7 +107,9 @@ ICF void CBackend::set_VS(GLuint _vs, LPCSTR _n)
103107
{
104108
if (vs != _vs)
105109
{
110+
#ifdef RBackend_PGO
106111
string_path name;
112+
#endif
107113
PGO(glGetObjectLabel(GL_PROGRAM, _vs, sizeof(name), nullptr, name));
108114
PGO(Msg("PGO:Vshader:%d,%s", _vs, _n ? _n : name));
109115
stat.vs++;

src/Layers/xrRenderGL/glSH_RT.cpp

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,9 @@ void CRT::create (LPCSTR Name, u32 w, u32 h, D3DFORMAT f, u32 SampleCount )
3838
CHK_GL(glGetIntegerv(GL_MAX_FRAMEBUFFER_HEIGHT, &max_height));
3939

4040
// Check width-and-height of render target surface
41-
if (w>max_width) return;
42-
if (h>max_height) return;
41+
// XXX: While seemingly silly, assert w/h are positive?
42+
if (w>u32(max_width)) return;
43+
if (h>u32(max_height)) return;
4344

4445
RImplementation.Resources->Evict();
4546

@@ -58,23 +59,26 @@ void CRT::create (LPCSTR Name, u32 w, u32 h, D3DFORMAT f, u32 SampleCount )
5859
pZRT = pRT;
5960
}
6061

61-
void CRT::destroy ()
62+
void CRT::destroy()
6263
{
6364
if (pTexture._get()) {
6465
pTexture->surface_set(target, 0);
6566
pTexture = NULL;
6667
}
6768
CHK_GL(glDeleteTextures(1, &pRT));
6869
}
69-
void CRT::reset_begin ()
70+
71+
void CRT::reset_begin()
7072
{
7173
destroy ();
7274
}
73-
void CRT::reset_end ()
75+
76+
void CRT::reset_end()
7477
{
75-
create (*cName,dwWidth,dwHeight,fmt);
78+
create(*cName,dwWidth,dwHeight,fmt);
7679
}
77-
void resptrcode_crt::create(LPCSTR Name, u32 w, u32 h, D3DFORMAT f, u32 SampleCount)
80+
81+
void resptrcode_crt::create(LPCSTR Name, u32 w, u32 h, D3DFORMAT f, u32 /*SampleCount*/)
7882
{
79-
_set (RImplementation.Resources->_CreateRT(Name,w,h,f));
83+
_set(RImplementation.Resources->_CreateRT(Name,w,h,f));
8084
}

src/Layers/xrRenderPC_GL/gl_rendertarget.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ class CRenderTarget : public IRender_Target
328328
dbg_lines.back().P1 = P1;
329329
dbg_lines.back().color = c;
330330
}
331-
IC void dbg_addplane (Fplane& P0, u32 c) {
331+
IC void dbg_addplane(Fplane& P0, u32 /*c*/) {
332332
dbg_planes.push_back(P0);
333333
}
334334
#else

src/Layers/xrRenderPC_GL/gl_rendertarget_phase_combine.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,7 @@ void CRenderTarget::phase_combine ()
373373

374374
// Fill vertex buffer
375375
v_aa* pv = (v_aa*) RCache.Vertex.Lock (4,g_aa_AA->vb_stride,Offset);
376+
// XXX: tamlin: The following four lines are almost 300 columns wide! FIX!
376377
pv->p.set(EPS, float(_h+EPS), EPS,1.f); pv->uv0.set(p0.x, p1.y);pv->uv1.set(p0.x-ddw,p1.y-ddh);pv->uv2.set(p0.x+ddw,p1.y+ddh);pv->uv3.set(p0.x+ddw,p1.y-ddh);pv->uv4.set(p0.x-ddw,p1.y+ddh);pv->uv5.set(p0.x-ddw,p1.y,p1.y,p0.x+ddw);pv->uv6.set(p0.x,p1.y-ddh,p1.y+ddh,p0.x);pv++;
377378
pv->p.set(EPS, EPS, EPS,1.f); pv->uv0.set(p0.x, p0.y);pv->uv1.set(p0.x-ddw,p0.y-ddh);pv->uv2.set(p0.x+ddw,p0.y+ddh);pv->uv3.set(p0.x+ddw,p0.y-ddh);pv->uv4.set(p0.x-ddw,p0.y+ddh);pv->uv5.set(p0.x-ddw,p0.y,p0.y,p0.x+ddw);pv->uv6.set(p0.x,p0.y-ddh,p0.y+ddh,p0.x);pv++;
378379
pv->p.set(float(_w+EPS),float(_h+EPS), EPS,1.f); pv->uv0.set(p1.x, p1.y);pv->uv1.set(p1.x-ddw,p1.y-ddh);pv->uv2.set(p1.x+ddw,p1.y+ddh);pv->uv3.set(p1.x+ddw,p1.y-ddh);pv->uv4.set(p1.x-ddw,p1.y+ddh);pv->uv5.set(p1.x-ddw,p1.y,p1.y,p1.x+ddw);pv->uv6.set(p1.x,p1.y-ddh,p1.y+ddh,p1.x);pv++;

src/Layers/xrRenderPC_GL/rgl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ static class cl_sun_shafts_intensity : public R_constant_setup
9595

9696
static class cl_alpha_ref : public R_constant_setup
9797
{
98-
virtual void setup (R_constant* C)
98+
virtual void setup (R_constant* /*C*/)
9999
{
100100
// TODO: OGL: Implement AlphaRef.
101101
//StateManager.BindAlphaRef(C);

0 commit comments

Comments
 (0)