diff options
author | Aleksander Morgado <aleksander@lanedo.com> | 2012-08-28 16:55:08 +0200 |
---|---|---|
committer | Aleksander Morgado <aleksander@lanedo.com> | 2012-08-28 17:15:18 +0200 |
commit | 6b684fec5fef608eb28ab443598c3ca03f0077bc (patch) | |
tree | bfde7340a232733bde8e6b39855648fb67b85fed | |
parent | b087ba7d1d87cdc51d136eb186d984c40d04c831 (diff) |
cinterion: fix loading supported bands
-rw-r--r-- | plugins/cinterion/mm-broadband-modem-cinterion.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/plugins/cinterion/mm-broadband-modem-cinterion.c b/plugins/cinterion/mm-broadband-modem-cinterion.c index 3ec339b4..09cf7a47 100644 --- a/plugins/cinterion/mm-broadband-modem-cinterion.c +++ b/plugins/cinterion/mm-broadband-modem-cinterion.c @@ -660,18 +660,23 @@ load_supported_bands (MMIfaceModem *self, /* We do assume that we already know if the modem is 2G-only, 3G-only or * 2G+3G. This is checked quite before trying to load supported bands. */ +#define _g_array_insert_enum(array,index,type,val) do { \ + type aux = (type)val; \ + g_array_insert_val (array, index, aux); \ + } while (0) + bands = g_array_sized_new (FALSE, FALSE, sizeof (MMModemBand), 4); - g_array_index (bands, MMModemBand, 0) = MM_MODEM_BAND_EGSM; - g_array_index (bands, MMModemBand, 1) = MM_MODEM_BAND_DCS; - g_array_index (bands, MMModemBand, 2) = MM_MODEM_BAND_PCS; - g_array_index (bands, MMModemBand, 3) = MM_MODEM_BAND_G850; + _g_array_insert_enum (bands, 0, MMModemBand, MM_MODEM_BAND_EGSM); + _g_array_insert_enum (bands, 1, MMModemBand, MM_MODEM_BAND_DCS); + _g_array_insert_enum (bands, 2, MMModemBand, MM_MODEM_BAND_PCS); + _g_array_insert_enum (bands, 3, MMModemBand, MM_MODEM_BAND_G850); /* Add 3G-specific bands */ if (mm_iface_modem_is_3g (self)) { g_array_set_size (bands, 7); - g_array_index (bands, MMModemBand, 4) = MM_MODEM_BAND_U2100; - g_array_index (bands, MMModemBand, 5) = MM_MODEM_BAND_U1900; - g_array_index (bands, MMModemBand, 6) = MM_MODEM_BAND_U850; + _g_array_insert_enum (bands, 4, MMModemBand, MM_MODEM_BAND_U2100); + _g_array_insert_enum (bands, 5, MMModemBand, MM_MODEM_BAND_U1900); + _g_array_insert_enum (bands, 6, MMModemBand, MM_MODEM_BAND_U850); } g_simple_async_result_set_op_res_gpointer (result, |