Fix const issue in afb-auth.h
authorJosé Bollo <jose.bollo@iot.bzh>
Thu, 13 Jul 2017 09:45:59 +0000 (11:45 +0200)
committerJosé Bollo <jose.bollo@iot.bzh>
Thu, 13 Jul 2017 10:00:49 +0000 (12:00 +0200)
The fields type and loa were declared as const.
This worked well for C compilers that are allowing
to initialize constant fixed structures.

But when compiling with C++, it is no more easy
to create initialized structure explicitely.
In C++, the solution is to use C++14 constexpr functions.
But for using these function, const must be removed.

Bug-AGL: SPEC-741

Change-Id: I8096db6e4eba020f96fbf25789b2990d2a8cbabf
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
docs/afb-binding-writing.md
include/afb/afb-auth.h

index d7dccd1..ceb80a8 100644 (file)
@@ -61,6 +61,7 @@ A ***binder*** loads and runs any of these version in any combination.
 This document explain how to write bindings version 2.
 
 <!-- pagebreak -->
+
 Sample binding: tuto-1
 ======================
 
@@ -254,8 +255,10 @@ Here again, you can explicitly mark the fact that
 ```
 
 <!-- pagebreak -->
+
 Sample binding: tuto-2
 ======================
+
 The second tutorial shows many important feature that can
 commonly be used when writing a ***binding***: initialization,
 getting arguments, sending replies, pushing events.
index ee089e7..9ef5820 100644 (file)
@@ -34,10 +34,10 @@ enum afb_auth_type
 
 struct afb_auth
 {
-       const enum afb_auth_type type;
+       enum afb_auth_type type;
        union {
                const char *text;
-               const unsigned loa;
+               unsigned loa;
                const struct afb_auth *first;
        };
        const struct afb_auth *next;