mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-16 19:19:56 +00:00
Merge pull request #1779 from akortunov/coverity
Fix some code coverity issues
This commit is contained in:
commit
a0cae78cb2
11 changed files with 30 additions and 10 deletions
|
@ -158,7 +158,9 @@ namespace MWGui
|
|||
|
||||
getWidget(mCrosshair, "Crosshair");
|
||||
|
||||
LocalMapBase::init(mMinimap, mCompass, Settings::Manager::getInt("local map hud widget size", "Map"), Settings::Manager::getInt("local map cell distance", "Map"));
|
||||
int mapSize = std::max(1, Settings::Manager::getInt("local map hud widget size", "Map"));
|
||||
int cellDistance = std::max(1, Settings::Manager::getInt("local map cell distance", "Map"));
|
||||
LocalMapBase::init(mMinimap, mCompass, mapSize, cellDistance);
|
||||
|
||||
mMainWidget->eventMouseButtonClick += MyGUI::newDelegate(this, &HUD::onWorldClicked);
|
||||
mMainWidget->eventMouseMove += MyGUI::newDelegate(this, &HUD::onWorldMouseOver);
|
||||
|
|
|
@ -679,7 +679,9 @@ namespace MWGui
|
|||
mEventBoxLocal->eventMouseButtonPressed += MyGUI::newDelegate(this, &MapWindow::onDragStart);
|
||||
mEventBoxLocal->eventMouseButtonDoubleClick += MyGUI::newDelegate(this, &MapWindow::onMapDoubleClicked);
|
||||
|
||||
LocalMapBase::init(mLocalMap, mPlayerArrowLocal, Settings::Manager::getInt("local map widget size", "Map"), Settings::Manager::getInt("local map cell distance", "Map"));
|
||||
int mapSize = std::max(1, Settings::Manager::getInt("local map widget size", "Map"));
|
||||
int cellDistance = std::max(1, Settings::Manager::getInt("local map cell distance", "Map"));
|
||||
LocalMapBase::init(mLocalMap, mPlayerArrowLocal, mapSize, cellDistance);
|
||||
|
||||
mGlobalMap->setVisible(mGlobal);
|
||||
mLocalMap->setVisible(!mGlobal);
|
||||
|
|
|
@ -240,6 +240,10 @@ namespace MWScript
|
|||
char type = declarations.getType (iter->first);
|
||||
int index2 = declarations.getIndex (iter->first);
|
||||
|
||||
// silently ignore locals that don't exist anymore
|
||||
if (type == ' ' || index2 == -1)
|
||||
continue;
|
||||
|
||||
try
|
||||
{
|
||||
switch (type)
|
||||
|
@ -247,8 +251,6 @@ namespace MWScript
|
|||
case 's': mShorts.at (index2) = iter->second.getInteger(); break;
|
||||
case 'l': mLongs.at (index2) = iter->second.getInteger(); break;
|
||||
case 'f': mFloats.at (index2) = iter->second.getFloat(); break;
|
||||
|
||||
// silently ignore locals that don't exist anymore
|
||||
}
|
||||
}
|
||||
catch (...)
|
||||
|
|
|
@ -387,7 +387,7 @@ private:
|
|||
OpenAL_SoundStream::OpenAL_SoundStream(ALuint src, DecoderPtr decoder)
|
||||
: mSource(src), mCurrentBufIdx(0), mFormat(AL_NONE), mSampleRate(0)
|
||||
, mBufferSize(0), mFrameSize(0), mSilence(0), mDecoder(std::move(decoder))
|
||||
, mLoudnessAnalyzer(nullptr)
|
||||
, mLoudnessAnalyzer(nullptr), mIsFinished(true)
|
||||
{
|
||||
mBuffers.fill(0);
|
||||
}
|
||||
|
|
|
@ -1179,8 +1179,8 @@ namespace MWWorld
|
|||
}
|
||||
else
|
||||
{
|
||||
bool currCellActive = mWorldScene->isCellActive(*currCell);
|
||||
bool newCellActive = mWorldScene->isCellActive(*newCell);
|
||||
bool currCellActive = currCell && mWorldScene->isCellActive(*currCell);
|
||||
bool newCellActive = newCell && mWorldScene->isCellActive(*newCell);
|
||||
if (!currCellActive && newCellActive)
|
||||
{
|
||||
newPtr = currCell->moveTo(ptr, newCell);
|
||||
|
|
|
@ -83,7 +83,12 @@ struct Land
|
|||
struct LandData
|
||||
{
|
||||
LandData()
|
||||
: mDataLoaded(0)
|
||||
: mHeightOffset(0)
|
||||
, mMinHeight(0)
|
||||
, mMaxHeight(0)
|
||||
, mUnk1(0)
|
||||
, mUnk2(0)
|
||||
, mDataLoaded(0)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -36,7 +36,10 @@ struct Pathgrid
|
|||
Point& operator=(const float[3]);
|
||||
Point(const float[3]);
|
||||
Point();
|
||||
Point(int x, int y, int z) : mX(x), mY(y), mZ(z) {}
|
||||
Point(int x, int y, int z)
|
||||
: mX(x), mY(y), mZ(z)
|
||||
, mAutogenerated(0), mConnectionNum(0), mUnknown(0)
|
||||
{}
|
||||
}; // 16 bytes
|
||||
|
||||
struct Edge // path grid edge
|
||||
|
|
|
@ -34,7 +34,9 @@ namespace ESM
|
|||
|
||||
ESM::AnimationState mAnimationState;
|
||||
|
||||
ObjectState() : mHasCustomState(true), mVersion(0)
|
||||
ObjectState()
|
||||
: mHasLocals(0), mEnabled(0), mCount(0)
|
||||
, mFlags(0), mHasCustomState(true), mVersion(0)
|
||||
{}
|
||||
|
||||
/// @note Does not load the CellRef ID, it should already be loaded before calling this method
|
||||
|
|
|
@ -24,6 +24,8 @@ namespace ESMTerrain
|
|||
};
|
||||
|
||||
LandObject::LandObject()
|
||||
: mLand(nullptr)
|
||||
, mLoadFlags(0)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -61,6 +61,7 @@ QuadTreeNode::QuadTreeNode(QuadTreeNode* parent, ChildDirection direction, float
|
|||
, mValidBounds(false)
|
||||
, mSize(size)
|
||||
, mCenter(center)
|
||||
, mViewDataMap(nullptr)
|
||||
{
|
||||
for (unsigned int i=0; i<4; ++i)
|
||||
mNeighbours[i] = 0;
|
||||
|
|
|
@ -8,6 +8,7 @@ namespace Gui
|
|||
WindowCaption::WindowCaption()
|
||||
: mLeft(NULL)
|
||||
, mRight(NULL)
|
||||
, mClient(NULL)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue