From 301b6f0a64d358706c15efff6bca676c4213c9a5 Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Tue, 19 May 2020 13:10:26 +0200 Subject: 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); ^ --- plugins/tests/test-helpers.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'plugins/tests/test-helpers.c') 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); -- cgit v1.2.3-70-g09d2