Skip to content

Commit e29df99

Browse files
committed
Fix warnings
1 parent 6e07f7e commit e29df99

File tree

2 files changed

+23
-27
lines changed

2 files changed

+23
-27
lines changed

src/Interface/Modules/Render/ES/systems/RenderTransBasicSys.cc

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,10 @@ class RenderBasicSysTrans :
8585
GLuint mSortedID;
8686

8787
SortedObject() :
88-
mName(""),
89-
mSortedID(NULL)
88+
mSortedID(0)
9089
{}
9190

92-
SortedObject(std::string name, GLuint ID) :
91+
SortedObject(const std::string& name, GLuint ID) :
9392
mName(name),
9493
mSortedID(ID)
9594
{}
@@ -203,7 +202,7 @@ class RenderBasicSysTrans :
203202
{
204203
return;
205204
}
206-
205+
207206
if (!srstate.front().state.get(RenderState::USE_TRANSPARENCY) &&
208207
!srstate.front().state.get(RenderState::USE_TRANSPARENT_EDGES) &&
209208
!srstate.front().state.get(RenderState::USE_TRANSPARENT_NODES))
@@ -248,14 +247,14 @@ class RenderBasicSysTrans :
248247
if (!indexed)
249248
{
250249
index = sortedObjects.size();
251-
sortedObjects.push_back(SortedObject(pass.front().ibo.name, NULL));
250+
sortedObjects.push_back(SortedObject(pass.front().ibo.name, 0));
252251
}
253252

254253
Core::Geometry::Vector diff = prevDir - dir;
255254
float distance = sqrtf(Core::Geometry::Dot(diff, diff));
256-
if (distance >= 1.23 || sortedObjects[index].mSortedID == NULL)
255+
if (distance >= 1.23 || sortedObjects[index].mSortedID == 0)
257256
{
258-
if (sortedObjects[index].mSortedID != NULL)
257+
if (sortedObjects[index].mSortedID != 0)
259258
{
260259
iboMan.front().instance->removeInMemoryIBO(sortedObjects[index].mSortedID);
261260
}
@@ -400,7 +399,7 @@ class RenderBasicSysTrans :
400399
bool depthMask = glIsEnabled(GL_DEPTH_WRITEMASK);
401400
bool cullFace = glIsEnabled(GL_CULL_FACE);
402401
bool blend = glIsEnabled(GL_BLEND);
403-
402+
404403
GL(glEnable(GL_DEPTH_TEST));
405404
GL(glDepthMask(GL_FALSE));
406405
GL(glDisable(GL_CULL_FACE));
@@ -429,7 +428,7 @@ class RenderBasicSysTrans :
429428
rlist.front().data->getBuffer(), rlist.front().data->getBufferSize());
430429

431430
CPM_BSERIALIZE_NS::BSerialize colorDeserialize(
432-
rlist.front().data->getBuffer(), rlist.front().data->getBufferSize());
431+
rlist.front().data->getBuffer(), rlist.front().data->getBufferSize());
433432

434433
int64_t posSize = 0;
435434
int64_t colorSize = 0;
@@ -520,7 +519,7 @@ class RenderBasicSysTrans :
520519
}
521520
}
522521

523-
522+
524523
if (!drawLines)
525524
{
526525
if (pass.front().renderState.mSortType == RenderState::TransparencySortType::CONTINUOUS_SORT)
@@ -541,7 +540,7 @@ class RenderBasicSysTrans :
541540
{
542541
GL(glDisable(GL_BLEND));
543542
}
544-
543+
545544
geom.front().attribs.unbind();
546545

547546
// Reapply the default state here -- only do this if static state is
@@ -566,4 +565,3 @@ const char* getSystemName_RenderBasicTransGeom()
566565

567566
} // namespace Render
568567
} // namespace SCIRun
569-

src/Interface/Modules/Render/ES/systems/RenderTransColorMapSys.cc

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -82,19 +82,18 @@ class RenderColorMapSysTrans :
8282
GLuint mSortedID;
8383

8484
SortedObject() :
85-
mName(""),
86-
mSortedID(NULL)
85+
mSortedID(0)
8786
{}
8887

