afb-context: add const qualifier for api_key
authorJosé Bollo <jose.bollo@iot.bzh>
Tue, 19 Sep 2017 12:39:47 +0000 (14:39 +0200)
committerJosé Bollo <jose.bollo@iot.bzh>
Mon, 9 Oct 2017 12:08:29 +0000 (14:08 +0200)
Change-Id: I138d70698342cc2350d4f9098bcf5c486d16faba
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
src/afb-context.c
src/afb-context.h

index 81f21ff..11abcd4 100644 (file)
@@ -163,9 +163,9 @@ int afb_context_check_loa(struct afb_context *context, unsigned loa)
        return afb_context_get_loa(context) >= loa;
 }
 
-static inline void *loa_key(struct afb_context *context)
+static inline const void *loa_key(struct afb_context *context)
 {
-       return (void*)(1+(intptr_t)(context->api_key));
+       return (const void*)(1+(intptr_t)(context->api_key));
 }
 
 static inline void *loa2ptr(unsigned loa)
index f1af362..47e488c 100644 (file)
@@ -22,7 +22,7 @@ struct afb_session;
 struct afb_context
 {
        struct afb_session *session;
-       void *api_key;
+       const void *api_key;
        struct afb_context *super;
        union {
                unsigned flags;