From b7b48e81fff4571297f6f9f8a99835d9bbbd7b70 Mon Sep 17 00:00:00 2001 From: Shaun Roe <Shaun.Roe@cern.ch> Date: Tue, 4 Oct 2016 14:55:21 +0200 Subject: [PATCH] fix coverity 17136 (VP1Gui-00-08-14) * fix coverity 17136 17136 09/07/2014 (Medium) Uninitialized pointer field :/graphics/VP1/VP1Gui/src/VP1Gui.cxx in function "Imp" * tag as VP1Gui-00-08-14 2016-09-09 Shaun Roe * Fix Coverity: 16179 09/07/2014 (Medium) Function address comparison :/graphics/VP1/VP1Gui/src/VP1EventDisplayEditor.cxx in function "getEventDetailsLabel" 16915 09/07/2014 (Medium) Uninitialized pointer field :/graphics/VP1/VP1Gui/src/VP1EventDisplaySceneView.cxx in function "VP1EventDisplaySceneView" 17114 09/07/2014 (Medium) Uninitialized pointer field :/graphics/VP1/VP1Gui/src/VP1IncomingMessageDialog.cxx in function "Imp" 17003 09/07/2014 (Medium) Uninitialized scalar field :/graphics/VP1/VP1Gui/src/VP1TabManager.cxx in function "Imp" 16381 09/07/2014 (Medium) Unchecked dynamic_cast :/graphics/VP1/VP1Gui/src/VP1TabManager.cxx in function "launchStereoEditorCurrentTab" *tag as VP1Gui-00-08-13 --- graphics/VP1/VP1Gui/src/VP1AvailEvents.cxx | 3 ++- .../VP1/VP1Gui/src/VP1EventDisplayEditor.cxx | 2 +- .../VP1/VP1Gui/src/VP1EventDisplaySceneView.cxx | 3 ++- graphics/VP1/VP1Gui/src/VP1Gui.cxx | 16 +++++++++++----- .../VP1/VP1Gui/src/VP1IncomingMessageDialog.cxx | 8 +++++++- graphics/VP1/VP1Gui/src/VP1TabManager.cxx | 12 ++++++------ 6 files changed, 29 insertions(+), 15 deletions(-) diff --git a/graphics/VP1/VP1Gui/src/VP1AvailEvents.cxx b/graphics/VP1/VP1Gui/src/VP1AvailEvents.cxx index 4b2ed835fb41..7e1df96619ba 100644 --- a/graphics/VP1/VP1Gui/src/VP1AvailEvents.cxx +++ b/graphics/VP1/VP1Gui/src/VP1AvailEvents.cxx @@ -52,7 +52,8 @@ public: } EventID & operator= (const EventID & o ) - { + { + if (&o == this) return *this; eventNumber = o.eventNumber; runNumber = o.runNumber; return *this; diff --git a/graphics/VP1/VP1Gui/src/VP1EventDisplayEditor.cxx b/graphics/VP1/VP1Gui/src/VP1EventDisplayEditor.cxx index 1070d758a1f2..46a46fb9cafe 100644 --- a/graphics/VP1/VP1Gui/src/VP1EventDisplayEditor.cxx +++ b/graphics/VP1/VP1Gui/src/VP1EventDisplayEditor.cxx @@ -371,7 +371,7 @@ QString VP1EventDisplayEditor::getEventDetailsLabel() QString evtstr = "Run: "+QString::number(_runNumber)+"\n" + "Event: "+QString::number(_eventNumber)+"\n" - + QString(time>0 ? QDateTime::fromTime_t(_eventTimestamp).toString(Qt::ISODate).replace('T',' ')+ " CEST" : ""); + + QString(QDateTime::fromTime_t(_eventTimestamp).toString(Qt::ISODate).replace('T',' ')+ " CEST" ); //VP1Msg::messageVerbose(evtstr); diff --git a/graphics/VP1/VP1Gui/src/VP1EventDisplaySceneView.cxx b/graphics/VP1/VP1Gui/src/VP1EventDisplaySceneView.cxx index 7097451c93b9..c71cd98ed988 100644 --- a/graphics/VP1/VP1Gui/src/VP1EventDisplaySceneView.cxx +++ b/graphics/VP1/VP1Gui/src/VP1EventDisplaySceneView.cxx @@ -37,9 +37,10 @@ void GraphicsView::wheelEvent(QWheelEvent *e) } VP1EventDisplaySceneView::VP1EventDisplaySceneView(const QString &name, bool preview, QWidget *parent) -: QFrame(parent) +: QFrame(parent),_frame(nullptr),_line(nullptr) { _preview = preview; + setFrameStyle(Sunken | StyledPanel); diff --git a/graphics/VP1/VP1Gui/src/VP1Gui.cxx b/graphics/VP1/VP1Gui/src/VP1Gui.cxx index b68737bb2160..ee9f174560f3 100644 --- a/graphics/VP1/VP1Gui/src/VP1Gui.cxx +++ b/graphics/VP1/VP1Gui/src/VP1Gui.cxx @@ -25,14 +25,20 @@ //____________________________________________________________________ class VP1Gui::Imp { public: - Imp() : the_scheduler(0) {} + Imp() : the_scheduler(nullptr), sg(nullptr), detstore(nullptr), + svclocator(nullptr), toolSvc(nullptr), + initialvp1files{}, + initialCruiseSeconds{}, + localFileCacheLimit{}{ + //nop + } VP1ExecutionScheduler * the_scheduler; //We hold the arguments here until init is called: - StoreGateSvc* sg; - StoreGateSvc* detstore; - ISvcLocator* svclocator; - IToolSvc*toolSvc; + StoreGateSvc * sg; + StoreGateSvc * detstore; + ISvcLocator * svclocator; + IToolSvc * toolSvc; QStringList initialvp1files; QString initialCruiseMode; unsigned initialCruiseSeconds; diff --git a/graphics/VP1/VP1Gui/src/VP1IncomingMessageDialog.cxx b/graphics/VP1/VP1Gui/src/VP1IncomingMessageDialog.cxx index 3b0b2eec8ac7..9387ce6f557b 100644 --- a/graphics/VP1/VP1Gui/src/VP1IncomingMessageDialog.cxx +++ b/graphics/VP1/VP1Gui/src/VP1IncomingMessageDialog.cxx @@ -23,7 +23,13 @@ //____________________________________________________________________ class VP1IncomingMessageDialog::Imp { public: - Imp(const VP1ExternalRequest& r) : request(r) {} + Imp(const VP1ExternalRequest& r) : tabmanager{}, channelmanager{}, requestqueue{},request(r), + lcdNumber_pending{}, lcdNumber_pendingsender{}, lcdNumber_pendingexactsame{}, + blockallmessages{}, pushButton_allclear{}, pushButton_senderclear{}, + pushButton_messageclear{}, messages_blockedsenders{}, messages_blockedexactmessages{} + { + //nop + } VP1TabManager* tabmanager; VP1ChannelManager* channelmanager; QQueue<VP1ExternalRequest>* requestqueue; diff --git a/graphics/VP1/VP1Gui/src/VP1TabManager.cxx b/graphics/VP1/VP1Gui/src/VP1TabManager.cxx index d765693ed935..9254081b5c90 100644 --- a/graphics/VP1/VP1Gui/src/VP1TabManager.cxx +++ b/graphics/VP1/VP1Gui/src/VP1TabManager.cxx @@ -53,7 +53,9 @@ class VP1TabManager::Imp { public: //Constructor, tabwidget & channel manager: Imp(VP1TabManager*tm,VP1TabWidget* tw, VP1ChannelManager* cm) - : tabmanager(tm), tabwidget(tw),channelmanager(cm),selecteddockwidget(0), + : tabmanager(tm), tabwidget(tw),channelmanager(cm), + dontEmitVisibilityChanges{}, + selecteddockwidget(0), fullscreen_dockwidget(0),fullscreen_channelwidget(0), fullscreen_tabindex(-1),fullscreen_tab(0),tabcruisemode(false) {} @@ -130,12 +132,10 @@ VP1TabManager::~VP1TabManager(){ //___________________________________________________________________________________ -void VP1TabManager::launchStereoEditorCurrentTab() -{ +void VP1TabManager::launchStereoEditorCurrentTab(){ VP1Msg::messageVerbose("VP1TabManager::launchStereoEditorCurrentTab()"); - - if (dynamic_cast<IVP13DStandardChannelWidget*>(selectedChannelWidget()) ) { - IVP13DStandardChannelWidget* channel = dynamic_cast<IVP13DStandardChannelWidget*>(selectedChannelWidget()); + IVP13DStandardChannelWidget* channel = dynamic_cast<IVP13DStandardChannelWidget*>(selectedChannelWidget()); + if (channel ) { channel->launchStereoEditor(); } } -- GitLab