aboutsummaryrefslogtreecommitdiffstats
path: root/src/devtools/genskel.c
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2018-06-19 18:25:34 +0200
committerJosé Bollo <jose.bollo@iot.bzh>2018-06-19 18:25:34 +0200
commit2e2bfa31dc97159b7630c3c2913a49147be818d2 (patch)
tree087c09fc5b8cf57e86d619df4eb5bb528e1ffcd4 /src/devtools/genskel.c
parent7bf0d9c6f807ffae6d9871c606afeccb9b478d3d (diff)
Fix warnings due to json-c evolution
The library json-c now returns size_t instead of int when querying length of arrays. Change-Id: Id52bb8e77da12cb01e61e1a7c7f4ae2fcbe4634e Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Diffstat (limited to 'src/devtools/genskel.c')
-rw-r--r--src/devtools/genskel.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/devtools/genskel.c b/src/devtools/genskel.c
index 55dd3c15..f5705a2e 100644
--- a/src/devtools/genskel.c
+++ b/src/devtools/genskel.c
@@ -153,7 +153,7 @@ struct json_object *expand_$ref(struct path path)
case json_type_array:
/* expand the values of arrays */
i = 0;
- n = json_object_array_length(path.object);
+ n = (int)json_object_array_length(path.object);
while (i != n) {
o = json_object_array_get_idx(path.object, i);
x = expand_$ref((struct path){ .object = o, .upper = &path });
@@ -290,7 +290,7 @@ void print_perms()
int i, n;
const char *fmtstr = cpp ? "\t%s" : "\t{ %s }";
- n = a_perms ? json_object_array_length(a_perms) : 0;
+ n = a_perms ? (int)json_object_array_length(a_perms) : 0;
if (n) {
printf("static const struct afb_auth _afb_auths_%s[] = {\n" , capi);
i = 0;
@@ -322,7 +322,7 @@ struct json_object *new_perm(struct json_object *obj, const char *desc)
}
/* creates the reference in the structure */
- asprintf(&b, "&_afb_auths_%s[%d]", capi, json_object_array_length(a_perms));
+ asprintf(&b, "&_afb_auths_%s[%d]", capi, (int)json_object_array_length(a_perms));
x = json_object_new_string(desc);
y = json_object_new_string(b);
json_object_array_add(a_perms, x);
@@ -352,7 +352,7 @@ struct json_object *decl_perm_a(enum optype op, struct json_object *obj)
opstr = op==And ? "And" : "Or";
}
x = NULL;
- i = n = obj ? json_object_array_length(obj) : 0;
+ i = n = obj ? (int)json_object_array_length(obj) : 0;
while (i) {
y = decl_perm(json_object_array_get_idx(obj, --i));
if (!y)
@@ -438,7 +438,7 @@ int get_session_a(int and, struct json_object *obj)
{
int i, n, x, y;
- n = obj ? json_object_array_length(obj) : 0;
+ n = obj ? (int)json_object_array_length(obj) : 0;
if (n == 0)
return 0;