From b7011cae1f70044f0c62726b1a1733c3fbde30b8 Mon Sep 17 00:00:00 2001 From: sbh Date: Thu, 10 Apr 2014 18:07:40 +0400 Subject: [PATCH] Code analysis & compiller warnings removed: * XGUI_ViewWindow, XGUI_ViewPort uninitialized variables in constructor * PyConsole_EnhEditor signed/unsigned comparsion * XGUI_Module virtual destructor added --- src/PyConsole/PyConsole_EnhEditor.cxx | 2 +- src/XGUI/XGUI_Module.h | 2 ++ src/XGUI/XGUI_ViewPort.cpp | 11 ++++++++--- src/XGUI/XGUI_ViewWindow.cpp | 5 ++++- 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/src/PyConsole/PyConsole_EnhEditor.cxx b/src/PyConsole/PyConsole_EnhEditor.cxx index 2dd8207ab..d5c47dff3 100644 --- a/src/PyConsole/PyConsole_EnhEditor.cxx +++ b/src/PyConsole/PyConsole_EnhEditor.cxx @@ -342,7 +342,7 @@ void PyConsole_EnhEditor::extractCommon(const std::vector & matches, QS if (charIdx >= matches[0].size()) return; QChar ch = matches[0][charIdx]; - for (int j = 1; j < matches.size(); j++) + for (size_t j = 1; j < matches.size(); j++) if (charIdx >= matches[j].size() || matches[j][charIdx] != ch) return; result += ch; diff --git a/src/XGUI/XGUI_Module.h b/src/XGUI/XGUI_Module.h index 1860462e2..374e057ea 100644 --- a/src/XGUI/XGUI_Module.h +++ b/src/XGUI/XGUI_Module.h @@ -10,6 +10,8 @@ class XGUI_Module public: virtual void createFeatures() = 0; virtual void featureCreated(XGUI_Command*) = 0; + + virtual ~XGUI_Module() {}; }; //! This function must return a new module instance. diff --git a/src/XGUI/XGUI_ViewPort.cpp b/src/XGUI/XGUI_ViewPort.cpp index 4398cabaa..21552a55d 100644 --- a/src/XGUI/XGUI_ViewPort.cpp +++ b/src/XGUI/XGUI_ViewPort.cpp @@ -249,10 +249,15 @@ void OpenGLUtils_FrameBuffer::unbind() //************************************************************************ //************************************************************************ //************************************************************************ -XGUI_ViewPort::XGUI_ViewPort(XGUI_ViewWindow* theParent, const Handle(V3d_Viewer)& theViewer, +XGUI_ViewPort::XGUI_ViewPort(XGUI_ViewWindow* theParent, + const Handle(V3d_Viewer)& theViewer, V3d_TypeOfView theType) - : QWidget(theParent), myPaintersRedrawing(false), myScale(1.0), myIsAdvancedZoomingEnabled( - false) + : QWidget(theParent), + myPaintersRedrawing(false), + myScale(1.0), + myIsAdvancedZoomingEnabled(false), + myBgImgHeight(0), + myBgImgWidth(0) { setMouseTracking(true); setBackgroundRole(QPalette::NoRole); diff --git a/src/XGUI/XGUI_ViewWindow.cpp b/src/XGUI/XGUI_ViewWindow.cpp index f68ca95c3..fd8f1dc9e 100644 --- a/src/XGUI/XGUI_ViewWindow.cpp +++ b/src/XGUI/XGUI_ViewWindow.cpp @@ -133,7 +133,10 @@ XGUI_ViewWindow::XGUI_ViewWindow(XGUI_Viewer* theViewer, V3d_TypeOfView theType) myCurrPointType(XGUI::GRAVITY), myPrevPointType(XGUI::GRAVITY), myRotationPointSelection(false), - myClosable(true) + myClosable(true), + myStartX(0), myStartY(0), myCurrX(0), myCurrY(0), myCurScale(0.0), myCurSketch(0), + myDrawRect(false), myEnableDrawMode(false), myCursorIsHand(false), myEventStarted(false), + myLastState(NormalState), myOperation(NOTHING) { mySelectedPoint = gp_Pnt(0., 0., 0.); setFrameStyle(QFrame::Raised); -- 2.39.2