Skip to content

Commit

Permalink
Merge pull request #1467 from damn1/coverityFix_uninit3
Browse files Browse the repository at this point in the history
Coverity fixes - initializations_3
  • Loading branch information
drdanz authored Nov 27, 2017
2 parents c4fa43b + d47c488 commit 2fae714
Show file tree
Hide file tree
Showing 12 changed files with 112 additions and 68 deletions.
10 changes: 8 additions & 2 deletions src/libYARP_manager/include/yarp/manager/kbase.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,17 @@ typedef std::vector<Node*>::iterator NodePVIterator;
class KnowledgeBase{

public:
KnowledgeBase(void) : mainApplication(NULL) {};
KnowledgeBase(void) :
modloader(YARP_NULLPTR),
apploader(YARP_NULLPTR),
resloader(YARP_NULLPTR),
mainApplication(YARP_NULLPTR)
{}

virtual ~KnowledgeBase() {
kbGraph.clear();
tmpGraph.clear();
};
}

bool createFrom(ModuleLoader* _mloader,
AppLoader* _apploader,
Expand Down
5 changes: 4 additions & 1 deletion src/libYARP_manager/src/application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ using namespace yarp::manager;
/**
* Class ModuleInterface
*/
ModuleInterface::ModuleInterface(Module* module)
ModuleInterface::ModuleInterface(Module* module) :
iRank(0),
waitStart(0.0),
waitStop(0.0)
{
if(!module)
return;
Expand Down
38 changes: 16 additions & 22 deletions src/yarpmanager/src-builder/arrow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,35 +57,29 @@ const qreal Pi = 3.14;



Arrow::Arrow(BuilderItem *startItem, BuilderItem *endItem,int id, Manager *safeManager,
bool isInApp,bool editingMode, BuilderItem *parent)
: BuilderItem(parent),textLbl("",this)
Arrow::Arrow(BuilderItem *startItem, BuilderItem *endItem,int _id, Manager *safeManager,
bool isInApp,bool editingMode, BuilderItem *parent) :
BuilderItem(parent),
manager(safeManager),
externalSelection(false),
editingMode(editingMode),
connected(false),
myStartItem(startItem),
myEndItem(endItem),
myColor(Qt::black),
textLbl("",this),
textWidth(0),
id(_id),
firstTime(true)
{
sigHandler = new ItemSignalHandler();
itemType = ConnectionItemType;
connected = false;
myStartItem = startItem;
myEndItem = endItem;
this->manager = safeManager;
nestedInApp = isInApp;
sigHandler = new ItemSignalHandler();
setFlag(ItemIsSelectable,true);
setFlag(ItemClipsToShape,false);
myColor = Qt::black;
this->id = id;
this->nestedInApp = isInApp;
this->editingMode = editingMode;


externalSelection = false;

firstTime = true;

setToolTip(QString("%1 --> %2").arg(myStartItem->itemName).arg(myEndItem->itemName));

textLbl.setFlag(ItemIsMovable,!nestedInApp);
textLbl.setFlag(ItemSendsGeometryChanges,!nestedInApp);



}

Arrow::~Arrow()
Expand Down
18 changes: 13 additions & 5 deletions src/yarpmanager/src-builder/builderitem.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,19 @@ class BuilderItem : public QGraphicsObject

public:

BuilderItem(QGraphicsObject * parent = 0): QGraphicsObject(parent){
snap = false;
offset = QPointF(0,0);
nestedInApp = false;
}
BuilderItem(QGraphicsObject * parent = 0) : QGraphicsObject(parent),
itemType(ModuleItemType),
offset(QPointF(0,0)),
pressed(false),
moved(false),
creatingNewConnection(false),
allowInputs(false),
allowOutputs(false),
snap(false),
nestedInApp(false),
sigHandler(YARP_NULLPTR)
{}

virtual QRectF boundingRect() const override = 0;
virtual QPointF connectionPoint() = 0;
virtual int type() const override = 0;
Expand Down
11 changes: 6 additions & 5 deletions src/yarpmanager/src-builder/builderscene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@
#include <QGraphicsView>
#include <QGraphicsSceneWheelEvent>

BuilderScene::BuilderScene(QObject *parent) :
QGraphicsScene(parent)
BuilderScene::BuilderScene(QObject *parent) : QGraphicsScene(parent),
currentLine(YARP_NULLPTR),
startConnectionItem(YARP_NULLPTR),
endConnectionItem(YARP_NULLPTR),
snap(false),
editingMode(false)
{
currentLine = NULL;
startConnectionItem = NULL;
//connect(this,SIGNAL(changed(QList<QRectF>)),this,SLOT(onSceneChanged(QList<QRectF>)));
snap = false;
setStickyFocus(true);
}

Expand Down
12 changes: 7 additions & 5 deletions src/yarpmanager/src-builder/builderwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1314,12 +1314,14 @@ void BuilderWindow::setInputPortAvailable(QString iData, bool available)
/**********************************************************************************/
/**********************************************************************************/

CustomView::CustomView(BuilderWindow *builder,QGraphicsView *parent) : QGraphicsView(parent){
CustomView::CustomView(BuilderWindow *_builder,QGraphicsView *parent) : QGraphicsView(parent),
builder(_builder),
editingMode(false),
m_rubberBandActive(false),
mousepressed(false),
rubberBand(YARP_NULLPTR)
{
setInteractive(true);
mousepressed = false;
m_rubberBandActive = false;
rubberBand = NULL;
this->builder = builder;

// QGLWidget *viewport = new QGLWidget(QGLFormat(QGL::SampleBuffers));
// setViewport(viewport);
Expand Down
8 changes: 4 additions & 4 deletions src/yarpmanager/src-builder/itemsignalhandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
#include "sourceportitem.h"
#include "destinationportitem.h"

ItemSignalHandler::ItemSignalHandler(QObject *parent) : QObject(parent)
{
//parentItem = it;
}
ItemSignalHandler::ItemSignalHandler(QObject *parent) : QObject(parent),
parentItem(YARP_NULLPTR),
type(ModuleItemType)
{}

ItemSignalHandler::ItemSignalHandler(QGraphicsItem *it,ItemType type,QObject *parent) : QObject(parent)
{
Expand Down
4 changes: 2 additions & 2 deletions src/yarpmanager/src-builder/moduleitem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,7 @@ void ModuleItem::portMoved(PortItem *port,QGraphicsSceneMouseEvent *e)
PortItem::PortItem(InputData *node, BuilderItem *parent) : BuilderItem(parent)
{
triangleH = (PORT_LINE_WIDTH/2)* sqrt(3.0);
outData = YARP_NULLPTR;
inData = node;
portAvailable = unknown;

Expand Down Expand Up @@ -504,6 +505,7 @@ PortItem::PortItem(OutputData* node, BuilderItem *parent) : BuilderItem(parent)
{
triangleH = (PORT_LINE_WIDTH/2)* sqrt(3.0);
outData = node;
inData = YARP_NULLPTR;
portAvailable = unknown;
setAcceptHoverEvents(true);
setFlag(ItemSendsGeometryChanges,true);
Expand All @@ -525,8 +527,6 @@ PortItem::PortItem(OutputData* node, BuilderItem *parent) : BuilderItem(parent)
break;
}



this->itemName = node->getPort();
setToolTip(itemName);
this->parent = parent;
Expand Down
31 changes: 18 additions & 13 deletions src/yarpmanager/src-builder/propertiestable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,30 @@

using namespace std;

PropertiesTable::PropertiesTable(Manager *manager,QWidget *parent) : QWidget(parent)
PropertiesTable::PropertiesTable(Manager *_manager,QWidget *parent) : QWidget(parent),
currentApplication(YARP_NULLPTR),
currentModule(YARP_NULLPTR),
appName(YARP_NULLPTR),
appDescr(YARP_NULLPTR),
appVersion(YARP_NULLPTR),
appAuthors(YARP_NULLPTR),
appPrefix(YARP_NULLPTR),
modName(YARP_NULLPTR),
modNode(YARP_NULLPTR),
modStdio(YARP_NULLPTR),
modWorkDir(YARP_NULLPTR),
modPrefix(YARP_NULLPTR),
modDeployer(YARP_NULLPTR),
modParams(YARP_NULLPTR),
manager(_manager),
nodeCombo(YARP_NULLPTR),
deployerCombo(YARP_NULLPTR)
{
QHBoxLayout *lay = new QHBoxLayout(this);
propertiesTab = new QTabWidget(this);
appProperties = new QTreeWidget(this);
moduleProperties = new QTreeWidget(this);
moduleDescription = new QTreeWidget(this);
currentApplication = NULL;
currentModule = NULL;
this->manager = manager;

paramsSignalMapper = new QSignalMapper(this);
connect(paramsSignalMapper, SIGNAL(mapped(QWidget*)),
Expand All @@ -25,16 +39,7 @@ PropertiesTable::PropertiesTable(Manager *manager,QWidget *parent) : QWidget(par
setLayout(lay);
lay->setMargin(0);

appName = NULL;
appDescr = NULL;
appPrefix = NULL;
appVersion = NULL;
appAuthors = NULL;
nodeCombo = NULL;
deployerCombo = NULL;

propertiesTab->addTab(appProperties,"Application Properties");

}

void PropertiesTable::showApplicationTab(Application *application)
Expand Down
25 changes: 24 additions & 1 deletion src/yarpmanager/src-manager/applicationviewwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,30 @@ ApplicationViewWidget::ApplicationViewWidget(yarp::manager::Application *app,
bool editingMode,
QWidget *parent) :
GenericViewWidget(parent), ApplicationEvent(),
ui(new Ui::ApplicationViewWidget)
ui(new Ui::ApplicationViewWidget),
modRunAction(YARP_NULLPTR),
modStopAction(YARP_NULLPTR),
modkillAction(YARP_NULLPTR),
modSeparator(YARP_NULLPTR),
modRefreshAction(YARP_NULLPTR),
modSelectAllAction(YARP_NULLPTR),
modAttachAction(YARP_NULLPTR),
modAssignAction(YARP_NULLPTR),
connContex(YARP_NULLPTR),
connSubMenu(YARP_NULLPTR),
connConnectAction(YARP_NULLPTR),
connDisconnectAction(YARP_NULLPTR),
connSeparatorAction(YARP_NULLPTR),
connRefreshAction(YARP_NULLPTR),
connSelectAllAction(YARP_NULLPTR),
conn1SeparatorAction(YARP_NULLPTR),
connInspectAction(YARP_NULLPTR),
connYARPViewAction(YARP_NULLPTR),
connYARPReadAction(YARP_NULLPTR),
connYARPHearAction(YARP_NULLPTR),
connYARPScopeAction(YARP_NULLPTR),
resRefreshAction(YARP_NULLPTR),
resSelectAllAction(YARP_NULLPTR)
{
ui->setupUi(this);
lazy = lazyManager;
Expand Down
9 changes: 4 additions & 5 deletions src/yarpmanager/src-manager/genericviewwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@

#include "genericviewwidget.h"

GenericViewWidget::GenericViewWidget(QWidget *parent) :
QWidget(parent)
{
m_modified = false;
}
GenericViewWidget::GenericViewWidget(QWidget *parent) : QWidget(parent),
type(yarp::manager::NodeType::NODE_OTHER),
m_modified(false)
{}

/*! \brief return the type of the list*/
yarp::manager::NodeType GenericViewWidget::getType()
Expand Down
9 changes: 6 additions & 3 deletions src/yarpmanager/src-manager/safe_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,12 @@ using namespace yarp::manager;
#define POST_SEMAPHOR() postSemaphore();


SafeManager::SafeManager()
:action(MNOTHING), eventReceiver(NULL), busyAction(false)
{ }
SafeManager::SafeManager() :
m_pConfig(YARP_NULLPTR),
action(MNOTHING),
eventReceiver(YARP_NULLPTR),
busyAction(false)
{}

SafeManager::~SafeManager() { }

Expand Down

0 comments on commit 2fae714

Please sign in to comment.