From dded1b16dc18bb5b692b58d0e2e303bde7ca0308 Mon Sep 17 00:00:00 2001 From: Jonathan Aillet Date: Mon, 11 Jun 2018 20:53:27 +0200 Subject: Correct some compilation warnings Correct some compilation warnings that appeared in some gcc versions. Change-Id: I846c573f3128f7d5d5da8b7d2eb1b63dc61af1ab Signed-off-by: Jonathan Aillet --- 4a-hal/4a-hal-controllers/4a-hal-controllers-api-loader.c | 6 +++--- 4a-hal/4a-hal-controllers/4a-hal-controllers-cb.c | 2 +- 4a-hal/4a-hal-controllers/4a-hal-controllers-mixer-link.c | 2 +- 4a-hal/4a-hal-controllers/4a-hal-controllers-value-handler.c | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) (limited to '4a-hal/4a-hal-controllers') diff --git a/4a-hal/4a-hal-controllers/4a-hal-controllers-api-loader.c b/4a-hal/4a-hal-controllers/4a-hal-controllers-api-loader.c index 9eb8ef6..62c1e27 100644 --- a/4a-hal/4a-hal-controllers/4a-hal-controllers-api-loader.c +++ b/4a-hal/4a-hal-controllers/4a-hal-controllers-api-loader.c @@ -225,7 +225,7 @@ int HalCtlsCreateAllApi(AFB_ApiT apiHandle, struct HalMgrData *HalMgrGlobalData) } // We load 1st file others are just warnings - for(index = 0; index < json_object_array_length(configJ); index++) { + for(index = 0; index < (int) json_object_array_length(configJ); index++) { entryJ = json_object_array_get_idx(configJ, index); if(wrap_json_unpack(entryJ, "{s:s, s:s !}", "fullpath", &fullPath, "filename", &fileName)) { @@ -234,8 +234,8 @@ int HalCtlsCreateAllApi(AFB_ApiT apiHandle, struct HalMgrData *HalMgrGlobalData) } strncpy(filePath, fullPath, sizeof(filePath) - 1); - strncat(filePath, "/", sizeof(filePath)); - strncat(filePath, fileName, sizeof(filePath)); + strncat(filePath, "/", sizeof(filePath) - 1); + strncat(filePath, fileName, sizeof(filePath) - 1); if(HalCtlsCreateApi(apiHandle, filePath, HalMgrGlobalData) < 0) status--; diff --git a/4a-hal/4a-hal-controllers/4a-hal-controllers-cb.c b/4a-hal/4a-hal-controllers/4a-hal-controllers-cb.c index c74e7a4..7089cf3 100644 --- a/4a-hal/4a-hal-controllers/4a-hal-controllers-cb.c +++ b/4a-hal/4a-hal-controllers/4a-hal-controllers-cb.c @@ -292,7 +292,7 @@ int HalCtlsProcessAllHalMap(AFB_ApiT apiHandle, json_object *AlsaMapJ, struct Ct switch(json_object_get_type(AlsaMapJ)) { case json_type_array: - currentCtlHalAlsaMapT->ctlsCount = json_object_array_length(AlsaMapJ); + currentCtlHalAlsaMapT->ctlsCount = (unsigned int) json_object_array_length(AlsaMapJ); break; case json_type_object: diff --git a/4a-hal/4a-hal-controllers/4a-hal-controllers-mixer-link.c b/4a-hal/4a-hal-controllers/4a-hal-controllers-mixer-link.c index 059a2ac..fd1498a 100644 --- a/4a-hal/4a-hal-controllers/4a-hal-controllers-mixer-link.c +++ b/4a-hal/4a-hal-controllers/4a-hal-controllers-mixer-link.c @@ -50,7 +50,7 @@ int HalCtlsHandleMixerData(AFB_ApiT apiHandle, struct CtlHalMixerDataT *currentM currentMixerDataT->count = 1; break; case json_type_array: - currentMixerDataT->count = json_object_array_length(currentDataJ); + currentMixerDataT->count = (unsigned int) json_object_array_length(currentDataJ); break; default: currentMixerDataT->count = 0; diff --git a/4a-hal/4a-hal-controllers/4a-hal-controllers-value-handler.c b/4a-hal/4a-hal-controllers/4a-hal-controllers-value-handler.c index 2bddab6..7c493b6 100644 --- a/4a-hal/4a-hal-controllers/4a-hal-controllers-value-handler.c +++ b/4a-hal/4a-hal-controllers/4a-hal-controllers-value-handler.c @@ -69,7 +69,7 @@ int HalCtlsNormalizeJsonValues(AFB_ApiT apiHandle, struct CtlHalAlsaCtlPropertie switch(json_object_get_type(toConvertJ)) { case json_type_array: - count = json_object_array_length(toConvertJ); + count = (int) json_object_array_length(toConvertJ); break; case json_type_null: -- cgit 1.2.3-korg