summaryrefslogtreecommitdiffstats
path: root/CAN-binder/low-can-binding
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-05-12 14:09:25 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2017-05-19 11:36:42 +0200
commit112709f7b6babda983feccd90c633eaca4c15e15 (patch)
treeb9031203357ae30c1c5cdc807cd754844b68083f /CAN-binder/low-can-binding
parentacb0ad5052b81c111333a75f99bdf4bafe299792 (diff)
Fix wrong signature, better with const ref... Was forgotten
Change-Id: I2d3f7525bb85c051c43aeda6b9cc1be0f3e270c8 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'CAN-binder/low-can-binding')
-rw-r--r--CAN-binder/low-can-binding/binding/low-can-cb.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/CAN-binder/low-can-binding/binding/low-can-cb.cpp b/CAN-binder/low-can-binding/binding/low-can-cb.cpp
index df6795f..55d9bdd 100644
--- a/CAN-binder/low-can-binding/binding/low-can-cb.cpp
+++ b/CAN-binder/low-can-binding/binding/low-can-cb.cpp
@@ -196,7 +196,7 @@ static int subscribe_unsubscribe_signals(struct afb_req request, bool subscribe,
return rets;
}
-static int process_args(struct afb_req request, std::vector<std::string> args, bool subscribe)
+static int process_args(struct afb_req request, const std::vector<std::string>& args, bool subscribe)
{
struct utils::signals_found sf;
int ok = 0, total = 0;
@@ -216,7 +216,7 @@ static int process_args(struct afb_req request, std::vector<std::string> args, b
return ok;
}
-static const std::vector<std::string> parse_args_from_request(struct afb_req request, bool subscribe)
+static const std::vector<std::string> parse_args_from_request(struct afb_req request)
{
int i, n;
std::vector<std::string> ret;
@@ -247,10 +247,9 @@ static const std::vector<std::string> parse_args_from_request(struct afb_req req
void subscribe(struct afb_req request)
{
- std::vector<std::string> args;
bool subscribe = true;
- args = parse_args_from_request(request, subscribe);
+ const std::vector<std::string> args = parse_args_from_request(request);
if (process_args(request, args, subscribe) > 0)
afb_req_success(request, NULL, NULL);
@@ -263,7 +262,7 @@ void unsubscribe(struct afb_req request)
std::vector<std::string> args;
bool subscribe = false;
- args = parse_args_from_request(request, subscribe);
+ args = parse_args_from_request(request);
if (process_args(request, args, subscribe) > 0)
afb_req_success(request, NULL, NULL);