aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastien Douheret <sebastien.douheret@iot.bzh>2018-05-25 11:16:50 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2018-06-29 19:38:23 +0200
commit16e7fd08827082449a28952f911806704396e19a (patch)
tree28a048bcc12e83056b6fcc6d4a433b275958218c
parentf4b14199af894f5c3c9769183ea4b22ab24e3eab (diff)
Fixed build warnings with gcc >= 7.3
Reduced the number of warnings in native host configuration (here Tumbleweed) in order to not hide true/real warnings that may appear in the future. Signed-off-by: Sebastien Douheret <sebastien.douheret@iot.bzh>
-rw-r--r--ctl-lib/ctl-action.c2
-rw-r--r--ctl-lib/ctl-config.c4
-rw-r--r--ctl-lib/ctl-lua.c2
-rw-r--r--ctl-lib/ctl-plugin.c4
4 files changed, 6 insertions, 6 deletions
diff --git a/ctl-lib/ctl-action.c b/ctl-lib/ctl-action.c
index 5fee49a..a13cdd6 100644
--- a/ctl-lib/ctl-action.c
+++ b/ctl-lib/ctl-action.c
@@ -337,7 +337,7 @@ CtlActionT *ActionConfig(AFB_ApiT apiHandle, json_object *actionsJ, int exportAp
// action array is close with a nullvalue;
if (json_object_is_type(actionsJ, json_type_array)) {
- int count = json_object_array_length(actionsJ);
+ int count = (int)json_object_array_length(actionsJ);
actions = calloc(count + 1, sizeof (CtlActionT));
for (int idx = 0; idx < count; idx++) {
diff --git a/ctl-lib/ctl-config.c b/ctl-lib/ctl-config.c
index 8a0b07f..cfa0963 100644
--- a/ctl-lib/ctl-config.c
+++ b/ctl-lib/ctl-config.c
@@ -205,7 +205,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);
+ int length = (int)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");
@@ -248,7 +248,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);
+ int length = (int)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);
diff --git a/ctl-lib/ctl-lua.c b/ctl-lib/ctl-lua.c
index 0123017..fe82317 100644
--- a/ctl-lib/ctl-lua.c
+++ b/ctl-lib/ctl-lua.c
@@ -114,7 +114,7 @@ static int LuaPushArgument(CtlSourceT *source, json_object *argsJ) {
}
case json_type_array:
{
- int length = json_object_array_length(argsJ);
+ int length = (int)json_object_array_length(argsJ);
lua_newtable(luaState);
for (int idx = 0; idx < length; idx++) {
json_object *val = json_object_array_get_idx(argsJ, idx);
diff --git a/ctl-lib/ctl-plugin.c b/ctl-lib/ctl-plugin.c
index 505daf1..5562b83 100644
--- a/ctl-lib/ctl-plugin.c
+++ b/ctl-lib/ctl-plugin.c
@@ -202,7 +202,7 @@ static int LoadFoundPlugins(AFB_ApiT apiHandle, json_object *scanResult, json_ob
if (!json_object_is_type(scanResult, json_type_array))
return -1;
- len = json_object_array_length(scanResult);
+ len = (int)json_object_array_length(scanResult);
for (i = 0; i < len; ++i) {
object = json_object_array_get_idx(scanResult, i);
@@ -381,7 +381,7 @@ int PluginConfig(AFB_ApiT apiHandle, CtlSectionT *section, json_object *pluginsJ
else
{
if (json_object_get_type(pluginsJ) == json_type_array) {
- length = json_object_array_length(pluginsJ);
+ length = (int)json_object_array_length(pluginsJ);
ctlPlugins = calloc (length+1, sizeof(CtlPluginT));
for (idx=0; idx < length; idx++) {
json_object *pluginJ = json_object_array_get_idx(pluginsJ, idx);