Skip to content

Commit

Permalink
Fix missing CFLAGS, fix warnings shown
Browse files Browse the repository at this point in the history
Signed-off-by: Philippe De Swert <philippedeswert@gmail.com>
  • Loading branch information
philippedeswert committed Aug 15, 2012
1 parent 5ae0b87 commit ff2899d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 21 deletions.
19 changes: 3 additions & 16 deletions configure.ac
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions src/usb_moded-modesetting.c
Expand Up @@ -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");
Expand Down
2 changes: 1 addition & 1 deletion src/usb_moded-network.c
Expand Up @@ -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);
}

Expand Down
6 changes: 4 additions & 2 deletions src/usb_moded.c
Expand Up @@ -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);
Expand Down Expand Up @@ -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());
Expand Down

0 comments on commit ff2899d

Please sign in to comment.