aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2020-05-19 13:49:53 +0200
committerAleksander Morgado <aleksander@aleksander.es>2020-05-19 13:49:53 +0200
commit98fa83a693c24002dc0087c4304ea1143b498d1f (patch)
tree416ca967618301a6df4f566b64c43c1fed561bcc
parentb71ae9ce72e9d0e28a01ff81dabb6126def9ca0c (diff)
cinterion,tests: avoid cast-align errors
We can safely cast the data in a GArray to gpointer first, and then to the pointer type we require. cinterion/tests/test-modem-helpers-cinterion.c: In function 'common_test_scfg': cinterion/tests/test-modem-helpers-cinterion.c:56:56: error: cast increases required alignment of target type [-Werror=cast-align] expected_bands_str = mm_common_build_bands_string ((const MMModemBand *)expected_bands->data, ^ cinterion/tests/test-modem-helpers-cinterion.c:58:47: error: cast increases required alignment of target type [-Werror=cast-align] bands_str = mm_common_build_bands_string ((const MMModemBand *)bands->data, ^ cinterion/tests/test-modem-helpers-cinterion.c: In function 'common_test_scfg_response': cinterion/tests/test-modem-helpers-cinterion.c:209:56: error: cast increases required alignment of target type [-Werror=cast-align] expected_bands_str = mm_common_build_bands_string ((const MMModemBand *)expected_bands->data, ^ cinterion/tests/test-modem-helpers-cinterion.c:211:47: error: cast increases required alignment of target type [-Werror=cast-align] bands_str = mm_common_build_bands_string ((const MMModemBand *)bands->data, ^
-rw-r--r--plugins/cinterion/tests/test-modem-helpers-cinterion.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/plugins/cinterion/tests/test-modem-helpers-cinterion.c b/plugins/cinterion/tests/test-modem-helpers-cinterion.c
index 654368f9..ff21a921 100644
--- a/plugins/cinterion/tests/test-modem-helpers-cinterion.c
+++ b/plugins/cinterion/tests/test-modem-helpers-cinterion.c
@@ -53,9 +53,9 @@ common_test_scfg (const gchar *response,
mm_common_bands_garray_sort (bands);
mm_common_bands_garray_sort (expected_bands);
- expected_bands_str = mm_common_build_bands_string ((const MMModemBand *)expected_bands->data,
+ expected_bands_str = mm_common_build_bands_string ((const MMModemBand *)(gconstpointer)expected_bands->data,
expected_bands->len);
- bands_str = mm_common_build_bands_string ((const MMModemBand *)bands->data,
+ bands_str = mm_common_build_bands_string ((const MMModemBand *)(gconstpointer)bands->data,
bands->len);
/* Instead of comparing the array one by one, compare the strings built from the mask
@@ -206,9 +206,9 @@ common_test_scfg_response (const gchar *response,
mm_common_bands_garray_sort (bands);
mm_common_bands_garray_sort (expected_bands);
- expected_bands_str = mm_common_build_bands_string ((const MMModemBand *)expected_bands->data,
+ expected_bands_str = mm_common_build_bands_string ((const MMModemBand *)(gconstpointer)expected_bands->data,
expected_bands->len);
- bands_str = mm_common_build_bands_string ((const MMModemBand *)bands->data,
+ bands_str = mm_common_build_bands_string ((const MMModemBand *)(gconstpointer)bands->data,
bands->len);
/* Instead of comparing the array one by one, compare the strings built from the mask