summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcus Fritzsch <marcus_fritzsch@mentor.com>2017-09-04 13:43:29 +0200
committerMarcus Fritzsch <marcus_fritzsch@mentor.com>2017-09-14 14:04:51 +0200
commit715231c6093c54797d36c1e01667439d0a8741f3 (patch)
tree01f2970547f86680f0d5560fc51bfa321ae9905c
parent808d675237bdc2750f63a21869264ddb7319a57f (diff)
Impl: made wsj1_itf const
Signed-off-by: Marcus Fritzsch <marcus_fritzsch@mentor.com>
-rw-r--r--AFBClient.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/AFBClient.cpp b/AFBClient.cpp
index 26efab6..9210eac 100644
--- a/AFBClient.cpp
+++ b/AFBClient.cpp
@@ -86,7 +86,7 @@ void onHangup(void *closure, afb_wsj1 *wsj1) {
exit(0);
}
-static struct afb_wsj1_itf itf = {
+constexpr static struct afb_wsj1_itf itf = {
onHangup, onCall, onEvent,
};
@@ -236,7 +236,8 @@ int AFBClient::Impl::init(int port, char const *token) {
asprintf(&uribuf, "ws://localhost:%d/api?token=%s", port, token);
/* connect the websocket wsj1 to the uri given by the first argument */
- wsj1 = afb_ws_client_connect_wsj1(loop, uribuf, &itf, nullptr);
+ wsj1 = afb_ws_client_connect_wsj1(
+ loop, uribuf, const_cast<struct afb_wsj1_itf *>(&itf), nullptr);
if (wsj1 == nullptr) {
sd_event_unref(loop);
fprintf(stderr, "Connection to %s failed: %m\n", uribuf);