aboutsummaryrefslogtreecommitdiffstats
path: root/ctl-lib/ctl-config.c
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2018-04-24 15:18:45 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2018-04-25 10:14:05 +0200
commit1bca1b097f423a2b2b94b4dcf3cbacf491b070c5 (patch)
tree6310348d4d5d766486a670e8e2746bd903b3a539 /ctl-lib/ctl-config.c
parent1569d334696707c6bf6e7bba15d50c7613588faf (diff)
Format, get rid of conversion type warning.
Change-Id: I8cde66dc613fd36e7061f45918520ecd1cdf2825 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'ctl-lib/ctl-config.c')
-rw-r--r--ctl-lib/ctl-config.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/ctl-lib/ctl-config.c b/ctl-lib/ctl-config.c
index 05840f1..09ccf4a 100644
--- a/ctl-lib/ctl-config.c
+++ b/ctl-lib/ctl-config.c
@@ -118,12 +118,10 @@ PUBLIC int CtlConfigExec(AFB_ApiT apiHandle, CtlConfigT *ctlConfig) {
int errcount=0;
for (int idx = 0; ctlConfig->sections[idx].key != NULL; idx++) {
- if (!ctlConfig->sections[idx].actions) {
- AFB_ApiNotice(apiHandle, "CtlConfigLoad: notice empty section '%s'", ctlConfig->sections[idx].key);
- continue;
- }
-
- errcount += ctlConfig->sections[idx].loadCB(apiHandle, &ctlConfig->sections[idx], NULL);
+ if (!ctlConfig->sections[idx].actions)
+ AFB_ApiNotice(apiHandle, "CtlConfigLoad: notice empty section '%s'", ctlConfig->sections[idx].key);
+ else
+ errcount += ctlConfig->sections[idx].loadCB(apiHandle, &ctlConfig->sections[idx], NULL);
}
return errcount;
@@ -187,7 +185,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) {
- int length = json_object_array_length(filesJ);
+ size_t 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");
@@ -229,7 +227,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) {
- int length = json_object_array_length(sectionJ);
+ size_t 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);