add --enable-more-warnings=yes/no and fix up resulting errors

This commit is contained in:
Dan Williams
2009-02-10 06:48:56 -05:00
parent 618db2dd8a
commit bef9c48ffc
18 changed files with 86 additions and 42 deletions
+23 -22
View File
@@ -254,7 +254,7 @@ modem_enable_done (MMSerial *serial,
static void
enable (MMModem *modem,
gboolean enable,
gboolean do_enable,
MMModemFn callback,
gpointer user_data)
{
@@ -263,7 +263,7 @@ enable (MMModem *modem,
info = mm_callback_info_new (modem, callback, user_data);
mm_callback_info_set_data (info, "enable", GINT_TO_POINTER (enable), NULL);
if (enable)
if (do_enable)
modem_enable_done (MM_SERIAL (modem), NULL, NULL, info);
else
mm_serial_queue_command (MM_SERIAL (modem), "AT_OWANCALL=1,0,0", 3, modem_enable_done, info);
@@ -325,28 +325,29 @@ get_ip4_config_done (MMSerial *serial,
dns_array = g_array_sized_new (FALSE, TRUE, sizeof (guint32), 2);
items = g_strsplit (response->str + strlen (OWANDATA_TAG), ", ", 0);
for (iter = items, i = 0; *iter; iter++, i++) {
if (i == 0) { /* CID */
long int tmp;
for (iter = items, i = 0; *iter; iter++, i++) {
if (i == 0) { /* CID */
long int num;
errno = 0;
tmp = strtol (*iter, NULL, 10);
if (errno != 0 || tmp < 0 || (guint) tmp != cid) {
info->error = g_error_new (MM_MODEM_ERROR, MM_MODEM_ERROR_GENERAL,
"Unknown CID in OWANDATA response (got %d, expected %d)", (guint) tmp, cid);
break;
}
} else if (i == 1) { /* IP address */
if (inet_pton (AF_INET, *iter, &tmp) > 0)
errno = 0;
num = strtol (*iter, NULL, 10);
if (errno != 0 || num < 0 || (guint) num != cid) {
info->error = g_error_new (MM_MODEM_ERROR, MM_MODEM_ERROR_GENERAL,
"Unknown CID in OWANDATA response ("
"got %d, expected %d)", (guint) num, cid);
break;
}
} else if (i == 1) { /* IP address */
if (inet_pton (AF_INET, *iter, &tmp) > 0)
mm_callback_info_set_data (info, "ip4-address", GUINT_TO_POINTER (tmp), NULL);
} else if (i == 3) { /* DNS 1 */
if (inet_pton (AF_INET, *iter, &tmp) > 0)
g_array_append_val (dns_array, tmp);
} else if (i == 4) { /* DNS 2 */
if (inet_pton (AF_INET, *iter, &tmp) > 0)
g_array_append_val (dns_array, tmp);
}
}
} else if (i == 3) { /* DNS 1 */
if (inet_pton (AF_INET, *iter, &tmp) > 0)
g_array_append_val (dns_array, tmp);
} else if (i == 4) { /* DNS 2 */
if (inet_pton (AF_INET, *iter, &tmp) > 0)
g_array_append_val (dns_array, tmp);
}
}
g_strfreev (items);
mm_callback_info_set_data (info, "ip4-dns", dns_array, free_dns_array);
+4 -4
View File
@@ -128,7 +128,7 @@ parent_enable_done (MMModem *modem, GError *error, gpointer user_data)
static void
enable (MMModem *modem,
gboolean enable,
gboolean do_enable,
MMModemFn callback,
gpointer user_data)
{
@@ -136,14 +136,14 @@ enable (MMModem *modem,
parent_modem_iface = g_type_interface_peek_parent (MM_MODEM_GET_INTERFACE (modem));
if (enable) {
if (do_enable) {
MMCallbackInfo *info;
info = mm_callback_info_new (modem, callback, user_data);
parent_modem_iface->enable (modem, enable, parent_enable_done, info);
parent_modem_iface->enable (modem, do_enable, parent_enable_done, info);
} else {
pending_registration_stop (MM_MODEM_HUAWEI (modem));
parent_modem_iface->enable (modem, enable, callback, user_data);
parent_modem_iface->enable (modem, do_enable, callback, user_data);
}
}
+2 -2
View File
@@ -234,7 +234,7 @@ disable_flash_done (MMSerial *serial, gpointer user_data)
static void
enable (MMModem *modem,
gboolean enable,
gboolean do_enable,
MMModemFn callback,
gpointer user_data)
{
@@ -245,7 +245,7 @@ enable (MMModem *modem,
info = mm_callback_info_new (modem, callback, user_data);
if (!enable) {
if (!do_enable) {
if (mm_serial_is_connected (MM_SERIAL (modem)))
mm_serial_flash (MM_SERIAL (modem), 1000, disable_flash_done, info);
else
+2 -2
View File
@@ -97,7 +97,7 @@ disable_flash_done (MMSerial *serial, gpointer user_data)
static void
enable (MMModem *modem,
gboolean enable,
gboolean do_enable,
MMModemFn callback,
gpointer user_data)
{
@@ -108,7 +108,7 @@ enable (MMModem *modem,
info = mm_callback_info_new (modem, callback, user_data);
if (!enable) {
if (!do_enable) {
if (mm_serial_is_connected (MM_SERIAL (modem)))
mm_serial_flash (MM_SERIAL (modem), 1000, disable_flash_done, info);
else
+3 -3
View File
@@ -65,7 +65,7 @@ parent_enable_done (MMModem *modem, GError *error, gpointer user_data)
static void
enable (MMModem *modem,
gboolean enable,
gboolean do_enable,
MMModemFn callback,
gpointer user_data)
{
@@ -73,10 +73,10 @@ enable (MMModem *modem,
MMCallbackInfo *info;
info = mm_callback_info_new (modem, callback, user_data);
mm_callback_info_set_data (info, "option-enable", GINT_TO_POINTER (enable), NULL);
mm_callback_info_set_data (info, "option-enable", GINT_TO_POINTER (do_enable), NULL);
parent_modem_iface = g_type_interface_peek_parent (MM_MODEM_GET_INTERFACE (modem));
parent_modem_iface->enable (modem, enable, parent_enable_done, info);
parent_modem_iface->enable (modem, do_enable, parent_enable_done, info);
}
static void
+3 -3
View File
@@ -82,7 +82,7 @@ disable_flash_done (MMSerial *serial, gpointer user_data)
static void
enable (MMModem *modem,
gboolean enable,
gboolean do_enable,
MMModemFn callback,
gpointer user_data)
{
@@ -92,9 +92,9 @@ enable (MMModem *modem,
mm_generic_gsm_set_cid (MM_GENERIC_GSM (modem), 0);
info = mm_callback_info_new (modem, callback, user_data);
mm_callback_info_set_data (info, "sierra-enable", GINT_TO_POINTER (enable), NULL);
mm_callback_info_set_data (info, "sierra-enable", GINT_TO_POINTER (do_enable), NULL);
if (!enable) {
if (!do_enable) {
if (mm_serial_is_connected (MM_SERIAL (modem)))
mm_serial_flash (MM_SERIAL (modem), 1000, disable_flash_done, info);
else
+2
View File
@@ -23,4 +23,6 @@ typedef struct {
GType mm_plugin_hso_get_type (void);
G_MODULE_EXPORT MMPlugin *mm_plugin_create (void);
#endif /* MM_PLUGIN_HSO_H */
+2
View File
@@ -23,4 +23,6 @@ typedef struct {
GType mm_plugin_huawei_get_type (void);
G_MODULE_EXPORT MMPlugin *mm_plugin_create (void);
#endif /* MM_PLUGIN_HUAWEI_H */
+2
View File
@@ -45,4 +45,6 @@ typedef struct {
GType mm_plugin_mbm_get_type (void);
G_MODULE_EXPORT MMPlugin *mm_plugin_create (void);
#endif /* MM_PLUGIN_MBM_H */
+2
View File
@@ -23,4 +23,6 @@ typedef struct {
GType mm_plugin_novatel_get_type (void);
G_MODULE_EXPORT MMPlugin *mm_plugin_create (void);
#endif /* MM_PLUGIN_NOVATEL_H */
+2
View File
@@ -23,4 +23,6 @@ typedef struct {
GType mm_plugin_option_get_type (void);
G_MODULE_EXPORT MMPlugin *mm_plugin_create (void);
#endif /* MM_PLUGIN_OPTION_H */
+2
View File
@@ -23,4 +23,6 @@ typedef struct {
GType mm_plugin_sierra_get_type (void);
G_MODULE_EXPORT MMPlugin *mm_plugin_create (void);
#endif /* MM_PLUGIN_SIERRA_H */