Merge pull request #1486 from Azaezel/alpha41/uninitializedVars

uninitialized variable cleanups
This commit is contained in:
Brian Roberts 2025-05-26 19:55:47 -05:00 committed by GitHub
commit 3e7a2a8f91
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 13 additions and 9 deletions

View file

@ -87,7 +87,6 @@ const U32 DecalManager::smMaxIndices = 10000;
DecalManager *gDecalManager = NULL; DecalManager *gDecalManager = NULL;
IMPLEMENT_CONOBJECT(DecalManager); IMPLEMENT_CONOBJECT(DecalManager);
DECLARE_CATEGORY("UNLISTED");
ConsoleDoc( ConsoleDoc(
"@defgroup Decals\n" "@defgroup Decals\n"

View file

@ -12,7 +12,7 @@ namespace Con
String error; String error;
public: public:
EvalResult() {} EvalResult() { valid = false; error = ""; }
EvalResult(ConsoleValue pValue) EvalResult(ConsoleValue pValue)
{ {

View file

@ -41,7 +41,7 @@ public:
struct alignas(uintptr_t) DataBlock : public AlignedBufferAllocator<T> struct alignas(uintptr_t) DataBlock : public AlignedBufferAllocator<T>
{ {
DataBlock* mNext; DataBlock* mNext = NULL;
inline DataBlock* getEnd() inline DataBlock* getEnd()
{ {

View file

@ -179,8 +179,8 @@ class HashTable
public: public:
struct Pair struct Pair
{ {
Key key; Key key{};
Value value; Value value{};
Pair() {} Pair() {}
Pair(Key k,Value v) Pair(Key k,Value v)
: key(k), : key(k),

View file

@ -407,7 +407,7 @@ template<class T> inline void Vector<T>::insert(U32 index)
dMemmove(&mArray[index + 1], dMemmove(&mArray[index + 1],
&mArray[index], &mArray[index],
(mElementCount - index - 1) * sizeof(value_type)); dsize_t(mElementCount - index - 1) * sizeof(value_type));
constructInPlace(&mArray[index]); constructInPlace(&mArray[index]);
} }
@ -428,7 +428,7 @@ template<class T> inline void Vector<T>::erase(U32 index)
{ {
dMemmove(&mArray[index], dMemmove(&mArray[index],
&mArray[index + 1], &mArray[index + 1],
(mElementCount - index - 1) * sizeof(value_type)); dsize_t(mElementCount - index - 1) * sizeof(value_type));
} }
mElementCount--; mElementCount--;
@ -461,7 +461,7 @@ template<class T> inline void Vector<T>::erase(U32 index, U32 count)
dMemmove( &mArray[index], dMemmove( &mArray[index],
&mArray[index + count], &mArray[index + count],
(mElementCount - index - count) * sizeof(value_type)); dsize_t(mElementCount - index - count) * sizeof(value_type));
mElementCount -= count; mElementCount -= count;
} }

View file

@ -200,7 +200,7 @@ IESLoadHelper::load(const std::string& data, IESFileInfo& info)
info._anglesH.push_back(value); info._anglesH.push_back(value);
} }
info._candalaValues.reserve(info.anglesNumH * info.anglesNumV); info._candalaValues.reserve(size_t(info.anglesNumH * info.anglesNumV));
for (std::int32_t y = 0; y < info.anglesNumH; ++y) for (std::int32_t y = 0; y < info.anglesNumH; ++y)
{ {

View file

@ -299,6 +299,7 @@ struct RenderInst
/// Does a memset to clear the render instance. /// Does a memset to clear the render instance.
void clear(); void clear();
RenderInst() { clear(); }
}; };
struct ObjectRenderInst : public RenderInst struct ObjectRenderInst : public RenderInst
@ -327,6 +328,7 @@ struct ObjectRenderInst : public RenderInst
// Clear this instance. // Clear this instance.
void clear(); void clear();
ObjectRenderInst() { clear(); }
}; };
struct MeshRenderInst : public RenderInst struct MeshRenderInst : public RenderInst
@ -397,6 +399,7 @@ struct MeshRenderInst : public RenderInst
Vector<CustomShaderBindingData> mCustomShaderData; Vector<CustomShaderBindingData> mCustomShaderData;
void clear(); void clear();
MeshRenderInst() { clear(); };
}; };
enum ParticleSystemState enum ParticleSystemState
@ -455,6 +458,7 @@ struct ParticleRenderInst : public RenderInst
GFXTextureObject *diffuseTex; GFXTextureObject *diffuseTex;
void clear(); void clear();
ParticleRenderInst() { clear(); }
}; };
class GFXOcclusionQuery; class GFXOcclusionQuery;
@ -477,6 +481,7 @@ struct OccluderRenderInst : public RenderInst
bool isSphere; bool isSphere;
void clear(); void clear();
OccluderRenderInst() { clear(); }
}; };
#endif // _RENDERPASSMANAGER_H_ #endif // _RENDERPASSMANAGER_H_