Fix coding style of component-based-port 96/250696/1
authorHwankyu Jhun <h.jhun@samsung.com>
Mon, 4 Jan 2021 00:16:46 +0000 (09:16 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Mon, 4 Jan 2021 00:19:50 +0000 (09:19 +0900)
- Removes extra space before '['
- Removes using directives

Change-Id: I0dd6839019101322d7e92f52d3d182b562fcf2cf
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
component_based/port/request.cc
component_based/port/response.cc
component_based/port/stub.cc

index b0defcc3a83b7c7310f004b60973af3d3035a1ef..5543273876ff6e0cb3ab2a6c08fcfbe573459e07 100644 (file)
@@ -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;
index 46e8c2f93e6c2a206332ea638ef8c8b8837cbd01..62142b57704bdaeb66105fc5ffcff6d34016a2eb 100644 (file)
@@ -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;
index d28f43c0392b732aa18df78bf07edba9fac5cb91..f0645534d34945727943348d17e835760ccfae6e 100644 (file)
 #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<SenderInfo>& sender,
+  void OnRequest(const std::shared_ptr<component_based::SenderInfo>& sender,
       const std::shared_ptr<tizen_base::Parcel>& request) override {
     if (request_cb_) {
       parcel_h parcel = static_cast<parcel_h>(request.get());
@@ -51,7 +50,7 @@ class PortStub : public Port,
     }
   }
 
-  void OnSyncRequest(const std::shared_ptr<SenderInfo>& sender,
+  void OnSyncRequest(const std::shared_ptr<component_based::SenderInfo>& sender,
       const std::shared_ptr<tizen_base::Parcel>& request,
       std::shared_ptr<tizen_base::Parcel>& 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;
   }