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-12-13 15:02:54 +0100
commit461740315df4d0aa8d90d9a42dddbf128c51939c (patch)
tree6310348d4d5d766486a670e8e2746bd903b3a539 /ctl-lib/ctl-config.c
parent1721310eb4b257338894c1a1bf364d4f8a7dd014 (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);