aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2020-05-19 13:12:28 +0200
committerAleksander Morgado <aleksander@aleksander.es>2020-05-19 13:44:23 +0200
commitb0be4e895cc2b3b9f533b513eb4da3be99718497 (patch)
treed43fbde90ba8898b8cbfa46190d0484ff4c6b580
parent301b6f0a64d358706c15efff6bca676c4213c9a5 (diff)
telit,helpers: avoid cast-align errors
We can safely cast the data in a GArray to gpointer first, and then to the pointer type we require. telit/mm-modem-helpers-telit.c: In function 'mm_telit_build_bnd_request': telit/mm-modem-helpers-telit.c:256:55: error: cast increases required alignment of target type [-Werror=cast-align] bands_str = mm_common_build_bands_string ((const MMModemBand *)(bands_array->data), bands_array->len); ^ telit/mm-modem-helpers-telit.c:275:55: error: cast increases required alignment of target type [-Werror=cast-align] bands_str = mm_common_build_bands_string ((const MMModemBand *)(bands_array->data), bands_array->len); ^
-rw-r--r--plugins/telit/mm-modem-helpers-telit.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/telit/mm-modem-helpers-telit.c b/plugins/telit/mm-modem-helpers-telit.c
index f77afeea..b0d843b5 100644
--- a/plugins/telit/mm-modem-helpers-telit.c
+++ b/plugins/telit/mm-modem-helpers-telit.c
@@ -253,7 +253,7 @@ mm_telit_build_bnd_request (GArray *bands_array,
if (flag2g == -1) {
gchar *bands_str;
- bands_str = mm_common_build_bands_string ((const MMModemBand *)(bands_array->data), bands_array->len);
+ bands_str = mm_common_build_bands_string ((const MMModemBand *)(gconstpointer)(bands_array->data), bands_array->len);
g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_FAILED,
"Couldn't find matching 2G bands Telit value for band combination: '%s'", bands_str);
g_free (bands_str);
@@ -272,7 +272,7 @@ mm_telit_build_bnd_request (GArray *bands_array,
if (flag3g == -1) {
gchar *bands_str;
- bands_str = mm_common_build_bands_string ((const MMModemBand *)(bands_array->data), bands_array->len);
+ bands_str = mm_common_build_bands_string ((const MMModemBand *)(gconstpointer)(bands_array->data), bands_array->len);
g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_FAILED,
"Couldn't find matching 3G bands Telit value for band combination: '%s'", bands_str);
g_free (bands_str);