pal: Fix compilation issues
Ignore unused variable warnings.
Resolve implicit fallthrough errors.
Provide correct parameters in logging.
Change-Id: I2b8a3c8c5c90b5e6182abe8b22267d221f60489f
diff --git a/Android.mk b/Android.mk
index 6ef6a81..7ae30d0 100644
--- a/Android.mk
+++ b/Android.mk
@@ -13,7 +13,7 @@
LOCAL_CFLAGS := -D_ANDROID_
LOCAL_CFLAGS += -Wno-macro-redefined
-LOCAL_CFLAGS += -Wall -Werror
+LOCAL_CFLAGS += -Wall -Werror -Wno-unused-variable -Wno-unused-parameter
LOCAL_CFLAGS += -DCONFIG_GSL
LOCAL_CFLAGS += -D_GNU_SOURCE
LOCAL_CFLAGS += -DPAL_SP_TEMP_PATH=\"/data/vendor/audio/audio.cal\"
diff --git a/context_manager/src/ContextManager.cpp b/context_manager/src/ContextManager.cpp
index 9336365..744ca59 100644
--- a/context_manager/src/ContextManager.cpp
+++ b/context_manager/src/ContextManager.cpp
@@ -154,7 +154,7 @@
}
if (rc) {
PAL_ERR(LOG_TAG, "Error:%d, Failed to get AckData for usecase:%d for see_client:%d",
- rc);
+ rc, uc_id, see_id);
goto exit;
}
@@ -1131,7 +1131,7 @@
rc = GetModuleIIDs(this->tags, tag_miid_map);
if (rc) {
- PAL_ERR(LOG_TAG, "Error:%d failed to get module iids");
+ PAL_ERR(LOG_TAG, "Error:%d failed to get module iids", rc);
goto exit;
}
/*
@@ -1151,7 +1151,7 @@
} else {
rc = -ENODATA;
PAL_ERR(LOG_TAG, "size %d too small for ack data in UsecaseACD, need %d",
- size, sizeof(asps_acd_usecase_register_ack_payload_t)
+ (int)(*size), sizeof(asps_acd_usecase_register_ack_payload_t)
+ sizeof(uint32_t) * requested_context_list->num_contexts);
}
@@ -1214,7 +1214,7 @@
ptr = (uint32_t *)data;
no_contexts = (uint32_t)ptr[0];
- PAL_VERBOSE(LOG_TAG, "Number of contexts:%d for usecase:%d, size:%d", no_contexts, this->usecase_id);
+ PAL_VERBOSE(LOG_TAG, "Number of contexts:%d for usecase:%d, size:%d", no_contexts, this->usecase_id, size);
if (size < (sizeof(uint32_t) + (no_contexts * sizeof(uint32_t)))) {
rc = -EINVAL;
@@ -1276,7 +1276,7 @@
rc = GetModuleIIDs(this->tags, tag_miid_map);
if (rc) {
- PAL_ERR(LOG_TAG, "Error:%d failed to get module iids");
+ PAL_ERR(LOG_TAG, "Error:%d failed to get module iids", rc);
goto exit;
}
@@ -1342,7 +1342,7 @@
rc = GetModuleIIDs(this->tags, tag_miid_map);
if (rc) {
- PAL_ERR(LOG_TAG, "Error:%d failed to get module iids");
+ PAL_ERR(LOG_TAG, "Error:%d failed to get module iids", rc);
goto exit;
}
diff --git a/device/src/Bluetooth.cpp b/device/src/Bluetooth.cpp
index c9ff5c4..b5e78c0 100644
--- a/device/src/Bluetooth.cpp
+++ b/device/src/Bluetooth.cpp
@@ -99,6 +99,7 @@
keyVector.push_back(std::make_pair(BT_FORMAT, AAC_ABR));
break;
}
+ [[fallthrough]];
case CODEC_TYPE_SBC:
case CODEC_TYPE_CELT:
case CODEC_TYPE_APTX:
diff --git a/session/src/ACDEngine.cpp b/session/src/ACDEngine.cpp
index 95c42a9..5d77fd6 100644
--- a/session/src/ACDEngine.cpp
+++ b/session/src/ACDEngine.cpp
@@ -693,13 +693,13 @@
if (per_stream_context_info->threshold < context_info->threshold) {
PAL_INFO(LOG_TAG, "Updated threshold value for context id 0x%x, old = %d, new = %d",
- context_info->threshold, per_stream_context_info->threshold);
+ context_id,context_info->threshold, per_stream_context_info->threshold);
context_info->threshold = per_stream_context_info->threshold;
is_confidence_value_updated_ = true;
}
if (per_stream_context_info->step_size < context_info->step_size) {
PAL_INFO(LOG_TAG, "Updated step_size for context id 0x%x, old = %d, new = %d",
- context_info->step_size, per_stream_context_info->step_size);
+ context_id,context_info->step_size, per_stream_context_info->step_size);
context_info->step_size = per_stream_context_info->step_size;
is_confidence_value_updated_ = true;
}