summaryrefslogtreecommitdiffstats
path: root/wrap-json.c
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2018-04-03 15:46:38 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2018-04-03 15:46:38 +0200
commit5621dc75f9ce70f2de4f4c950fb3a3ce0b357d9c (patch)
treec599fe6e4320e54f98633fa47de5dfc0299757e7 /wrap-json.c
parent7db4aac29d251134dea5ec4425ef87c970f6fec0 (diff)
Linting/Fix: remove warning int/size_t conversion
Change-Id: I831bac418f5c12c9a747b08ea8be72dcbe1d4ea3 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'wrap-json.c')
-rw-r--r--wrap-json.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/wrap-json.c b/wrap-json.c
index 164e127..d3fb333 100644
--- a/wrap-json.c
+++ b/wrap-json.c
@@ -347,7 +347,7 @@ static int vunpack(struct json_object *object, const char *desc, va_list args, i
int *pi = NULL;
int64_t *pI = NULL;
size_t *pz = NULL;
- struct { struct json_object *parent; const char *acc; int index, count; char type; } stack[STACKCOUNT], *top;
+ struct { struct json_object *parent; const char *acc; int index; size_t count; char type; } stack[STACKCOUNT], *top;
struct json_object *obj;
struct json_object **po;
@@ -656,7 +656,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)
{
- int n = json_object_array_length(object);
+ size_t n = json_object_array_length(object);
int i = 0;
while(i < n)
callback(closure, json_object_array_get_idx(object, i++));
@@ -699,7 +699,7 @@ void wrap_json_for_all(struct json_object *object, void (*callback)(void*,struct
else if (!json_object_is_type(object, json_type_array))
callback(closure, object, NULL);
else {
- int n = json_object_array_length(object);
+ size_t n = json_object_array_length(object);
int i = 0;
while(i < n)
callback(closure, json_object_array_get_idx(object, i++), NULL);
@@ -718,7 +718,7 @@ void p(const char *desc, ...)
va_start(args, desc);
rc = wrap_json_vpack(&result, desc, args);
va_end(args);
- if (!rc)
+ if (!rc)
printf(" SUCCESS %s\n\n", json_object_to_json_string(result));
else
printf(" ERROR[char %d err %d] %s\n\n", wrap_json_get_error_position(rc), wrap_json_get_error_code(rc), wrap_json_get_error_string(rc));
@@ -749,7 +749,7 @@ void u(const char *value, const char *desc, ...)
va_start(args, desc);
rc = wrap_json_vunpack(obj, desc, args);
va_end(args);
- if (rc)
+ if (rc)
printf(" ERROR[char %d err %d] %s\n\n", wrap_json_get_error_position(rc), wrap_json_get_error_code(rc), wrap_json_get_error_string(rc));
else {
value = NULL;