summaryrefslogtreecommitdiffstats
path: root/ctl-lib/ctl-config.c
diff options
context:
space:
mode:
authorThierry Bultel <thierry.bultel@iot.bzh>2018-05-22 10:51:52 +0200
committerThierry Bultel <thierry.bultel@iot.bzh>2018-05-22 15:05:27 +0200
commit4a723022410de1a72b03a4901537af4e0d27397b (patch)
tree4d5e5ab58cfe9497f62f51a586b981c8b6d85e82 /ctl-lib/ctl-config.c
parent4b4a05dd1f5bd4c03c9560812bf9ed10cf31035b (diff)
Fixed compilation warnings with gcc-7.2.0
Replaced some 'size_t' by 'int' Change-Id: Iaf58b4b65f9aa2e82c0a87af45f21ca62fa4d84e Signed-off-by: Thierry Bultel <thierry.bultel@iot.bzh>
Diffstat (limited to 'ctl-lib/ctl-config.c')
-rw-r--r--ctl-lib/ctl-config.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/ctl-lib/ctl-config.c b/ctl-lib/ctl-config.c
index 4e9d01d..de9f10e 100644
--- a/ctl-lib/ctl-config.c
+++ b/ctl-lib/ctl-config.c
@@ -65,7 +65,7 @@ json_object* CtlConfigScan(const char *dirList, const char *prefix) {
char* ConfigSearch(AFB_ApiT apiHandle, json_object *responseJ) {
// We load 1st file others are just warnings
size_t p_length;
- char *filepath;
+ char *filepath = NULL;
const char *filename;
const char*fullpath;
@@ -184,7 +184,7 @@ json_object* LoadAdditionalsFiles(AFB_ApiT apiHandle, CtlConfigT *ctlHandle, con
json_object* CtlUpdateSectionConfig(AFB_ApiT apiHandle, CtlConfigT *ctlHandle, const char *key, json_object *sectionJ, json_object *filesJ) {
json_object *sectionArrayJ;
- char *oneFile;
+ char *oneFile = NULL;
const char *bindingPath = GetBindingDirPath(apiHandle);
if(! json_object_is_type(sectionJ, json_type_array)) {
@@ -199,7 +199,7 @@ json_object* CtlUpdateSectionConfig(AFB_ApiT apiHandle, CtlConfigT *ctlHandle, c
json_object_object_add(ctlHandle->configJ, key, sectionArrayJ);
if (json_object_get_type(filesJ) == json_type_array) {
- size_t length = json_object_array_length(filesJ);
+ int length = json_object_array_length(filesJ);
for (int idx=0; idx < length; idx++) {
json_object *oneFileJ = json_object_array_get_idx(filesJ, idx);
json_object *responseJ = ScanForConfig(CONTROL_CONFIG_PATH ,CTL_SCAN_RECURSIVE, json_object_get_string(oneFileJ), ".json");
@@ -242,7 +242,7 @@ json_object* LoadAdditionalsFiles(AFB_ApiT apiHandle, CtlConfigT *ctlHandle, con
{
json_object *filesJ, *filesArrayJ = json_object_new_array();
if (json_object_get_type(sectionJ) == json_type_array) {
- size_t length = json_object_array_length(sectionJ);
+ int length = json_object_array_length(sectionJ);
for (int idx=0; idx < length; idx++) {
json_object *obj = json_object_array_get_idx(sectionJ, idx);
int hasFiles = json_object_object_get_ex(obj, "files", &filesJ);