From fe08bb9dd9dcc498060c3eb737fbf20bd6f65459 Mon Sep 17 00:00:00 2001
From: Jakob Olsson <jakob.olsson@iopsys.eu>
Date: Thu, 3 Oct 2019 14:57:26 +0200
Subject: [PATCH] resolve a few compile warnings

---
 src/json-editor.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/json-editor.c b/src/json-editor.c
index cd14cb5..4da1951 100644
--- a/src/json-editor.c
+++ b/src/json-editor.c
@@ -14,7 +14,8 @@
 static char *get_file(const char *path)
 {
 	FILE *f;
-	size_t len, nread;
+	size_t nread;
+	long int len;
 	char *buffer;
 
 	f = fopen(path, "r");
@@ -175,7 +176,7 @@ static struct json_object *dummy_val(char *val, enum json_type type)
  * Should the key not be an array, it will be converted to an array and appropriate indexes will be prepared.
  *
  */
-static int iterate_array(struct json_object *src, int *idx, int len, struct json_object *j_val, enum json_type type, char *key)
+static int iterate_array(struct json_object *src, int *idx, int len, struct json_object *j_val, char *key)
 {
 	struct json_object *val;
 
@@ -267,7 +268,7 @@ static int add_val(struct json_object *src, char *key, char *val, enum json_type
 				copy_object_into_object(j_val, src);
 
 		} else
-			iterate_array(src, idx, len, j_val, type, parsed_key);
+			iterate_array(src, idx, len, j_val, parsed_key);
 
 		goto out;
 	}
@@ -276,7 +277,7 @@ static int add_val(struct json_object *src, char *key, char *val, enum json_type
 	if (len < 1 || type == json_type_array)
 		json_object_object_add(src, parsed_key, j_val);
 	else {
-		iterate_array(src, idx, len, j_val, type, parsed_key);
+		iterate_array(src, idx, len, j_val, parsed_key);
 	}
 
 out:
-- 
GitLab