From 91fd96614658b3661bebbe6c1b41e52e989fbeeb Mon Sep 17 00:00:00 2001 From: Aesylwinn Date: Thu, 18 Aug 2016 12:42:35 -0400 Subject: [PATCH] Fix some issues detected by coverity for the editor. --- apps/opencs/model/prefs/modifiersetting.cpp | 1 + apps/opencs/model/prefs/shortcutsetting.cpp | 1 + apps/opencs/view/render/instancemode.cpp | 6 ++++-- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/opencs/model/prefs/modifiersetting.cpp b/apps/opencs/model/prefs/modifiersetting.cpp index d8bf84342..4f4fac248 100644 --- a/apps/opencs/model/prefs/modifiersetting.cpp +++ b/apps/opencs/model/prefs/modifiersetting.cpp @@ -15,6 +15,7 @@ namespace CSMPrefs ModifierSetting::ModifierSetting(Category* parent, Settings::Manager* values, QMutex* mutex, const std::string& key, const std::string& label) : Setting(parent, values, mutex, key, label) + , mButton(0) , mEditorActive(false) { } diff --git a/apps/opencs/model/prefs/shortcutsetting.cpp b/apps/opencs/model/prefs/shortcutsetting.cpp index 726566fdd..c56119deb 100644 --- a/apps/opencs/model/prefs/shortcutsetting.cpp +++ b/apps/opencs/model/prefs/shortcutsetting.cpp @@ -17,6 +17,7 @@ namespace CSMPrefs ShortcutSetting::ShortcutSetting(Category* parent, Settings::Manager* values, QMutex* mutex, const std::string& key, const std::string& label) : Setting(parent, values, mutex, key, label) + , mButton(0) , mEditorActive(false) , mEditorPos(0) { diff --git a/apps/opencs/view/render/instancemode.cpp b/apps/opencs/view/render/instancemode.cpp index 394e6772d..f5b15cb55 100644 --- a/apps/opencs/view/render/instancemode.cpp +++ b/apps/opencs/view/render/instancemode.cpp @@ -74,7 +74,9 @@ osg::Vec3f CSVRender::InstanceMode::getSelectionCenter(const std::vector 0) + center /= objectCount; return center; } @@ -92,7 +94,7 @@ osg::Vec3f CSVRender::InstanceMode::getScreenCoords(const osg::Vec3f& pos) CSVRender::InstanceMode::InstanceMode (WorldspaceWidget *worldspaceWidget, QWidget *parent) : EditMode (worldspaceWidget, QIcon (":placeholder"), Mask_Reference, "Instance editing", parent), mSubMode (0), mSubModeId ("move"), mSelectionMode (0), mDragMode (DragMode_None), - mDragAxis (-1), mLocked (false) + mDragAxis (-1), mLocked (false), mUnitScaleDist(1) { }