summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Wallace <dwallacelf@gmail.com>2023-08-22 14:18:32 -0400
committerAndrew Yourtchenko <ayourtch@gmail.com>2023-09-16 07:50:17 +0000
commit604c627dc31473ead17d5011fb43d6609af2b752 (patch)
treebcc34cd5904623bfcde040a7a71404f2d5368365
parent74cbed1497876ad36423fa8db78abfc1d6eddda4 (diff)
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 <dwallacelf@gmail.com>
-rw-r--r--src/vpp-api/vapi/vapi.hpp25
1 files 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<vapi_error_e (Request<Req, Resp, Args...> &)>
- callback = nullptr)
- : Common_req{con}, callback{callback},
- request{con, vapi_alloc<Req> (con, args...)}, response{con, nullptr}
+ std::function<vapi_error_e (Request<Req, Resp, Args...> &)>
+ callback = nullptr)
+ : Common_req{ con }, callback{ std::move (callback) },
+ request{ con, vapi_alloc<Req> (con, args...) }, response{ con,
+ nullptr }
{
}
@@ -811,7 +812,7 @@ public:
std::function<vapi_error_e (Stream<Req, Resp, StreamMessage, Args...> &)>
cb = nullptr)
: Common_req{ con }, request{ con, vapi_alloc<Req> (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<vapi_error_e (Dump<Req, Resp, Args...> &)> callback =
- nullptr)
- : Common_req{con}, request{con, vapi_alloc<Req> (con, args...)},
- result_set{con}, callback{callback}
+ std::function<vapi_error_e (Dump<Req, Resp, Args...> &)> callback =
+ nullptr)
+ : Common_req{ con }, request{ con, vapi_alloc<Req> (con, args...) },
+ result_set{ con }, callback{ std::move (callback) }
{
}
@@ -953,9 +954,9 @@ template <typename M> class Event_registration : public Common_req
{
public:
Event_registration (
- Connection &con,
- std::function<vapi_error_e (Event_registration<M> &)> callback = nullptr)
- : Common_req{con}, result_set{con}, callback{callback}
+ Connection &con,
+ std::function<vapi_error_e (Event_registration<M> &)> callback = nullptr)
+ : Common_req{ con }, result_set{ con }, callback{ std::move (callback) }
{
if (!con.is_msg_available (M::get_msg_id ()))
{