wavecom: avoid cast-align errors

We can safely cast the data in a GArray to gpointer first, and then
to the pointer type we require.

  wavecom/mm-broadband-modem-wavecom.c: In function 'set_bands_3g':
  wavecom/mm-broadband-modem-wavecom.c:800:50: error: cast increases required alignment of target type [-Werror=cast-align]
       bands_string = mm_common_build_bands_string ((MMModemBand *)bands_array_final->data,
                                                    ^
  wavecom/mm-broadband-modem-wavecom.c: In function 'set_bands_2g':
  wavecom/mm-broadband-modem-wavecom.c:872:50: error: cast increases required alignment of target type [-Werror=cast-align]
       bands_string = mm_common_build_bands_string ((MMModemBand *)bands_array_final->data,
                                                    ^
This commit is contained in:
Aleksander Morgado
2020-05-19 13:45:34 +02:00
parent 8bf1329481
commit b71ae9ce72

View File

@@ -797,7 +797,7 @@ set_bands_3g (GTask *task,
}
}
bands_string = mm_common_build_bands_string ((MMModemBand *)bands_array_final->data,
bands_string = mm_common_build_bands_string ((MMModemBand *)(gpointer)bands_array_final->data,
bands_array_final->len);
g_array_unref (bands_array_final);
@@ -869,7 +869,7 @@ set_bands_2g (GTask *task,
g_array_unref (supported_combination);
}
bands_string = mm_common_build_bands_string ((MMModemBand *)bands_array_final->data,
bands_string = mm_common_build_bands_string ((MMModemBand *)(gpointer)bands_array_final->data,
bands_array_final->len);
g_array_unref (bands_array_final);