aboutsummaryrefslogtreecommitdiffstats
path: root/wrap-json.c
diff options
context:
space:
mode:
authorjobol <jose.bollo@iot.bzh>2018-05-14 14:25:37 +0200
committerjobol <jose.bollo@iot.bzh>2018-05-14 14:25:37 +0200
commit71093aac4a994ce075313f3537dbe54dd25081a1 (patch)
tree548121845ca48635f36b007d3503512ccff0972e /wrap-json.c
parent12a9f3cadf03cf8f86353f20ec6e9fc689e57ba2 (diff)
wrap-json: Fix warnings
Signed-off-by: jobol <jose.bollo@iot.bzh>
Diffstat (limited to 'wrap-json.c')
-rw-r--r--wrap-json.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/wrap-json.c b/wrap-json.c
index 6978c25..7fc8a9c 100644
--- a/wrap-json.c
+++ b/wrap-json.c
@@ -89,7 +89,7 @@ int wrap_json_get_error_code(int rc)
const char *wrap_json_get_error_string(int rc)
{
rc = wrap_json_get_error_code(rc);
- if (rc >= sizeof pack_errors / sizeof *pack_errors)
+ if (rc >= (int)(sizeof pack_errors / sizeof *pack_errors))
rc = 0;
return pack_errors[rc];
}
@@ -528,7 +528,7 @@ static int vunpack(struct json_object *object, const char *desc, va_list args, i
int64_t *pI = NULL;
size_t *pz = NULL;
uint8_t **py = NULL;
- struct { struct json_object *parent; const char *acc; int index; size_t count; char type; } stack[STACKCOUNT], *top;
+ struct { struct json_object *parent; const char *acc; size_t index; size_t count; char type; } stack[STACKCOUNT], *top;
struct json_object *obj;
struct json_object **po;
@@ -864,7 +864,7 @@ static void object_for_all(struct json_object *object, void (*callback)(void*,st
static void array_for_all(struct json_object *object, void (*callback)(void*,struct json_object*), void *closure)
{
size_t n = json_object_array_length(object);
- int i = 0;
+ size_t i = 0;
while(i < n)
callback(closure, json_object_array_get_idx(object, i++));
}
@@ -907,7 +907,7 @@ void wrap_json_for_all(struct json_object *object, void (*callback)(void*,struct
callback(closure, object, NULL);
else {
size_t n = json_object_array_length(object);
- int i = 0;
+ size_t i = 0;
while(i < n)
callback(closure, json_object_array_get_idx(object, i++), NULL);
}