From 43259e29c155f64c118a7004acb9ba415ac65937 Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Mon, 11 May 2020 15:46:44 -0500 Subject: [PATCH] uninitialized variables-util --- Engine/source/util/noise2d.cpp | 2 ++ Engine/source/util/sampler.cpp | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Engine/source/util/noise2d.cpp b/Engine/source/util/noise2d.cpp index 6c51dfc19..2e9d9870f 100644 --- a/Engine/source/util/noise2d.cpp +++ b/Engine/source/util/noise2d.cpp @@ -26,6 +26,8 @@ //-------------------------------------- Noise2D::Noise2D() { + dMemset(mPermutation, 0, sizeof(mPermutation)); + dMemset(mGradient, 0, sizeof(mGradient)); mSeed = 0; } diff --git a/Engine/source/util/sampler.cpp b/Engine/source/util/sampler.cpp index f4d051e1e..405a81800 100644 --- a/Engine/source/util/sampler.cpp +++ b/Engine/source/util/sampler.cpp @@ -118,9 +118,9 @@ class CSVSamplerBackend : public ISamplerBackend const char* mString; } mValue; - SampleRecord() {} + SampleRecord() : mKey(0), mSet(false), mType(TypeBool) { mValue.mBool = false; } SampleRecord( U32 key ) - : mKey( key ), mSet( false ) {} + : mKey( key ), mSet( false ), mType(TypeBool) { mValue.mBool = false; } void set( bool value ) {