add --enable-more-warnings=yes/no and fix up resulting errors
This commit is contained in:
29
configure.in
29
configure.in
@@ -26,6 +26,35 @@ AC_SUBST(DBUS_SYS_DIR)
|
||||
GLIB_GENMARSHAL=`pkg-config --variable=glib_genmarshal glib-2.0`
|
||||
AC_SUBST(GLIB_GENMARSHAL)
|
||||
|
||||
AC_ARG_ENABLE(more-warnings,
|
||||
AS_HELP_STRING([--enable-more-warnings], [Maximum compiler warnings]), set_more_warnings="$enableval",set_more_warnings=yes)
|
||||
AC_MSG_CHECKING(for more warnings, including -Werror)
|
||||
if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then
|
||||
AC_MSG_RESULT(yes)
|
||||
CFLAGS="-Wall -Werror -std=gnu89 $CFLAGS"
|
||||
|
||||
for option in -Wshadow -Wmissing-declarations -Wmissing-prototypes \
|
||||
-Wdeclaration-after-statement -Wstrict-prototypes \
|
||||
-Wfloat-equal -Wno-unused-parameter -Wno-sign-compare \
|
||||
-fno-strict-aliasing; do
|
||||
SAVE_CFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS $option"
|
||||
AC_MSG_CHECKING([whether gcc understands $option])
|
||||
AC_TRY_COMPILE([], [],
|
||||
has_option=yes,
|
||||
has_option=no,)
|
||||
if test $has_option = no; then
|
||||
CFLAGS="$SAVE_CFLAGS"
|
||||
fi
|
||||
AC_MSG_RESULT($has_option)
|
||||
unset has_option
|
||||
unset SAVE_CFLAGS
|
||||
done
|
||||
unset option
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
|
||||
AC_ARG_WITH(docs, AC_HELP_STRING([--with-docs], [Build ModemManager documentation]))
|
||||
AM_CONDITIONAL(WITH_DOCS, test "x$with_docs" = "xyes")
|
||||
case $with_docs in
|
||||
|
@@ -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);
|
||||
@@ -327,13 +327,14 @@ get_ip4_config_done (MMSerial *serial,
|
||||
|
||||
for (iter = items, i = 0; *iter; iter++, i++) {
|
||||
if (i == 0) { /* CID */
|
||||
long int tmp;
|
||||
long int num;
|
||||
|
||||
errno = 0;
|
||||
tmp = strtol (*iter, NULL, 10);
|
||||
if (errno != 0 || tmp < 0 || (guint) tmp != cid) {
|
||||
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) tmp, cid);
|
||||
"Unknown CID in OWANDATA response ("
|
||||
"got %d, expected %d)", (guint) num, cid);
|
||||
break;
|
||||
}
|
||||
} else if (i == 1) { /* IP address */
|
||||
|
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -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
|
||||
|
@@ -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
|
||||
|
@@ -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
|
||||
|
@@ -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
|
||||
|
@@ -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 */
|
||||
|
@@ -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 */
|
||||
|
@@ -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 */
|
||||
|
@@ -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 */
|
||||
|
@@ -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 */
|
||||
|
@@ -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 */
|
||||
|
@@ -1,5 +1,6 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
|
||||
#include <signal.h>
|
||||
#include <syslog.h>
|
||||
#include <dbus/dbus-glib.h>
|
||||
#include "mm-manager.h"
|
||||
|
@@ -77,7 +77,7 @@ flash_done (MMSerial *serial, gpointer user_data)
|
||||
|
||||
static void
|
||||
enable (MMModem *modem,
|
||||
gboolean enable,
|
||||
gboolean do_enable,
|
||||
MMModemFn callback,
|
||||
gpointer user_data)
|
||||
{
|
||||
@@ -85,7 +85,7 @@ enable (MMModem *modem,
|
||||
|
||||
info = mm_callback_info_new (modem, callback, user_data);
|
||||
|
||||
if (!enable) {
|
||||
if (!do_enable) {
|
||||
mm_serial_close (MM_SERIAL (modem));
|
||||
mm_callback_info_schedule (info);
|
||||
return;
|
||||
|
@@ -192,7 +192,7 @@ disable_flash_done (MMSerial *serial, gpointer user_data)
|
||||
|
||||
static void
|
||||
enable (MMModem *modem,
|
||||
gboolean enable,
|
||||
gboolean do_enable,
|
||||
MMModemFn callback,
|
||||
gpointer user_data)
|
||||
{
|
||||
@@ -203,7 +203,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
|
||||
|
@@ -85,7 +85,7 @@ impl_modem_simple_connect (MMModemSimple *self,
|
||||
}
|
||||
|
||||
static void
|
||||
get_status_done (MMModem *modem,
|
||||
get_status_done (MMModemSimple *modem,
|
||||
GHashTable *properties,
|
||||
GError *error,
|
||||
gpointer user_data)
|
||||
|
@@ -93,7 +93,8 @@ mm_serial_parser_v0_parse (gpointer data,
|
||||
if (str) {
|
||||
code = atoi (str);
|
||||
g_free (str);
|
||||
}
|
||||
} else
|
||||
code = MM_MOBILE_ERROR_UNKNOWN;
|
||||
|
||||
g_match_info_free (match_info);
|
||||
|
||||
|
Reference in New Issue
Block a user