Fix uninitialized variables

pull/593/head
Andrei Kortunov 4 years ago
parent b96929f3fc
commit 124a33d8a3

@ -56,7 +56,9 @@ void CSMWorld::PotionRefIdAdapter::setData (const RefIdColumn *column, RefIdData
CSMWorld::IngredientColumns::IngredientColumns (const InventoryColumns& columns) CSMWorld::IngredientColumns::IngredientColumns (const InventoryColumns& columns)
: InventoryColumns (columns) {} : InventoryColumns (columns)
, mEffects(nullptr)
{}
CSMWorld::IngredientRefIdAdapter::IngredientRefIdAdapter (const IngredientColumns& columns) CSMWorld::IngredientRefIdAdapter::IngredientRefIdAdapter (const IngredientColumns& columns)
: InventoryRefIdAdapter<ESM::Ingredient> (UniversalId::Type_Ingredient, columns), : InventoryRefIdAdapter<ESM::Ingredient> (UniversalId::Type_Ingredient, columns),
@ -585,7 +587,13 @@ void CSMWorld::DoorRefIdAdapter::setData (const RefIdColumn *column, RefIdData&
} }
CSMWorld::LightColumns::LightColumns (const InventoryColumns& columns) CSMWorld::LightColumns::LightColumns (const InventoryColumns& columns)
: InventoryColumns (columns) {} : InventoryColumns (columns)
, mTime(nullptr)
, mRadius(nullptr)
, mColor(nullptr)
, mSound(nullptr)
, mEmitterType(nullptr)
{}
CSMWorld::LightRefIdAdapter::LightRefIdAdapter (const LightColumns& columns) CSMWorld::LightRefIdAdapter::LightRefIdAdapter (const LightColumns& columns)
: InventoryRefIdAdapter<ESM::Light> (UniversalId::Type_Light, columns), mColumns (columns) : InventoryRefIdAdapter<ESM::Light> (UniversalId::Type_Light, columns), mColumns (columns)
@ -1454,7 +1462,15 @@ int CSMWorld::CreatureMiscRefIdAdapter::getNestedRowsCount(const RefIdColumn *co
} }
CSMWorld::WeaponColumns::WeaponColumns (const EnchantableColumns& columns) CSMWorld::WeaponColumns::WeaponColumns (const EnchantableColumns& columns)
: EnchantableColumns (columns) {} : EnchantableColumns (columns)
, mType(nullptr)
, mHealth(nullptr)
, mSpeed(nullptr)
, mReach(nullptr)
, mChop{nullptr}
, mSlash{nullptr}
, mThrust{nullptr}
{}
CSMWorld::WeaponRefIdAdapter::WeaponRefIdAdapter (const WeaponColumns& columns) CSMWorld::WeaponRefIdAdapter::WeaponRefIdAdapter (const WeaponColumns& columns)
: EnchantableRefIdAdapter<ESM::Weapon> (UniversalId::Type_Weapon, columns), mColumns (columns) : EnchantableRefIdAdapter<ESM::Weapon> (UniversalId::Type_Weapon, columns), mColumns (columns)

@ -178,7 +178,11 @@ namespace CSMWorld
const RefIdColumn *mName; const RefIdColumn *mName;
const RefIdColumn *mScript; const RefIdColumn *mScript;
NameColumns (const ModelColumns& base) : ModelColumns (base) {} NameColumns (const ModelColumns& base)
: ModelColumns (base)
, mName(nullptr)
, mScript(nullptr)
{}
}; };
/// \brief Adapter for IDs with names (all but levelled lists and statics) /// \brief Adapter for IDs with names (all but levelled lists and statics)
@ -247,7 +251,12 @@ namespace CSMWorld
const RefIdColumn *mWeight; const RefIdColumn *mWeight;
const RefIdColumn *mValue; const RefIdColumn *mValue;
InventoryColumns (const NameColumns& base) : NameColumns (base) {} InventoryColumns (const NameColumns& base)
: NameColumns (base)
, mIcon(nullptr)
, mWeight(nullptr)
, mValue(nullptr)
{}
}; };
/// \brief Adapter for IDs that can go into an inventory /// \brief Adapter for IDs that can go into an inventory
@ -405,7 +414,11 @@ namespace CSMWorld
const RefIdColumn *mEnchantment; const RefIdColumn *mEnchantment;
const RefIdColumn *mEnchantmentPoints; const RefIdColumn *mEnchantmentPoints;
EnchantableColumns (const InventoryColumns& base) : InventoryColumns (base) {} EnchantableColumns (const InventoryColumns& base)
: InventoryColumns (base)
, mEnchantment(nullptr)
, mEnchantmentPoints(nullptr)
{}
}; };
/// \brief Adapter for enchantable IDs /// \brief Adapter for enchantable IDs
@ -474,7 +487,11 @@ namespace CSMWorld
const RefIdColumn *mQuality; const RefIdColumn *mQuality;
const RefIdColumn *mUses; const RefIdColumn *mUses;
ToolColumns (const InventoryColumns& base) : InventoryColumns (base) {} ToolColumns (const InventoryColumns& base)
: InventoryColumns (base)
, mQuality(nullptr)
, mUses(nullptr)
{}
}; };
/// \brief Adapter for tools with limited uses IDs (lockpick, repair, probes) /// \brief Adapter for tools with limited uses IDs (lockpick, repair, probes)
@ -549,7 +566,17 @@ namespace CSMWorld
const RefIdColumn *mAiPackages; const RefIdColumn *mAiPackages;
std::map<const RefIdColumn *, unsigned int> mServices; std::map<const RefIdColumn *, unsigned int> mServices;
ActorColumns (const NameColumns& base) : NameColumns (base) {} ActorColumns (const NameColumns& base)
: NameColumns (base)
, mHello(nullptr)
, mFlee(nullptr)
, mFight(nullptr)
, mAlarm(nullptr)
, mInventory(nullptr)
, mSpells(nullptr)
, mDestinations(nullptr)
, mAiPackages(nullptr)
{}
}; };
/// \brief Adapter for actor IDs (handles common AI functionality) /// \brief Adapter for actor IDs (handles common AI functionality)
@ -2054,7 +2081,11 @@ namespace CSMWorld
const RefIdColumn *mLevList; const RefIdColumn *mLevList;
const RefIdColumn *mNestedListLevList; const RefIdColumn *mNestedListLevList;
LevListColumns (const BaseColumns& base) : BaseColumns (base) {} LevListColumns (const BaseColumns& base)
: BaseColumns (base)
, mLevList(nullptr)
, mNestedListLevList(nullptr)
{}
}; };
template<typename RecordT> template<typename RecordT>

