From 604c627dc31473ead17d5011fb43d6609af2b752 Mon Sep 17 00:00:00 2001 From: Dave Wallace Date: Tue, 22 Aug 2023 14:18:32 -0400 Subject: vapi: fix coverity warnings - CID-322713, CID-322712, CID-314881, CID-314880, CID-314878 COPY_INSTEAD_OF_MOVE Type: fix Change-Id: Idad6806fcd4e1a89a750dcc0584b5b1f0432bf3c Signed-off-by: Dave Wallace --- src/vpp-api/vapi/vapi.hpp | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/src/vpp-api/vapi/vapi.hpp b/src/vpp-api/vapi/vapi.hpp index 58d170603e5..e0dd742eb5a 100644 --- a/src/vpp-api/vapi/vapi.hpp +++ b/src/vpp-api/vapi/vapi.hpp @@ -660,10 +660,11 @@ class Request : public Common_req { public: Request (Connection &con, Args... args, - std::function &)> - callback = nullptr) - : Common_req{con}, callback{callback}, - request{con, vapi_alloc (con, args...)}, response{con, nullptr} + std::function &)> + callback = nullptr) + : Common_req{ con }, callback{ std::move (callback) }, + request{ con, vapi_alloc (con, args...) }, response{ con, + nullptr } { } @@ -811,7 +812,7 @@ public: std::function &)> cb = nullptr) : Common_req{ con }, request{ con, vapi_alloc (con, args...) }, - response{ con, nullptr }, result_set{ con }, callback{ cb } + response{ con, nullptr }, result_set{ con }, callback{ std::move (cb) } { } @@ -886,10 +887,10 @@ class Dump : public Common_req { public: Dump (Connection &con, Args... args, - std::function &)> callback = - nullptr) - : Common_req{con}, request{con, vapi_alloc (con, args...)}, - result_set{con}, callback{callback} + std::function &)> callback = + nullptr) + : Common_req{ con }, request{ con, vapi_alloc (con, args...) }, + result_set{ con }, callback{ std::move (callback) } { } @@ -953,9 +954,9 @@ template class Event_registration : public Common_req { public: Event_registration ( - Connection &con, - std::function &)> callback = nullptr) - : Common_req{con}, result_set{con}, callback{callback} + Connection &con, + std::function &)> callback = nullptr) + : Common_req{ con }, result_set{ con }, callback{ std::move (callback) } { if (!con.is_msg_available (M::get_msg_id ())) { -- cgit 1.2.3-korg