Adjust coding style 54/98854/1
authorMyungki Lee <mk5004.lee@samsung.com>
Mon, 21 Nov 2016 05:15:33 +0000 (14:15 +0900)
committerMyungki Lee <mk5004.lee@samsung.com>
Mon, 21 Nov 2016 05:15:33 +0000 (14:15 +0900)
Change-Id: I39b4186396ba096f83484f9e823d9c7825aa7663
Signed-off-by: Myungki Lee <mk5004.lee@samsung.com>
src/notification.c
src/notification_error.c
src/notification_group.c
src/notification_internal.c
src/notification_noti.c
src/notification_setting_service.c

index 9a1aaca9122a0e9d2df29635e67940d674d60315..c8f950c51864440198e4060d374c53654fe96403 100755 (executable)
@@ -44,7 +44,7 @@
 #include <notification_ipc.h>
 #include <notification_internal.h>
 
-static void (*posted_toast_message_cb) (void *data);
+static void (*posted_toast_message_cb)(void *data);
 
 #define NOTI_TEXT_RESULT_LEN 2048
 #define NOTI_PKGNAME_LEN       512
@@ -56,7 +56,7 @@ char *notification_get_pkgname_by_pid(void)
        char pkgname[NOTI_PKGNAME_LEN + 1] = { 0, };
        int pid = 0, ret = AUL_R_OK;
        int fd;
-       char  *dup_pkgname;
+       char *dup_pkgname;
        char buf[NOTI_PKGNAME_LEN + 1] = { 0, };
 
        pid = getpid();
index 40ed959a814d7783973c3a7a71e3ee463afa4560..3361dddb6434bd8950b0218e2bec9304d3e2422f 100644 (file)
@@ -38,9 +38,9 @@ EXPORT_API GQuark notification_error_quark(void)
        static volatile gsize quark_volatile = 0;
        static const char *domain_name = NULL;
 
-       /* This is for preventing crash when notification api is used in ui-gadget     */
+       /* This is for preventing crash when notification api is used in ui-gadget */
        /* ui-gadget libraries can be unloaded when it is needed and the static string */
