[Olsr-dev] [PATCH v1 109/115] jsoninfo: helpers: use an actual bool as parameter for abuf_json_boolean

Ferry Huberts (spam-protected)
Wed Dec 2 21:29:22 CET 2015


From: Ferry Huberts <(spam-protected)>

Signed-off-by: Ferry Huberts <(spam-protected)>
---
 lib/jsoninfo/src/olsrd_jsoninfo_helpers.c | 2 +-
 lib/jsoninfo/src/olsrd_jsoninfo_helpers.h | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/lib/jsoninfo/src/olsrd_jsoninfo_helpers.c b/lib/jsoninfo/src/olsrd_jsoninfo_helpers.c
index c005a0c..6f3f42a 100644
--- a/lib/jsoninfo/src/olsrd_jsoninfo_helpers.c
+++ b/lib/jsoninfo/src/olsrd_jsoninfo_helpers.c
@@ -124,7 +124,7 @@ void abuf_json_mark_array_entry(bool open, struct autobuf *abuf) {
   abuf_json_mark_object(open, false, abuf, NULL);
 }
 
-void abuf_json_boolean(struct autobuf *abuf, const char* key, int value) {
+void abuf_json_boolean(struct autobuf *abuf, const char* key, bool value) {
   abuf_json_insert_comma(abuf);
   abuf_json_new_indent(abuf);
   abuf_appendf(abuf, "\"%s\": %s", key, value ? "true" : "false");
diff --git a/lib/jsoninfo/src/olsrd_jsoninfo_helpers.h b/lib/jsoninfo/src/olsrd_jsoninfo_helpers.h
index 2c3d04f..80c3930 100644
--- a/lib/jsoninfo/src/olsrd_jsoninfo_helpers.h
+++ b/lib/jsoninfo/src/olsrd_jsoninfo_helpers.h
@@ -43,6 +43,7 @@
 #define LIB_JSONINFO_SRC_OLSRD_JSONINFO_HELPERS_H_
 
 #include <stdio.h>
+#include <stdbool.h>
 
 #include "common/autobuf.h"
 
@@ -59,7 +60,7 @@ void abuf_json_mark_array_entry(bool open, struct autobuf *abuf);
 
 void abuf_json_insert_comma(struct autobuf *abuf);
 
-void abuf_json_boolean(struct autobuf *abuf, const char* key, int value);
+void abuf_json_boolean(struct autobuf *abuf, const char* key, bool value);
 
 void abuf_json_string(struct autobuf *abuf, const char* key, const char* value);
 
-- 
2.5.0




More information about the Olsr-dev mailing list