Fix some defects reported by Coverity CI

coverity_scan
scrawl 9 years ago
parent 89512af808
commit b0431833a1

@ -1,6 +1,6 @@
#include "messages.hpp" #include "messages.hpp"
CSMDoc::Message::Message() {} CSMDoc::Message::Message() : mSeverity(Severity_Default){}
CSMDoc::Message::Message (const CSMWorld::UniversalId& id, const std::string& message, CSMDoc::Message::Message (const CSMWorld::UniversalId& id, const std::string& message,
const std::string& hint, Severity severity) const std::string& hint, Severity severity)

@ -39,9 +39,6 @@ namespace CSMDoc
{ {
public: public:
// \deprecated Use CSMDoc::Message directly instead.
typedef CSMDoc::Message Message;
typedef std::vector<Message> Collection; typedef std::vector<Message> Collection;
typedef Collection::const_iterator Iterator; typedef Collection::const_iterator Iterator;

@ -2,7 +2,9 @@
#include "operation.hpp" #include "operation.hpp"
CSMDoc::OperationHolder::OperationHolder (Operation *operation) : mRunning (false) CSMDoc::OperationHolder::OperationHolder (Operation *operation)
: mOperation(NULL)
, mRunning (false)
{ {
if (operation) if (operation)
setOperation (operation); setOperation (operation);

@ -182,7 +182,7 @@ int CSMTools::ReportModel::countErrors() const
{ {
int count = 0; int count = 0;
for (std::vector<CSMDoc::Messages::Message>::const_iterator iter (mRows.begin()); for (std::vector<CSMDoc::Message>::const_iterator iter (mRows.begin());
iter!=mRows.end(); ++iter) iter!=mRows.end(); ++iter)
if (iter->mSeverity==CSMDoc::Message::Severity_Error || if (iter->mSeverity==CSMDoc::Message::Severity_Error ||
iter->mSeverity==CSMDoc::Message::Severity_SeriousError) iter->mSeverity==CSMDoc::Message::Severity_SeriousError)

@ -16,7 +16,7 @@ namespace CSMTools
{ {
Q_OBJECT Q_OBJECT
std::vector<CSMDoc::Messages::Message> mRows; std::vector<CSMDoc::Message> mRows;
// Fixed columns // Fixed columns
enum Columns enum Columns

@ -14,7 +14,7 @@
CSMWorld::ModifyCommand::ModifyCommand (QAbstractItemModel& model, const QModelIndex& index, CSMWorld::ModifyCommand::ModifyCommand (QAbstractItemModel& model, const QModelIndex& index,
const QVariant& new_, QUndoCommand* parent) const QVariant& new_, QUndoCommand* parent)
: QUndoCommand (parent), mModel (&model), mIndex (index), mNew (new_), mHasRecordState(false) : QUndoCommand (parent), mModel (&model), mIndex (index), mNew (new_), mHasRecordState(false), mOldRecordState(CSMWorld::RecordBase::State_BaseOnly)
{ {
if (QAbstractProxyModel *proxy = dynamic_cast<QAbstractProxyModel *> (&model)) if (QAbstractProxyModel *proxy = dynamic_cast<QAbstractProxyModel *> (&model))
{ {

@ -33,8 +33,9 @@
CSVRender::WorldspaceWidget::WorldspaceWidget (CSMDoc::Document& document, QWidget* parent) CSVRender::WorldspaceWidget::WorldspaceWidget (CSMDoc::Document& document, QWidget* parent)
: SceneWidget (document.getData().getResourceSystem(), parent), mSceneElements(0), mRun(0), mDocument(document), : SceneWidget (document.getData().getResourceSystem(), parent), mSceneElements(0), mRun(0), mDocument(document),
mInteractionMask (0), mEditMode (0), mLocked (false), mDragging (false), mInteractionMask (0), mEditMode (0), mLocked (false), mDragging (false), mDragX(0), mDragY(0), mDragFactor(0),
mToolTipPos (-1, -1) mDragWheelFactor(0), mDragShiftFactor(0),
mToolTipPos (-1, -1), mShowToolTips(false), mToolTipDelay(0)
{ {
setAcceptDrops(true); setAcceptDrops(true);

@ -231,7 +231,7 @@ void CSVWorld::Table::mouseDoubleClickEvent (QMouseEvent *event)
CSVWorld::Table::Table (const CSMWorld::UniversalId& id, CSVWorld::Table::Table (const CSMWorld::UniversalId& id,
bool createAndDelete, bool sorting, CSMDoc::Document& document) bool createAndDelete, bool sorting, CSMDoc::Document& document)
: DragRecordTable(document), mCreateAction (0), : DragRecordTable(document), mCreateAction (0),
mCloneAction(0),mRecordStatusDisplay (0) mCloneAction(0), mRecordStatusDisplay (0), mJumpToAddedRecord(false), mUnselectAfterJump(false)
{ {
mModel = &dynamic_cast<CSMWorld::IdTableBase&> (*mDocument.getData().getTableModel (id)); mModel = &dynamic_cast<CSMWorld::IdTableBase&> (*mDocument.getData().getTableModel (id));

@ -76,7 +76,7 @@ CSVWorld::TableBottomBox::TableBottomBox (const CreatorFactoryBase& creatorFacto
CSMDoc::Document& document, CSMDoc::Document& document,
const CSMWorld::UniversalId& id, const CSMWorld::UniversalId& id,
QWidget *parent) QWidget *parent)
: QWidget (parent), mShowStatusBar (false), mEditMode(EditMode_None), mHasPosition(false) : QWidget (parent), mShowStatusBar (false), mEditMode(EditMode_None), mHasPosition(false), mRow(0), mColumn(0)
{ {
for (int i=0; i<4; ++i) for (int i=0; i<4; ++i)
mStatusCount[i] = 0; mStatusCount[i] = 0;

@ -1556,7 +1556,7 @@ namespace MWMechanics
(target == getPlayer() && (target == getPlayer() &&
MWBase::Environment::get().getWorld()->getGlobalInt("pcknownwerewolf"))) MWBase::Environment::get().getWorld()->getGlobalInt("pcknownwerewolf")))
{ {
const ESM::GameSetting * iWerewolfFightMod = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().search("iWerewolfFightMod"); const ESM::GameSetting * iWerewolfFightMod = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("iWerewolfFightMod");
fight += iWerewolfFightMod->getInt(); fight += iWerewolfFightMod->getInt();
} }
} }

@ -433,7 +433,7 @@ namespace MWWorld
// Werewolf (BM) // Werewolf (BM)
gmst["fWereWolfRunMult"] = ESM::Variant(1.f); gmst["fWereWolfRunMult"] = ESM::Variant(1.f);
gmst["fWereWolfSilverWeaponDamageMult"] = ESM::Variant(1.f); gmst["fWereWolfSilverWeaponDamageMult"] = ESM::Variant(1.f);
gmst["iWerewolfFightMod"] = ESM::Variant(1);
std::map<std::string, ESM::Variant> globals; std::map<std::string, ESM::Variant> globals;
// vanilla Morrowind does not define dayspassed. // vanilla Morrowind does not define dayspassed.
@ -1745,6 +1745,8 @@ namespace MWWorld
{ {
cellid.mWorldspace = ref.mRef.getDestCell(); cellid.mWorldspace = ref.mRef.getDestCell();
cellid.mPaged = false; cellid.mPaged = false;
cellid.mIndex.mX = 0;
cellid.mIndex.mY = 0;
} }
else else
{ {

Loading…
Cancel
Save