-       /* parameter to g_dbus_error_register_error_domain may cause crash.             */
+       /* parameter to g_dbus_error_register_error_domain may cause crash. */
        GQuark quark = g_quark_try_string(NOTIFICATION_ERROR_QUARK);
 
        if (quark == 0) {
index edd2c22fa0a049c987a6b0e250864527f8a0b677..fb44bbe00e3568702db0c6272324c0e411116067 100755 (executable)
@@ -28,7 +28,8 @@ static int _notification_group_check_data_inserted(const char *pkgname,
 {
        sqlite3_stmt *stmt = NULL;
        char query[NOTIFICATION_QUERY_MAX] = { 0, };
-       int ret = NOTIFICATION_ERROR_NONE, result = 0;
+       int ret;
+       int result;
 
        snprintf(query, sizeof(query),
                 "select count(*) from noti_group_data where caller_pkgname = '%s' and group_id = %d",
@@ -67,8 +68,8 @@ int notification_group_set_badge(const char *pkgname,
        sqlite3 *db;
        sqlite3_stmt *stmt = NULL;
        char query[NOTIFICATION_QUERY_MAX] = { 0, };
-       int ret = 0;
-       int result = NOTIFICATION_ERROR_NONE;
+       int ret;
+       int result;
 
        db = notification_db_open(DBPATH);
        if (!db)
@@ -127,7 +128,7 @@ int notification_group_get_badge(const char *pkgname,
        sqlite3 *db;
        sqlite3_stmt *stmt = NULL;
        char query[NOTIFICATION_QUERY_MAX] = { 0, };
-       int ret = 0;
+       int ret;
        int col = 0;
 
        db = notification_db_open(DBPATH);
index dac1bb88eedabddfb8854a13ab4925c7402a2f11..78a5314ccc016b6876679a23dbbfbf7d1976d4a2 100755 (executable)
@@ -392,7 +392,6 @@ EXPORT_API int notification_update_content(notification_h noti,
                        return NOTIFICATION_ERROR_INVALID_PARAMETER;
                else
                        input_priv_id = noti->priv_id;
-
        } else {
                input_priv_id = priv_id;
        }
@@ -425,22 +424,22 @@ EXPORT_API int notification_set_icon(notification_h noti,
 EXPORT_API int notification_get_icon(notification_h noti,
                char **icon_path)
 {
-       int ret_err = NOTIFICATION_ERROR_NONE;
+       int ret = NOTIFICATION_ERROR_NONE;
        char *ret_image_path = NULL;
 
-       ret_err = notification_get_image(noti, NOTIFICATION_IMAGE_TYPE_ICON,
+       ret = notification_get_image(noti, NOTIFICATION_IMAGE_TYPE_ICON,
                                &ret_image_path);
 
-       if (ret_err == NOTIFICATION_ERROR_NONE && icon_path != NULL)
+       if (ret == NOTIFICATION_ERROR_NONE && icon_path != NULL)
                *icon_path = ret_image_path;
 
-       return ret_err;
+       return ret;
 }
 /* LCOV_EXCL_STOP */
 
 EXPORT_API int notification_translate_localized_text(notification_h noti)
 {
-       int noti_err = NOTIFICATION_ERROR_NONE;
+       int ret = NOTIFICATION_ERROR_NONE;
        char *ret_text = NULL;
        char buf_key[32];
        char *bundle_val = NULL;
@@ -449,8 +448,8 @@ EXPORT_API int notification_translate_localized_text(notification_h noti)
        notification_text_type_e type = NOTIFICATION_TEXT_TYPE_TITLE;
 
        for (; type < NOTIFICATION_TEXT_TYPE_MAX; type++) {
-               noti_err = notification_get_text(noti, type, &ret_text);
-               if (noti_err == NOTIFICATION_ERROR_NONE && ret_text) {
+               ret = notification_get_text(noti, type, &ret_text);
+               if (ret == NOTIFICATION_ERROR_NONE && ret_text) {
                        if (noti->b_text == NULL) {
                                noti->b_text = bundle_create();
                                if (noti->b_text == NULL)
@@ -475,7 +474,7 @@ EXPORT_API int notification_translate_localized_text(notification_h noti)
                }
        }
 
-       return noti_err;
+       return ret;
 }
 
 /* LCOV_EXCL_START */
@@ -494,10 +493,10 @@ EXPORT_API int notification_get_title(notification_h noti,
                char **title,
                char **loc_title)
 {
-       int noti_err = NOTIFICATION_ERROR_NONE;
+       int ret;
        char *ret_text = NULL;
 
-       noti_err = notification_get_text(noti, NOTIFICATION_TEXT_TYPE_TITLE,
+       ret = notification_get_text(noti, NOTIFICATION_TEXT_TYPE_TITLE,
                                &ret_text);
 
        if (title != NULL)
@@ -506,7 +505,7 @@ EXPORT_API int notification_get_title(notification_h noti,
        if (loc_title != NULL)
                *loc_title = NULL;
 
-       return noti_err;
+       return ret;
 }
 /* LCOV_EXCL_STOP */
 
@@ -526,10 +525,10 @@ EXPORT_API int notification_get_content(notification_h noti,
                char **content,
                char **loc_content)
 {
-       int noti_err = NOTIFICATION_ERROR_NONE;
+       int ret;
        char *ret_text = NULL;
 
-       noti_err = notification_get_text(noti, NOTIFICATION_TEXT_TYPE_CONTENT,
+       ret = notification_get_text(noti, NOTIFICATION_TEXT_TYPE_CONTENT,
                                &ret_text);
 
        if (content != NULL)
@@ -538,7 +537,7 @@ EXPORT_API int notification_get_content(notification_h noti,
        if (loc_content != NULL)
                *loc_content = NULL;
 
-       return noti_err;
+       return ret;
 }
 /* LCOV_EXCL_STOP */
 
index 8b89f1e48ed6edc12aa0411160997d5eaa1d11d5..440f3742a90891c970071b4bcff52c133f081823 100755 (executable)
@@ -778,9 +778,9 @@ static int _handle_do_not_disturb_option(notification_h noti)
 
                if (do_not_disturb_exception == false) {
                        /* do_not_disturb is ON and do_not_disturb_exception is OFF */
-                       /* Then add this notification only on quick panel and indicator*/
+                       /* Then add this notification only on quick panel and indicator */
                        noti->display_applist = noti->display_applist & (NOTIFICATION_DISPLAY_APP_NOTIFICATION_TRAY | NOTIFICATION_DISPLAY_APP_INDICATOR);
-                       /* and reset all sound and vibration and led options*/
+                       /* and reset all sound and vibration and led options */
                        noti->sound_type = NOTIFICATION_SOUND_TYPE_NONE;
                        SAFE_FREE(noti->sound_path);
                        noti->vibration_type = NOTIFICATION_VIBRATION_TYPE_NONE;
@@ -1223,7 +1223,8 @@ EXPORT_API int notification_noti_delete_all(notification_type_e type, const char
 {
        int ret = NOTIFICATION_ERROR_NONE;
        int ret_tmp = NOTIFICATION_ERROR_NONE;
-       int i = 0, data_cnt = 0;
+       int i = 0;
+       int data_cnt = 0;
        sqlite3 *db = NULL;
        sqlite3_stmt *stmt = NULL;
        char buf[128] = { 0, };
@@ -1240,7 +1241,6 @@ EXPORT_API int notification_noti_delete_all(notification_type_e type, const char
                if (type != NOTIFICATION_TYPE_NONE)
                        snprintf(query_where, sizeof(query_where),
                                 "where type = %d and uid = %d", type, uid);
-
        } else {
                if (type == NOTIFICATION_TYPE_NONE)
                        snprintf(query_where, sizeof(query_where),
@@ -1307,7 +1307,6 @@ EXPORT_API int notification_noti_delete_all(notification_type_e type, const char
                                        query_where[0] = '\0';
                                        if (ret == NOTIFICATION_ERROR_NONE)
                                                ret = ret_tmp;
-
                                }
                                snprintf(buf, sizeof(buf) - 1, "%s%d", (i % NOTI_BURST_DELETE_UNIT == 0) ? "" : ",", *((*list_deleted_rowid) + i));
                                strncat(query_where, buf, sizeof(query_where) - strlen(query_where) - 1);
@@ -1325,7 +1324,6 @@ EXPORT_API int notification_noti_delete_all(notification_type_e type, const char
 
                if (num_deleted != NULL)
                        *num_deleted = data_cnt;
-
        } else {
                /* Make main query */
                snprintf(query_base, sizeof(query_base), "delete from noti_list ");
@@ -1335,7 +1333,6 @@ EXPORT_API int notification_noti_delete_all(notification_type_e type, const char
 
                if (num_deleted != NULL)
                        *num_deleted = sqlite3_changes(db);
-
        }
 
 err:
@@ -1378,7 +1375,7 @@ EXPORT_API int notification_noti_delete_by_priv_id(const char *pkgname, int priv
 EXPORT_API int notification_noti_delete_by_priv_id_get_changes(const char *pkgname, int priv_id, int *num_changes, uid_t uid)
 {
        sqlite3 *db = NULL;
-       char query[NOTIFICATION_QUERY_MAX] = {0, };
+       char query[NOTIFICATION_QUERY_MAX] = { 0, };
        int ret;
 
        db = notification_db_open(DBPATH);
@@ -1512,7 +1509,6 @@ err:
        if (stmt)
                sqlite3_finalize(stmt);
 
-
        if (db)
                notification_db_close(&db);
 
index d7f7fd27b58d957eec213eeb9038f49766afd7ad..8fe0fc190f9a1426dd2cab6a4b4c0d878166ce8d 100644 (file)
@@ -475,7 +475,6 @@ return_close_db:
        if (db_statement)
                sqlite3_finalize(db_statement);
 
-
        if (db) {
                if (err == NOTIFICATION_ERROR_NONE)
                        sqlite3_exec(db, "END;", NULL, NULL, NULL);
@@ -792,10 +791,12 @@ EXPORT_API int notification_system_setting_update_dnd_allow_exception(int type,
 out:
        if (db_statement)
                sqlite3_finalize(db_statement);
+
        if (ret == NOTIFICATION_ERROR_NONE)
                sqlite3_exec(db, "END;", NULL, NULL, NULL);
        else
                sqlite3_exec(db, "ROLLBACK;", NULL, NULL, NULL);
+
        notification_db_close(&db);
 
        return ret;
@@ -843,8 +844,10 @@ EXPORT_API int noti_system_setting_get_do_not_disturb(int *do_not_disturb, uid_t
 out:
        if (query_result)
                sqlite3_free_table(query_result);
+
        if (query)
                sqlite3_free(query);
+
        if (db)
                notification_db_close(&db);