From ff2899df6ff54b128b1fd38714bb14da73383cc1 Mon Sep 17 00:00:00 2001 From: Philippe De Swert Date: Thu, 16 Aug 2012 01:28:51 +0300 Subject: [PATCH] Fix missing CFLAGS, fix warnings shown Signed-off-by: Philippe De Swert --- configure.ac | 19 +++---------------- src/usb_moded-modesetting.c | 2 -- src/usb_moded-network.c | 2 +- src/usb_moded.c | 6 ++++-- 4 files changed, 8 insertions(+), 21 deletions(-) diff --git a/configure.ac b/configure.ac index 098c054..4625f4c 100644 --- a/configure.ac +++ b/configure.ac @@ -18,22 +18,9 @@ test_gcc_flag() { return $ret } -# If using GCC specify some additional parameters -if test "x$GCC" = "xyes" ; then - # We use gnu99 instead of c99 because many have interpreted the standard - # in a way that int64_t isn't defined on non-64 bit platforms. - DESIRED_FLAGS="-std=gnu99 -Wall -W -Wextra -pedantic -pipe -Wformat -Wold-style-definition -Wdeclaration-after-statement -Wfloat-equal -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wmissing-noreturn -Wendif-labels -Wpointer-arith -Wcast-align -Wwrite-strings -Winline -Wno-unused-parameter" - - for flag in $DESIRED_FLAGS ; do - AC_MSG_CHECKING([whether $CC accepts $flag]) - if test_gcc_flag $flag ; then - CFLAGS="$CFLAGS $flag" - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - fi - done -fi +# We use gnu99 instead of c99 because many have interpreted the standard +# in a way that int64_t isn't defined on non-64 bit platforms. +CFLAGS="-std=gnu99 -Wall -W -Wextra -pedantic -pipe -Wformat -Wold-style-definition -Wdeclaration-after-statement -Wfloat-equal -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wendif-labels -Wpointer-arith -Wcast-align -Wwrite-strings -Winline -Wno-unused-parameter" AC_ARG_ENABLE([debug], AS_HELP_STRING([--enable-debug],[Enable debug @<:@default=false@:>@]), [case "${enableval}" in diff --git a/src/usb_moded-modesetting.c b/src/usb_moded-modesetting.c index d9dd736..def316c 100644 --- a/src/usb_moded-modesetting.c +++ b/src/usb_moded-modesetting.c @@ -238,8 +238,6 @@ static void report_mass_storage_blocker(const char *mountpoint, int try) /* TODO: clean up buteo-mtp hack */ int set_mtp_mode(void) { - int pid = 1; - mkdir("/dev/mtp", S_IRWXO|S_IRWXU); system("mount -t functionfs mtp -o gid=1000,mode=0770 /dev/mtp\n"); system("systemctl start buteo-mtp.service\n"); diff --git a/src/usb_moded-network.c b/src/usb_moded-network.c index 95d1412..ffaabbe 100644 --- a/src/usb_moded-network.c +++ b/src/usb_moded-network.c @@ -87,7 +87,7 @@ int usb_network_up(void) if(gateway) { - sprintf(command, "route add default gw %s %s\n", gateway); + sprintf(command, "route add default gw %s\n", gateway); system(command); } diff --git a/src/usb_moded.c b/src/usb_moded.c index 813a021..9dc3dfd 100644 --- a/src/usb_moded.c +++ b/src/usb_moded.c @@ -59,9 +59,9 @@ guint charging_timeout = 0; gboolean special_mode = FALSE; guint timeout_source = 0; #endif /* NOKIA */ -#ifdef APP_SYNC +#ifdef DYN_SYNC static GList *modelist; -#endif /* APP_SYNC */ +#endif /* DYN_SYNC */ /* static helper functions */ static gboolean set_disconnected(gpointer data); @@ -307,6 +307,8 @@ else if(!strcmp(mode, MODE_DEVELOPER)) set_usb_module(MODULE_NONE); mode = MODE_UNDEFINED; } + if(net) + log_debug("Network setting failed!\n"); free(current_mode.mode); current_mode.mode = strdup(mode); usb_moded_send_signal(get_usb_mode());