From eb82401714de95e8038d31a3f812aa1f7515a27d Mon Sep 17 00:00:00 2001 From: Hwankyu Jhun Date: Mon, 4 Jan 2021 09:16:46 +0900 Subject: [PATCH] Fix coding style of component-based-port - Removes extra space before '[' - Removes using directives Change-Id: I0dd6839019101322d7e92f52d3d182b562fcf2cf Signed-off-by: Hwankyu Jhun --- component_based/port/request.cc | 2 +- component_based/port/response.cc | 2 +- component_based/port/stub.cc | 13 ++++++------- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/component_based/port/request.cc b/component_based/port/request.cc index b0defcc..5543273 100644 --- a/component_based/port/request.cc +++ b/component_based/port/request.cc @@ -46,7 +46,7 @@ void Request::ReadFromParcel(tizen_base::Parcel* parcel) { uint32_t size = 0; parcel->ReadUInt32(&size); if (size > 0) { - auto* data = new (std::nothrow) uint8_t [size]; + auto* data = new (std::nothrow) uint8_t[size]; if (data == nullptr) { _E("Out of memory"); return; diff --git a/component_based/port/response.cc b/component_based/port/response.cc index 46e8c2f..62142b5 100644 --- a/component_based/port/response.cc +++ b/component_based/port/response.cc @@ -44,7 +44,7 @@ void Response::ReadFromParcel(tizen_base::Parcel* parcel) { uint32_t size = 0; parcel->ReadUInt32(&size); if (size > 0) { - auto* data = new (std::nothrow) uint8_t [size]; + auto* data = new (std::nothrow) uint8_t[size]; if (data == nullptr) { _E("Out of memory"); return; diff --git a/component_based/port/stub.cc b/component_based/port/stub.cc index d28f43c..f064553 100644 --- a/component_based/port/stub.cc +++ b/component_based/port/stub.cc @@ -21,12 +21,11 @@ #include "component_based/port/port.hh" namespace { -using namespace component_based; -class PortStub : public Port, - public Port::IEvent { +class PortStub : public component_based::Port, + public component_based::Port::IEvent { public: - PortStub(std::string name) + explicit PortStub(std::string name) : Port(std::move(name), this) { } @@ -43,7 +42,7 @@ class PortStub : public Port, } private: - void OnRequest(const std::shared_ptr& sender, + void OnRequest(const std::shared_ptr& sender, const std::shared_ptr& request) override { if (request_cb_) { parcel_h parcel = static_cast(request.get()); @@ -51,7 +50,7 @@ class PortStub : public Port, } } - void OnSyncRequest(const std::shared_ptr& sender, + void OnSyncRequest(const std::shared_ptr& sender, const std::shared_ptr& request, std::shared_ptr& response) override { if (sync_request_cb_) { @@ -85,7 +84,7 @@ extern "C" EXPORT_API int component_port_create(const char* port_name, _E("Out of memory"); return COMPONENT_PORT_ERROR_OUT_OF_MEMORY; } - } catch (Exception& e) { + } catch (component_based::Exception& e) { _E("Failed to create port"); return COMPONENT_PORT_ERROR_IO_ERROR; } -- 2.34.1