89-
SortedObject(std::string name, GLuint ID) :
88+
SortedObject(const std::string& name, GLuint ID) :
9089
mName(name),
9190
mSortedID(ID)
9291
{}
9392
};
9493

9594
Core::Geometry::Vector prevDir = Core::Geometry::Vector(0.0);
9695
std::vector<SortedObject> sortedObjects;
97-
96+
9897
class DepthIndex {
9998
public:
10099
size_t mIndex;
@@ -117,7 +116,7 @@ class RenderColorMapSysTrans :
117116
};
118117

119118
GLuint sortObjects(const Core::Geometry::Vector& dir,
120-
const es::ComponentGroup<ren::IBO>& ibo,
119+
const es::ComponentGroup<ren::IBO>& ibo,
121120
const es::ComponentGroup<Core::Datatypes::GeometryObject::SpireSubPass>& pass,
122121
const es::ComponentGroup<ren::StaticIBOMan>& iboMan)
123122
{
@@ -169,7 +168,7 @@ class RenderColorMapSysTrans :
169168
result = iboMan.front().instance->addInMemoryIBO(sbuffer, pass.front().ibo.data->getBufferSize(), ibo.front().primMode, ibo.front().primType,
170169
numPrimitives, transIBOName);
171170
}
172-
171+
173172
return result;
174173
}
175174

@@ -210,12 +209,12 @@ class RenderColorMapSysTrans :
210209
}
211210

212211
bool drawLines = (ibo.front().primMode == Core::Datatypes::GeometryObject::SpireIBO::LINES);
213-
GLuint iboID = ibo.front().glid;
212+
GLuint iboID = ibo.front().glid;
214213

215214
Core::Geometry::Vector dir(camera.front().data.worldToView[0][2],
216215
camera.front().data.worldToView[1][2],
217216
camera.front().data.worldToView[2][2]);
218-
217+
219218
if (sortedObjects.size() <=0)
220219
{
221220
prevDir = dir;
@@ -246,14 +245,14 @@ class RenderColorMapSysTrans :
246245
if (!indexed)
247246
{
248247
index = sortedObjects.size();
249-
sortedObjects.push_back(SortedObject(pass.front().ibo.name, NULL));
248+
sortedObjects.push_back(SortedObject(pass.front().ibo.name, 0));
250249
}
251250

252251
Core::Geometry::Vector diff = prevDir - dir;
253252
float distance = sqrtf(Core::Geometry::Dot(diff, diff));
254-
if (distance >= 1.23 || sortedObjects[index].mSortedID == NULL)
253+
if (distance >= 1.23 || sortedObjects[index].mSortedID == 0)
255254
{
256-
if (sortedObjects[index].mSortedID != NULL)
255+
if (sortedObjects[index].mSortedID != 0)
257256
{
258257
iboMan.front().instance->removeInMemoryIBO(sortedObjects[index].mSortedID);
259258
}
@@ -407,11 +406,11 @@ class RenderColorMapSysTrans :
407406
for (const ren::MatUniform& unif : matUniforms) {unif.applyUniform();}
408407

409408
geom.front().attribs.bind();
410-
409+
411410
bool depthMask = glIsEnabled(GL_DEPTH_WRITEMASK);
412411
bool cullFace = glIsEnabled(GL_CULL_FACE);
413412
bool blend = glIsEnabled(GL_BLEND);
414-
413+
415414
GL(glEnable(GL_DEPTH_TEST));
416415
GL(glDepthMask(GL_FALSE));
417416
GL(glDisable(GL_CULL_FACE));
@@ -442,7 +441,7 @@ class RenderColorMapSysTrans :
442441
rlist.front().data->getBuffer(), rlist.front().data->getBufferSize());
443442

444443
CPM_BSERIALIZE_NS::BSerialize dataDeserialize(
445-
rlist.front().data->getBuffer(), rlist.front().data->getBufferSize());
444+
rlist.front().data->getBuffer(), rlist.front().data->getBufferSize());
446445

447446
int64_t posSize = 0;
448447
int64_t dataSize = 0;
@@ -574,4 +573,3 @@ const char* getSystemName_RenderColorMapTrans()
574573

575574
} // namespace Render
576575
} // namespace SCIRun
577-

0 commit comments

Comments
 (0)