From: Hwankyu Jhun Date: Tue, 19 Sep 2023 01:54:20 +0000 (+0900) Subject: Fix static analysis issues X-Git-Tag: accepted/tizen/8.0/unified/20231005.093101~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F42%2F299042%2F1;p=platform%2Fcore%2Fappfw%2Frpc-port.git Fix static analysis issues Issues: - COPY_INSTEAD_OF_MOVE Change-Id: Ie072a4808a2170dea24e337a5aaf7828e752763d Signed-off-by: Hwankyu Jhun --- diff --git a/benchmark/server/main.cc b/benchmark/server/main.cc index 9be81a1..daac54c 100644 --- a/benchmark/server/main.cc +++ b/benchmark/server/main.cc @@ -35,12 +35,12 @@ class TestService : public bs::Benchmark::ServiceBase { std::unique_ptr CreateService(std::string sender, std::string instance) { return std::unique_ptr( - new TestService(sender, instance)); + new TestService(std::move(sender), std::move(instance))); } }; TestService(std::string sender, std::string instance) : - bs::Benchmark::ServiceBase(sender, instance) {} + bs::Benchmark::ServiceBase(std::move(sender), std::move(instance)) {} virtual ~TestService() = default; diff --git a/src/ac-internal.cc b/src/ac-internal.cc index 20b8974..7f21f8f 100644 --- a/src/ac-internal.cc +++ b/src/ac-internal.cc @@ -107,13 +107,14 @@ void AccessController::CheckAsync(int fd, std::string sender_appid, } int res = Check(fd, sender_appid); - auto* cbdata = new std::pair(callback, res); + auto* cbdata = new std::pair( + std::move(callback), res); guint sid = g_idle_add( [](gpointer data) -> gboolean { - auto* cbdata = static_cast*>(data); - auto [callback, res] = *cbdata; + auto* cb_data = static_cast*>(data); + auto [callback, res] = *cb_data; callback(res); - delete cbdata; + delete cb_data; return G_SOURCE_REMOVE; }, cbdata); if (sid == 0) { diff --git a/utils/debug-port.cc b/utils/debug-port.cc index 08a80ea..801f4c8 100644 --- a/utils/debug-port.cc +++ b/utils/debug-port.cc @@ -164,7 +164,7 @@ void DebugPort::OnDataReceived(int pid, rpc_port_parcel_h parcel) { delete[] buf; auto* msg = new Message(sent_time, pid, port_name, destination, is_delegate, - port, is_read, seq, data); + port, is_read, seq, std::move(data)); g_idle_add([](gpointer data) -> gboolean { auto* msg = static_cast(data); msg->Print();