Skip to content

Commit 3e7a2a8

Browse files
authored
Merge pull request #1486 from Azaezel/alpha41/uninitializedVars
uninitialized variable cleanups
2 parents deb17b1 + 2f19db7 commit 3e7a2a8

File tree

7 files changed

+13
-9
lines changed

7 files changed

+13
-9
lines changed

Engine/source/T3D/decal/decalManager.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ const U32 DecalManager::smMaxIndices = 10000;
8787
DecalManager *gDecalManager = NULL;
8888

8989
IMPLEMENT_CONOBJECT(DecalManager);
90-
DECLARE_CATEGORY("UNLISTED");
9190

9291
ConsoleDoc(
9392
"@defgroup Decals\n"

Engine/source/console/runtime.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ namespace Con
1212
String error;
1313

1414
public:
15-
EvalResult() {}
15+
EvalResult() { valid = false; error = ""; }
1616

1717
EvalResult(ConsoleValue pValue)
1818
{

Engine/source/core/dataChunker.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ template<class T> class BaseDataChunker
4141

4242
struct alignas(uintptr_t) DataBlock : public AlignedBufferAllocator<T>
4343
{
44-
DataBlock* mNext;
44+
DataBlock* mNext = NULL;
4545

4646
inline DataBlock* getEnd()
4747
{

Engine/source/core/util/tDictionary.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,8 @@ class HashTable
179179
public:
180180
struct Pair
181181
{
182-
Key key;
183-
Value value;
182+
Key key{};
183+
Value value{};
184184
Pair() {}
185185
Pair(Key k,Value v)
186186
: key(k),

Engine/source/core/util/tVector.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ template<class T> inline void Vector<T>::insert(U32 index)
407407

408408
dMemmove(&mArray[index + 1],
409409
&mArray[index],
410-
(mElementCount - index - 1) * sizeof(value_type));
410+
dsize_t(mElementCount - index - 1) * sizeof(value_type));
411411

412412
constructInPlace(&mArray[index]);
413413
}
@@ -428,7 +428,7 @@ template<class T> inline void Vector<T>::erase(U32 index)
428428
{
429429
dMemmove(&mArray[index],
430430
&mArray[index + 1],
431-
(mElementCount - index - 1) * sizeof(value_type));
431+
dsize_t(mElementCount - index - 1) * sizeof(value_type));
432432
}
433433

434434
mElementCount--;
@@ -461,7 +461,7 @@ template<class T> inline void Vector<T>::erase(U32 index, U32 count)
461461

462462
dMemmove( &mArray[index],
463463
&mArray[index + count],
464-
(mElementCount - index - count) * sizeof(value_type));
464+
dsize_t(mElementCount - index - count) * sizeof(value_type));
465465

466466
mElementCount -= count;
467467
}

Engine/source/gfx/bitmap/loaders/ies/ies_loader.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ IESLoadHelper::load(const std::string& data, IESFileInfo& info)
200200
info._anglesH.push_back(value);
201201
}
202202

203-
info._candalaValues.reserve(info.anglesNumH * info.anglesNumV);
203+
info._candalaValues.reserve(size_t(info.anglesNumH * info.anglesNumV));
204204

205205
for (std::int32_t y = 0; y < info.anglesNumH; ++y)
206206
{

Engine/source/renderInstance/renderPassManager.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,7 @@ struct RenderInst
299299

300300
/// Does a memset to clear the render instance.
301301
void clear();
302+
RenderInst() { clear(); }
302303
};
303304

304305
struct ObjectRenderInst : public RenderInst
@@ -327,6 +328,7 @@ struct ObjectRenderInst : public RenderInst
327328

328329
// Clear this instance.
329330
void clear();
331+
ObjectRenderInst() { clear(); }
330332
};
331333

332334
struct MeshRenderInst : public RenderInst
@@ -397,6 +399,7 @@ struct MeshRenderInst : public RenderInst
397399
Vector<CustomShaderBindingData> mCustomShaderData;
398400

399401
void clear();
402+
MeshRenderInst() { clear(); };
400403
};
401404

402405
enum ParticleSystemState
@@ -455,6 +458,7 @@ struct ParticleRenderInst : public RenderInst
455458
GFXTextureObject *diffuseTex;
456459

457460
void clear();
461+
ParticleRenderInst() { clear(); }
458462
};
459463

460464
class GFXOcclusionQuery;
@@ -477,6 +481,7 @@ struct OccluderRenderInst : public RenderInst
477481
bool isSphere;
478482

479483
void clear();
484+
OccluderRenderInst() { clear(); }
480485
};
481486

482487
#endif // _RENDERPASSMANAGER_H_

0 commit comments

Comments
 (0)