Merge branch 'coverity49' into 'master'

Fix some Coverity warnings

See merge request OpenMW/openmw!3286
macos_ci_fix
Petr Mikheev 1 year ago
commit 0487bf95d1

@ -19,6 +19,7 @@ namespace ESSImport
item.mCount = contItem.mCount;
item.mRelativeEquipmentSlot = -1;
item.mLockLevel = 0;
item.mChargeIntRemainder = 0;
unsigned int itemCount = std::abs(item.mCount);
bool separateStacks = false;

@ -13,6 +13,7 @@
CSMWorld::TableMimeData::TableMimeData(UniversalId id, const CSMDoc::Document& document)
: mDocument(document)
, mTableOfDragStart(nullptr)
{
mUniversalId.push_back(id);
mObjectsFormats << QString::fromUtf8(("tabledata/" + id.getTypeName()).c_str());
@ -21,6 +22,7 @@ CSMWorld::TableMimeData::TableMimeData(UniversalId id, const CSMDoc::Document& d
CSMWorld::TableMimeData::TableMimeData(const std::vector<CSMWorld::UniversalId>& id, const CSMDoc::Document& document)
: mUniversalId(id)
, mDocument(document)
, mTableOfDragStart(nullptr)
{
for (std::vector<UniversalId>::iterator it(mUniversalId.begin()); it != mUniversalId.end(); ++it)
{

@ -155,7 +155,7 @@ bool MWDialogue::Filter::testActor(const ESM::DialInfo& info) const
if (!isCreature)
{
MWWorld::LiveCellRef<ESM::NPC>* npc = mActor.get<ESM::NPC>();
if (info.mData.mGender == (npc->mBase->mFlags & npc->mBase->Female ? 0 : 1))
if (info.mData.mGender == (npc->mBase->mFlags & ESM::NPC::Female) ? 0 : 1)
return false;
}

@ -960,7 +960,7 @@ namespace MWGui
ActiveTextFormats::iterator i = mActiveTextFormats.find(Font);
if (mNode)
if (mNode && i != mActiveTextFormats.end())
mNode->outOfDate(i->second->mRenderItem);
}
}

@ -931,7 +931,7 @@ namespace MWGui
= MWBase::Environment::get().getLuaManager()->getActorControls(player);
bool triedToMove = playerControls
&& (playerControls->mMovement != 0 || playerControls->mSideMovement != 0 || playerControls->mJump);
if (triedToMove && playerCls.getEncumbrance(player) > playerCls.getCapacity(player))
if (mMessageBoxManager && triedToMove && playerCls.getEncumbrance(player) > playerCls.getCapacity(player))
{
const auto& msgboxs = mMessageBoxManager->getActiveMessageBoxes();
auto it

@ -26,6 +26,7 @@ namespace
activator.mModel = Misc::ResourceHelpers::meshPathForESM3(rec["model"].get<std::string_view>());
std::string_view scriptId = rec["mwscript"].get<std::string_view>();
activator.mScript = ESM::RefId::deserializeText(scriptId);
activator.mRecordFlags = 0;
return activator;
}
}

@ -40,6 +40,7 @@ namespace
armor.mData.mHealth = rec["health"];
armor.mData.mArmor = rec["baseArmor"];
armor.mData.mEnchant = std::round(rec["enchantCapacity"].get<float>() * 10);
armor.mRecordFlags = 0;
return armor;
}

@ -40,6 +40,7 @@ namespace
book.mData.mWeight = rec["weight"];
book.mData.mValue = rec["value"];
book.mData.mIsScroll = rec["isScroll"];
book.mRecordFlags = 0;
ESM::RefId skill = ESM::RefId::deserializeText(rec["skill"].get<std::string_view>());

@ -32,6 +32,7 @@ namespace
clothing.mEnchant = ESM::RefId::deserializeText(enchantId);
clothing.mData.mWeight = rec["weight"];
clothing.mData.mValue = rec["value"];
clothing.mRecordFlags = 0;
int clothingType = rec["type"].get<int>();
if (clothingType >= 0 && clothingType <= ESM::Clothing::Amulet)
clothing.mData.mType = clothingType;

@ -56,6 +56,7 @@ namespace MWLua
effect.mAttribute = rec.mData.mAttributes[i];
effect.mRange = ESM::RT_Self;
effect.mArea = 0;
effect.mDuration = 0;
res[i + 1] = effect;
}
return res;

@ -31,6 +31,7 @@ namespace
misc.mScript = ESM::RefId::deserializeText(scriptId);
misc.mData.mWeight = rec["weight"];
misc.mData.mValue = rec["value"];
misc.mRecordFlags = 0;
return misc;
}
}

@ -30,6 +30,7 @@ namespace
potion.mScript = ESM::RefId::deserializeText(scriptId);
potion.mData.mWeight = rec["weight"];
potion.mData.mValue = rec["value"];
potion.mRecordFlags = 0;
sol::table effectsTable = rec["effects"];
size_t numEffects = effectsTable.size();
potion.mEffects.mList.resize(numEffects);

@ -32,6 +32,7 @@ namespace
std::string_view scriptId = rec["mwscript"].get<std::string_view>();
weapon.mScript = ESM::RefId::deserializeText(scriptId);
weapon.mData.mFlags = 0;
weapon.mRecordFlags = 0;
if (rec["isMagical"])
weapon.mData.mFlags |= ESM::Weapon::Magical;
if (rec["isSilver"])

@ -291,6 +291,7 @@ void MWMechanics::Alchemy::addPotion(const std::string& name)
newRecord.mData.mValue = mValue;
newRecord.mData.mAutoCalc = 0;
newRecord.mRecordFlags = 0;
newRecord.mName = name;

@ -69,6 +69,7 @@ namespace MWMechanics
enchantment.mData.mFlags = 0;
enchantment.mData.mType = mCastStyle;
enchantment.mData.mCost = getBaseCastCost();
enchantment.mRecordFlags = 0;
store.remove(mSoulGemPtr, 1);

@ -29,7 +29,7 @@ namespace ESM
float getMaxHeight() const { return mMaxHeight; }
int getLandSize() const { return mLandSize; }
int mLoadFlags;
int mLoadFlags = 0;
private:
float mMinHeight = 0.f;

@ -505,7 +505,7 @@ namespace Nif
if (flags & BSVertexDesc::VertexAttribute::Eye_Data)
{
throw Nif::Exception("Unhandled Eye Data in BSTriShape: ", nif->getFile().getFilename());
nif->read(mEyeData);
// nif->read(mEyeData);
}
}

Loading…
Cancel
Save