From 98a6b19ab5bbdfa8b3a582eef43e3ea69990b96d Mon Sep 17 00:00:00 2001 From: Wonki Kim Date: Thu, 12 Dec 2019 19:10:37 +0900 Subject: [PATCH] fix potentional erros according to svace/coverity avalytics this patch fixes potentional problems according to svace/coverity analytics. that's it Change-Id: Ifeb5cad72082d8eacb7d679a67a4932da537b28b --- bootstrap/server/src/Commands/PostCommand.cc | 2 +- bootstrap/server/src/Commands/PreCommand.cc | 2 +- bootstrap/server/src/ObjectMapper.cc | 2 +- libaurum/src/AccessibleNode.cc | 4 ++-- libaurum/src/UiObject.cc | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/bootstrap/server/src/Commands/PostCommand.cc b/bootstrap/server/src/Commands/PostCommand.cc index 31c4200..27ba5ad 100644 --- a/bootstrap/server/src/Commands/PostCommand.cc +++ b/bootstrap/server/src/Commands/PostCommand.cc @@ -2,7 +2,7 @@ #include #include -PostCommand::PostCommand() {} +PostCommand::PostCommand() : PostCommand(nullptr) {} PostCommand::PostCommand(Command *cmd) : mCommand{cmd} {} ::grpc::Status PostCommand::execute() diff --git a/bootstrap/server/src/Commands/PreCommand.cc b/bootstrap/server/src/Commands/PreCommand.cc index bea3aa5..647c10b 100644 --- a/bootstrap/server/src/Commands/PreCommand.cc +++ b/bootstrap/server/src/Commands/PreCommand.cc @@ -2,7 +2,7 @@ #include #include -PreCommand::PreCommand() {} +PreCommand::PreCommand() : PreCommand(nullptr) {} PreCommand::PreCommand(Command *cmd) : mCommand{cmd} {} ::grpc::Status PreCommand::execute() diff --git a/bootstrap/server/src/ObjectMapper.cc b/bootstrap/server/src/ObjectMapper.cc index 4519066..1c7a703 100644 --- a/bootstrap/server/src/ObjectMapper.cc +++ b/bootstrap/server/src/ObjectMapper.cc @@ -20,7 +20,7 @@ std::string ObjectMapper::addElement(std::unique_ptr object) UiObject *ObjectMapper::getElement(const std::string &key) { - unsigned long long keyCnt = std::stoi(key); + unsigned long long keyCnt = (unsigned long long)std::stoi(key); // this key is a result of calling std:to_string(mObjCounter) if (keyCnt <= 0 || keyCnt > mObjCounter) return nullptr; if (mObjectMap.count(key)) { UiObject *obj = mObjectMap[key].get(); diff --git a/libaurum/src/AccessibleNode.cc b/libaurum/src/AccessibleNode.cc index b0ef5cb..565b868 100644 --- a/libaurum/src/AccessibleNode.cc +++ b/libaurum/src/AccessibleNode.cc @@ -13,14 +13,14 @@ AccessibleNode::~AccessibleNode() g_object_unref(mNode); } -AccessibleNode::AccessibleNode() +AccessibleNode::AccessibleNode() : AccessibleNode(nullptr) { // No meaning without AtspiAccessbile object // prohibited to create this object with this constructor } AccessibleNode::AccessibleNode(AtspiAccessible *node) - : mNode(node), mSupportingIfaces(0), mIsAlive(true) + : mNode(node), mSupportingIfaces(0), mFeatureProperty(0), mIsAlive(true) { // prohibited to create this object this constructor // better to use AccessibleNode::get factory method. diff --git a/libaurum/src/UiObject.cc b/libaurum/src/UiObject.cc index 85e349c..7bb91dd 100644 --- a/libaurum/src/UiObject.cc +++ b/libaurum/src/UiObject.cc @@ -7,7 +7,7 @@ #include "loguru.hpp" -UiObject::UiObject() {} +UiObject::UiObject() : UiObject(nullptr, nullptr, nullptr) {} UiObject::~UiObject() { -- 2.7.4