From 99f2413d29a8c1ce7b9afaadba7b7f7ca1eadb50 Mon Sep 17 00:00:00 2001 From: Simo Piiroinen Date: Mon, 7 Nov 2016 09:50:40 +0200 Subject: [PATCH] [appsync] Change appsync_stop() to take boolean parameter It is treated as a boolean, so using matching type improves readability. Signed-off-by: Simo Piiroinen --- src/usb_moded-appsync.c | 5 ++++- src/usb_moded-appsync.h | 5 ++++- src/usb_moded-modesetting.c | 7 ++++++- src/usb_moded.c | 4 ++-- 4 files changed, 16 insertions(+), 5 deletions(-) diff --git a/src/usb_moded-appsync.c b/src/usb_moded-appsync.c index bfb10b9..95baec4 100644 --- a/src/usb_moded-appsync.c +++ b/src/usb_moded-appsync.c @@ -2,8 +2,11 @@ @file usb_moded-appsync.c Copyright (C) 2010 Nokia Corporation. All rights reserved. + Copyright (C) 2013-2016 Jolla Ltd. @author: Philippe De Swert + @author: Philippe De Swert + @author: Simo Piiroinen This program is free software; you can redistribute it and/or modify it under the terms of the Lesser GNU General Public License @@ -449,7 +452,7 @@ static void appsync_stop_apps(int post) } } -int appsync_stop(int force) +int appsync_stop(gboolean force) { /* If force arg is used, stop all applications that * could have been started by usb-moded */ diff --git a/src/usb_moded-appsync.h b/src/usb_moded-appsync.h index 3cca417..f1ef638 100644 --- a/src/usb_moded-appsync.h +++ b/src/usb_moded-appsync.h @@ -1,8 +1,11 @@ /* Copyright (C) 2010 Nokia Corporation. All rights reserved. + Copyright (C) 2013-2016 Jolla Ltd. author: Philippe De Swert + author: Philippe De Swert + author: Simo Piiroinen This program is free software; you can redistribute it and/or modify it under the terms of the Lesser GNU General Public License @@ -57,6 +60,6 @@ void readlist(int diag); int activate_sync(const char *mode); int activate_sync_post(const char *mode); int mark_active(const gchar *name, int post); -int appsync_stop(int force); +int appsync_stop(gboolean force); void free_appsync_list(void); void usb_moded_appsync_cleanup(void); diff --git a/src/usb_moded-modesetting.c b/src/usb_moded-modesetting.c index 6d01f26..1f2d7fc 100644 --- a/src/usb_moded-modesetting.c +++ b/src/usb_moded-modesetting.c @@ -2,8 +2,13 @@ @file usb_moded-modesetting.c Copyright (C) 2010 Nokia Corporation. All rights reserved. + Copyright (C) 2013-2016 Jolla Ltd. @author: Philippe De Swert + @author: Philippe De Swert + @author: Bernd Wachter + @author: Slava Monich + @author: Simo Piiroinen This program is free software; you can redistribute it and/or modify it under the terms of the Lesser GNU General Public License @@ -567,7 +572,7 @@ int usb_moded_mode_cleanup(const char *module) #ifdef APP_SYNC /* Stop applications started due to entering this mode */ - appsync_stop(0); + appsync_stop(FALSE); #endif /* APP_SYNC */ if(!strcmp(module, MODULE_MASS_STORAGE)|| !strcmp(module, MODULE_FILE_STORAGE)) diff --git a/src/usb_moded.c b/src/usb_moded.c index 5c568a5..5757933 100644 --- a/src/usb_moded.c +++ b/src/usb_moded.c @@ -624,7 +624,7 @@ static void usb_moded_init(void) #ifdef APP_SYNC readlist(diag_mode); /* make sure all services are down when starting */ - appsync_stop(1); + appsync_stop(TRUE); #endif /* APP_SYNC */ /* always read dyn modes even if appsync is not used */ @@ -673,7 +673,7 @@ static gboolean charging_fallback(gpointer data) static void handle_exit(void) { /* exiting and clean-up when mainloop ended */ - appsync_stop(1); + appsync_stop(TRUE); hwal_cleanup(); usb_moded_dbus_cleanup(); #ifdef MEEGOLOCK