aboutsummaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2020-05-19 13:10:26 +0200
committerAleksander Morgado <aleksander@aleksander.es>2020-05-19 13:44:23 +0200
commit301b6f0a64d358706c15efff6bca676c4213c9a5 (patch)
treedbef144482679d8a2fd8c33fd8e06b3eda57c383 /plugins
parentc7dee320c004bf9508e54555d0ad9f727b449705 (diff)
plugins,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. tests/test-helpers.c: In function 'mm_test_helpers_compare_bands': tests/test-helpers.c:41:47: error: cast increases required alignment of target type [-Werror=cast-align] bands_str = mm_common_build_bands_string ((MMModemBand *)(bands->data), bands->len); ^ tests/test-helpers.c:46:56: error: cast increases required alignment of target type [-Werror=cast-align] expected_bands_str = mm_common_build_bands_string ((MMModemBand *)(expected_bands_array->data), expected_bands_array->len); ^
Diffstat (limited to 'plugins')
-rw-r--r--plugins/tests/test-helpers.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/tests/test-helpers.c b/plugins/tests/test-helpers.c
index 1fe2cdc6..8148d908 100644
--- a/plugins/tests/test-helpers.c
+++ b/plugins/tests/test-helpers.c
@@ -38,12 +38,12 @@ mm_test_helpers_compare_bands (GArray *bands,
g_assert (bands);
mm_common_bands_garray_sort (bands);
- bands_str = mm_common_build_bands_string ((MMModemBand *)(bands->data), bands->len);
+ bands_str = mm_common_build_bands_string ((MMModemBand *)(gpointer)(bands->data), bands->len);
expected_bands_array = g_array_sized_new (FALSE, FALSE, sizeof (MMModemBand), n_expected_bands);
g_array_append_vals (expected_bands_array, expected_bands, n_expected_bands);
mm_common_bands_garray_sort (expected_bands_array);
- expected_bands_str = mm_common_build_bands_string ((MMModemBand *)(expected_bands_array->data), expected_bands_array->len);
+ expected_bands_str = mm_common_build_bands_string ((MMModemBand *)(gpointer)(expected_bands_array->data), expected_bands_array->len);
g_array_unref (expected_bands_array);
g_assert_cmpstr (bands_str, ==, expected_bands_str);