@ -815,6 +815,7 @@ namespace MWRender
RenderingManager::RayResult result; RenderingManager::RayResult result;
result.mHit = false; result.mHit = false;
result.mHitRefnum.mContentFile = -1; result.mHitRefnum.mContentFile = -1;
result.mHitRefnum.mIndex = -1;
result.mRatio = 0; result.mRatio = 0;
if (intersector->containsIntersections()) if (intersector->containsIntersections())
{ {

@ -42,6 +42,7 @@ void ESM::Header::load (ESMReader &esm)
MasterData m; MasterData m;
m.name = esm.getHString(); m.name = esm.getHString();
m.size = esm.getHNLong ("DATA"); m.size = esm.getHNLong ("DATA");
m.index = -1;
mMaster.push_back (m); mMaster.push_back (m);
} }

@ -13,6 +13,7 @@ namespace Misc
explicit FrameRateLimiter(std::chrono::duration<Rep, Ratio> maxFrameDuration, explicit FrameRateLimiter(std::chrono::duration<Rep, Ratio> maxFrameDuration,
std::chrono::steady_clock::time_point now = std::chrono::steady_clock::now()) std::chrono::steady_clock::time_point now = std::chrono::steady_clock::now())
: mMaxFrameDuration(std::chrono::duration_cast<std::chrono::steady_clock::duration>(maxFrameDuration)) : mMaxFrameDuration(std::chrono::duration_cast<std::chrono::steady_clock::duration>(maxFrameDuration))
, mLastFrameDuration(0)
, mLastMeasurement(now) , mLastMeasurement(now)
{} {}

@ -226,6 +226,7 @@ namespace Resource
, mAutoUseNormalMaps(false) , mAutoUseNormalMaps(false)
, mAutoUseSpecularMaps(false) , mAutoUseSpecularMaps(false)
, mApplyLightingToEnvMaps(false) , mApplyLightingToEnvMaps(false)
, mConvertAlphaTestToAlphaToCoverage(false)
, mInstanceCache(new MultiObjectCache) , mInstanceCache(new MultiObjectCache)
, mSharedStateManager(new SharedStateManager) , mSharedStateManager(new SharedStateManager)
, mImageManager(imageManager) , mImageManager(imageManager)

@ -375,6 +375,7 @@ InputWrapper::InputWrapper(SDL_Window* window, osg::ref_ptr<osgViewer::Viewer> v
pack_evt.y = mMouseY = evt.motion.y; pack_evt.y = mMouseY = evt.motion.y;
pack_evt.xrel = evt.motion.xrel; pack_evt.xrel = evt.motion.xrel;
pack_evt.yrel = evt.motion.yrel; pack_evt.yrel = evt.motion.yrel;
pack_evt.type = SDL_MOUSEMOTION;
if (mFirstMouseMove) if (mFirstMouseMove)
{ {
// first event should be treated as non-relative, since there's no point of reference // first event should be treated as non-relative, since there's no point of reference
@ -387,6 +388,7 @@ InputWrapper::InputWrapper(SDL_Window* window, osg::ref_ptr<osgViewer::Viewer> v
{ {
mMouseZ += pack_evt.zrel = (evt.wheel.y * 120); mMouseZ += pack_evt.zrel = (evt.wheel.y * 120);
pack_evt.z = mMouseZ; pack_evt.z = mMouseZ;
pack_evt.type = SDL_MOUSEWHEEL;
} }
else else
{ {

@ -50,6 +50,7 @@ namespace Shader
, mAutoUseNormalMaps(false) , mAutoUseNormalMaps(false)
, mAutoUseSpecularMaps(false) , mAutoUseSpecularMaps(false)
, mApplyLightingToEnvMaps(false) , mApplyLightingToEnvMaps(false)
, mConvertAlphaTestToAlphaToCoverage(false)
, mTranslucentFramebuffer(false) , mTranslucentFramebuffer(false)
, mShaderManager(shaderManager) , mShaderManager(shaderManager)
, mImageManager(imageManager) , mImageManager(imageManager)

@ -50,8 +50,9 @@ VideoState::VideoState()
, av_sync_type(AV_SYNC_DEFAULT) , av_sync_type(AV_SYNC_DEFAULT)
, audio_st(nullptr) , audio_st(nullptr)
, video_st(nullptr), frame_last_pts(0.0) , video_st(nullptr), frame_last_pts(0.0)
, video_clock(0.0), sws_context(nullptr), pictq_size(0) , video_clock(0.0), sws_context(nullptr)
, pictq_rindex(0), pictq_windex(0) , sws_context_w(0), sws_context_h(0)
, pictq_size(0), pictq_rindex(0), pictq_windex(0)
, mSeekRequested(false) , mSeekRequested(false)
, mSeekPos(0) , mSeekPos(0)
, mVideoEnded(false) , mVideoEnded(false)

Loading…
Cancel
Save