Fix boolean notation 55/206655/3
authorMinje Ahn <minje.ahn@samsung.com>
Wed, 22 May 2019 23:07:03 +0000 (08:07 +0900)
committerMinje Ahn <minje.ahn@samsung.com>
Thu, 23 May 2019 05:28:22 +0000 (14:28 +0900)
Change-Id: Ia9ea48b4b68d5a5a891eb9cb42973bff5c5910b6
Signed-off-by: Minje Ahn <minje.ahn@samsung.com>
16 files changed:
lib/include/media-util-internal.h
lib/media-util-noti-internal.c
lib/media-util-register.c
src/common/include/media-common-types.h
src/common/media-common-db-svc.c
src/mediadb-update.c
src/scanner-v2/media-scanner-device-block-v2.c
src/scanner-v2/media-scanner-extract-v2.c
src/scanner-v2/media-scanner-scan-v2.c
src/scanner-v2/media-scanner-v2.c
src/scanner/media-scanner-scan.c
src/server/media-server-db-manage.c
src/server/media-server-db.c
src/server/media-server-device-block.c
src/server/media-server-main.c
src/server/media-server-socket.c

index b5b9fe7..119ae69 100755 (executable)
@@ -31,7 +31,7 @@
                                                        else { src = malloc(size); if (src) memset(src, 0x0, size); } }
 
 #define MS_SQL_SAFE_FREE(x)    {if (x != NULL) {sqlite3_free(x); x = NULL; } }
-#define MS_STRING_VALID(str)   ((str != NULL && strlen(str) > 0) ? TRUE : FALSE)
+#define MS_STRING_VALID(str)   ((str != NULL && strlen(str) > 0) ? true : false)
 #define SAFE_STRLCPY(dst, src, n)      g_strlcpy(dst, src, n);
 
 int media_db_update_db(sqlite3 *handle, const char *query_str);
index f6e5539..b1e6bb7 100755 (executable)
@@ -123,7 +123,7 @@ static bool __gdbus_message_is_signal(const char *iface, const char *signal)
        if ((strcmp(iface, MS_MEDIA_DBUS_INTERFACE) == 0) && (strcmp(signal, MS_MEDIA_DBUS_NAME_INTERNAL) == 0))
                return TRUE;
 
-       return FALSE;
+       return false;
 }
 
 static void __get_message_internal(GVariant *message, db_update_cb user_cb, void *userdata)
index d2a5d97..1c0ee4d 100755 (executable)
@@ -453,7 +453,7 @@ int media_directory_scanning_async(const char *directory_path, const char *stora
        ret = _check_dir_path(directory_path, uid);
        MSAPI_RETV_IF(ret != MS_MEDIA_ERR_NONE, ret);
 
-       if (recursive_on == TRUE)
+       if (recursive_on)
                ret = __media_db_request_update_async(MS_MSG_DIRECTORY_SCANNING, storage_id, directory_path, user_callback, user_data, uid);
        else
                ret = __media_db_request_update_async(MS_MSG_DIRECTORY_SCANNING_NON_RECURSIVE, storage_id, directory_path, user_callback, user_data, uid);
index 8b7242d..dab94d6 100755 (executable)
@@ -61,7 +61,7 @@ typedef enum {
 #define MS_MALLOC(src, size)   { if (size > SIZE_MAX || size <= 0) src = NULL; \
                                                        else { src = malloc(size); if (src) memset(src, 0x0, size); } }
 #define MS_STRING_VALID(str)   \
-                                                               ((str != NULL && strlen(str) > 0) ? TRUE : FALSE)
+                                                               ((str != NULL && strlen(str) > 0) ? true : false)
 #define SAFE_STRLCPY(dst, src, n)      g_strlcpy(dst, src, n);
 #define SAFE_STRLCAT(dst, src, n)      g_strlcat(dst, src, n);
 
index 9f03be9..a5b0d6f 100755 (executable)
@@ -366,9 +366,9 @@ int __ms_check_item_exist(sqlite3 *handle, const char *storage_id, const char *p
                memset(&st, 0, sizeof(struct stat));
                if (stat(path, &st) == 0) {
                        if ((st.st_mtime != modified_time) || (st.st_size != file_size))
-                               *modified = TRUE;
+                               *modified = true;
                        else
-                               *modified = FALSE;
+                               *modified = false;
                }
        }
 
@@ -381,7 +381,7 @@ int ms_validate_item(sqlite3 *handle, const char *storage_id, const char *path,
 {
        int lib_index;
        int ret = MS_MEDIA_ERR_NONE;
-       bool modified = FALSE;
+       bool modified = false;
 
        for (lib_index = 0; lib_index < lib_num; lib_index++) {
                /*check exist in Media DB, If file is not exist, insert data in DB. */
@@ -389,7 +389,7 @@ int ms_validate_item(sqlite3 *handle, const char *storage_id, const char *path,
                if (ret == MS_MEDIA_ERR_DB_NO_RECORD) {
                        ret = ms_insert_item_batch(handle, storage_id, path, uid);
                } else if (ret == MS_MEDIA_ERR_NONE) {
-                       if (modified == FALSE) {
+                       if (!modified) {
                                /*if meta data of file exist, change valid field to "1" */
                                ret = ((SET_ITEM_VALIDITY)func_array[lib_index][eSET_VALIDITY])(storage_id, path, true, true, uid); /*dlopen*/
                                MS_DBG_RETVM_IF(ret != MS_MEDIA_ERR_NONE, ret, "Error : %s [%s]", g_array_index(so_array, char*, lib_index), path);
@@ -410,7 +410,7 @@ int ms_scan_validate_item(sqlite3 *handle, const char *storage_id, const char *p
 {
        int lib_index;
        int ret = MS_MEDIA_ERR_NONE;
-       bool modified = FALSE;
+       bool modified = false;
 
        for (lib_index = 0; lib_index < lib_num; lib_index++) {
                /*check exist in Media DB, If file is not exist, insert data in DB. */
@@ -418,7 +418,7 @@ int ms_scan_validate_item(sqlite3 *handle, const char *storage_id, const char *p
                if (ret == MS_MEDIA_ERR_DB_NO_RECORD) {
                        ret = ms_scan_item_batch(handle, storage_id, path, uid);
                } else if (ret == MS_MEDIA_ERR_NONE) {
-                       if (modified == FALSE) {
+                       if (!modified) {
                                /*if meta data of file exist, change valid field to "1" */
                                ret = ((SET_ITEM_VALIDITY)func_array[lib_index][eSET_VALIDITY])(storage_id, path, true, true, uid); /*dlopen*/
                                MS_DBG_RETVM_IF(ret != MS_MEDIA_ERR_NONE, ret, "Error : %s [%s]", g_array_index(so_array, char*, lib_index), path);
index 6d0a063..bc89b35 100755 (executable)
@@ -189,7 +189,7 @@ int main(int argc, char **argv)
                                else
                                        strncpy(req_path, argv1, len);
                        }
-                       ret = dir_scan(req_path, FALSE);
+                       ret = dir_scan(req_path, false);
                        if (ret != 0) {
                                printf("error : %d\n", ret);
                                exit(0);
@@ -211,7 +211,7 @@ int main(int argc, char **argv)
                                                strncpy(req_path, argv2, len);
                                }
 
-                               ret = dir_scan(req_path, TRUE);
+                               ret = dir_scan(req_path, true);
                                if (ret != 0) {
                                        printf("error : %d\n", ret);
                                        exit(0);
index 28942fd..93cc0a4 100755 (executable)
@@ -41,7 +41,7 @@ static void __msc_usb_remove_event(const char *mount_path)
 
        int update_status = -1;
        int remain_request = 0;
-       bool status = FALSE;
+       bool status = false;
 
        if (!ms_config_get_int(VCONFKEY_FILEMANAGER_DB_STATUS, &update_status))
                MS_DBG_ERR("ms_config_get_int[VCONFKEY_FILEMANAGER_DB_STATUS]");
@@ -55,10 +55,10 @@ static void __msc_usb_remove_event(const char *mount_path)
 
 
        if (msc_get_dir_scan_status(&status) == MS_MEDIA_ERR_NONE) {
-               if (status == TRUE)
+               if (status)
                        MS_DBG_WARN("Doing directory scanning");
 
-               status = FALSE;
+               status = false;
        }
 
        if (msc_get_remain_extract_request(MS_EXTRACT_STORAGE, &remain_request) == MS_MEDIA_ERR_NONE) {
@@ -69,11 +69,11 @@ static void __msc_usb_remove_event(const char *mount_path)
        }
 
        if (msc_get_dir_scan_status(&status) == MS_MEDIA_ERR_NONE) {
-               if (status == true) {
+               if (status) {
                        MS_DBG_WARN("Doing directory extracting. Set cancel path");
                        msc_set_extract_cancel_path(mount_path);
                }
-               status = FALSE;
+               status = false;
        }
 
        return;
index e5ab30f..426ea2a 100755 (executable)
@@ -442,8 +442,8 @@ gboolean msc_storage_extract_thread(void *data)
                        msc_remove_extract_request(extract_data);
                        goto STOP_DISC;
                }
-               if (extract_data->result == TRUE) {
-                       MS_DBG_WARN("extract_data->result == TRUE, MS_STORAGE_SCAN_COMPLETE");
+               if (extract_data->result) {
+                       MS_DBG_WARN("extract_data->result is true, MS_STORAGE_SCAN_COMPLETE");
                        msc_del_extract_blocked_path(update_path);
                        ms_set_storage_scan_status(handle, extract_data->storage_id, MEDIA_EXTRACT_COMPLETE, uid);
                        __msc_set_storage_extract_status(MS_STORAGE_SCAN_COMPLETE);
index 281449f..035f803 100755 (executable)
@@ -317,8 +317,8 @@ static int __msc_dir_scan_for_folder(sqlite3 *handle, const char *storage_id, co
                        goto STOP_SCAN;
                }
 
-               ms_batch_commit_disable(TRUE, TRUE, uid);
-               ms_batch_commit_enable(TRUE, TRUE, FALSE, pid);
+               ms_batch_commit_disable(true, true, uid);
+               ms_batch_commit_enable(true, true, false, pid);
                /* get the current path from directory array */
                current_path = g_array_index(dir_array , char*, 0);
                g_array_remove_index(dir_array, 0);
@@ -495,7 +495,7 @@ static int __msc_dir_scan_for_folder(sqlite3 *handle, const char *storage_id, co
                                                        //MS_DBG_ERR("storage_id = [%s]", storage_id);
                                                        ret = __msc_check_stop_status(scan_type, new_start_path, pid);
                                                        if (ret == MS_MEDIA_ERR_NONE) {
-                                                               msc_insert_exactor_request(scan_type, FALSE, storage_id, current_path, pid, uid, MS_ITEM_UPDATE);
+                                                               msc_insert_exactor_request(scan_type, false, storage_id, current_path, pid, uid, MS_ITEM_UPDATE);
                                                        } else {
                                                                if (is_recursive == true)
                                                                        ms_change_validity_item_batch(handle, storage_id, new_start_path, 1, 2, uid);
@@ -570,7 +570,7 @@ END_SCAN:
 
        __msc_clear_file_list(dir_array);
 
-       ms_batch_commit_disable(TRUE, TRUE, uid);
+       ms_batch_commit_disable(true, true, uid);
 
        if (ret != MS_MEDIA_ERR_NONE) MS_DBG_INFO("ret : %d", ret);
 
@@ -623,7 +623,7 @@ static int __msc_dir_scan_for_storage(sqlite3 *handle, const char *storage_id, c
 
        scan_function = (scan_type == MS_MSG_STORAGE_ALL) ? ms_scan_item_batch : ms_scan_validate_item;
 
-       ms_batch_commit_disable(TRUE, TRUE, uid);
+       ms_batch_commit_disable(true, true, uid);
        /*start db update. the number of element in the array , db update is complete.*/
        while (dir_array->len != 0) {
                /*check poweroff status*/
@@ -631,8 +631,8 @@ static int __msc_dir_scan_for_storage(sqlite3 *handle, const char *storage_id, c
                if (ret != MS_MEDIA_ERR_NONE)
                        goto STOP_SCAN;
 
-               /*ms_batch_commit_disable(handle, TRUE, TRUE, uid);*/
-               ms_batch_commit_enable(TRUE, TRUE, FALSE, pid);
+               /*ms_batch_commit_disable(true, true, uid);*/
+               ms_batch_commit_enable(true, true, false, pid);
 
                /* get the current path from directory array */
                current_path = g_array_index(dir_array , char*, 0);
@@ -791,7 +791,7 @@ static int __msc_dir_scan_for_storage(sqlite3 *handle, const char *storage_id, c
                                                if (scan_count >= MAX_SCAN_COUNT) {
                                                        scan_count = 0;
                                                        //MS_DBG_ERR("storage_id = [%s]", storage_id);
-                                                       msc_insert_exactor_request(scan_type, FALSE, storage_id, current_path, 0, uid, MS_ITEM_UPDATE);
+                                                       msc_insert_exactor_request(scan_type, false, storage_id, current_path, 0, uid, MS_ITEM_UPDATE);
                                                }
                                        }
                                } else if (d->d_type == DT_DIR) {
@@ -810,7 +810,7 @@ static int __msc_dir_scan_for_storage(sqlite3 *handle, const char *storage_id, c
 
                ms_insert_folder_end(uid);
                /*commit to db before set scan done, fix timing issue storage scan, then folder scan for same folder*/
-               ms_batch_commit_disable(TRUE, TRUE, uid);
+               ms_batch_commit_disable(true, true, uid);
                ms_set_folder_scan_status(handle, storage_id, current_path, MS_DIR_SCAN_DONE, uid);
 
                if (fd != -1) {
@@ -897,7 +897,7 @@ EXIT:
        __msc_set_storage_scan_cur_path(NULL);
        __msc_clear_file_list(dir_array);
 
-       ms_batch_commit_disable(TRUE, TRUE, uid);
+       ms_batch_commit_disable(true, true, uid);
 
        if (ret != MS_MEDIA_ERR_NONE) MS_DBG_INFO("ret : %d", ret);
 
@@ -1084,7 +1084,7 @@ gboolean msc_directory_scan_thread(void *data)
        sqlite3 *handle = NULL;
        int scan_type;
        char *storage_id = NULL;
-       bool modified = FALSE;
+       bool modified = false;
        ms_user_storage_type_e storage_type = MS_USER_STORAGE_INTERNAL;
        ms_dir_scan_status_e scan_status = MS_DIR_SCAN_NONE;
        ms_noti_type_e noti_type = MS_ITEM_INSERT;
@@ -1216,7 +1216,7 @@ gboolean msc_directory_scan_thread(void *data)
                        g_directory_scan_processing2 = DIR_SCAN_NON_RECURSIVE;
                        ms_check_folder_modified(handle, scan_data->msg, storage_id, &modified);
 
-                       if (modified == FALSE) {
+                       if (!modified) {
                                MS_DBG_WARN("check [%.*s] has not been modified !!", MAX_MSG_SIZE, scan_data->msg);
                                ms_get_folder_scan_status(handle, storage_id, scan_data->msg, (int*)&scan_status);
                                MS_DBG_WARN("folder scan status = [%d]", scan_status);
@@ -1265,7 +1265,7 @@ gboolean msc_directory_scan_thread(void *data)
                        MS_DBG_ERR("error : %d", err);
 
                /*call for bundle commit*/
-               ms_batch_commit_enable(TRUE, TRUE, FALSE, 0);
+               ms_batch_commit_enable(true, true, false, 0);
 
                if (strcmp(scan_data->msg, MEDIA_ROOT_PATH_DISC) == 0) {
                        MS_DBG("[DATA DISC]");
@@ -1276,7 +1276,7 @@ gboolean msc_directory_scan_thread(void *data)
                ret = __msc_db_update(handle, storage_id, scan_data);
 
                /*call for bundle commit*/
-               ms_batch_commit_disable(TRUE, TRUE, uid);
+               ms_batch_commit_disable(true, true, uid);
 
                MS_DBG_WARN("folder scan done, sent cb event path = [%.*s]", MAX_MSG_SIZE, scan_data->msg);
                __msc_call_dir_scan_cb();
@@ -1309,7 +1309,7 @@ SCAN_DONE:
                        if (noti_type == MS_ITEM_DELETE) {
                                ms_send_dir_update_noti(scan_data->msg, folder_uuid, noti_type, scan_data->pid);
                        }
-                       msc_insert_exactor_request(scan_data->msg_type, TRUE, scan_data->storage_id, scan_data->msg, scan_data->pid, uid, noti_type);
+                       msc_insert_exactor_request(scan_data->msg_type, true, scan_data->storage_id, scan_data->msg, scan_data->pid, uid, noti_type);
                }
                if (power_off2) {
                        MS_DBG_ERR("power off");
@@ -1383,7 +1383,7 @@ gboolean msc_storage_scan_thread(void *data)
        sqlite3 *handle = NULL;
        ms_user_storage_type_e storage_type = MS_USER_STORAGE_INTERNAL;
        int scan_type;
-       bool valid_status = TRUE;
+       bool valid_status = true;
        char *update_path = NULL;
        uid_t uid = MEDIA_DEFAULT_UID;
 
@@ -1433,7 +1433,7 @@ gboolean msc_storage_scan_thread(void *data)
                if (ret != MS_MEDIA_ERR_NONE) {
                        ms_set_storage_scan_status(handle, scan_data->storage_id, MEDIA_SCAN_STOP, uid);
                        MS_DBG_ERR("storage_id = [%s]", scan_data->storage_id);
-                       msc_insert_exactor_request(scan_type, TRUE, scan_data->storage_id, scan_data->msg, scan_data->pid, uid, MS_ITEM_UPDATE);
+                       msc_insert_exactor_request(scan_type, true, scan_data->storage_id, scan_data->msg, scan_data->pid, uid, MS_ITEM_UPDATE);
                        goto NEXT;
                }
 
@@ -1447,10 +1447,10 @@ gboolean msc_storage_scan_thread(void *data)
                        msc_set_disc_stg_scan_status(true);
                }
 
-               valid_status = (scan_type == MS_MSG_STORAGE_PARTIAL || MS_MSG_STORAGE_ALL == scan_type) ? TRUE : FALSE;
+               valid_status = (scan_type == MS_MSG_STORAGE_PARTIAL || MS_MSG_STORAGE_ALL == scan_type) ? true : false;
 
                if (scan_type != MS_MSG_STORAGE_INVALID)
-                       ms_batch_commit_enable(TRUE, valid_status, FALSE, 0);
+                       ms_batch_commit_enable(true, valid_status, false, 0);
 
                if (scan_type == MS_MSG_STORAGE_ALL) {
                        /* Delete all data before full scanning */
@@ -1462,7 +1462,7 @@ gboolean msc_storage_scan_thread(void *data)
 
                /*call for bundle commit*/
                if (scan_type != MS_MSG_STORAGE_INVALID)
-                       ms_batch_commit_disable(TRUE, valid_status, uid);
+                       ms_batch_commit_disable(true, valid_status, uid);
 
                if (scan_type == MS_MSG_STORAGE_PARTIAL && ret == MS_MEDIA_ERR_NONE) {
                        /*delete invalid folder first, then delete invalid item, avoid to folder was deleted but item not when unmount*/
@@ -1484,7 +1484,7 @@ gboolean msc_storage_scan_thread(void *data)
                }
 
                MS_DBG_WARN("storage_id = [%s]", scan_data->storage_id);
-               msc_insert_exactor_request(scan_type, TRUE, scan_data->storage_id, scan_data->msg, scan_data->pid, uid, MS_ITEM_UPDATE);
+               msc_insert_exactor_request(scan_type, true, scan_data->storage_id, scan_data->msg, scan_data->pid, uid, MS_ITEM_UPDATE);
 
 NEXT:
                msc_del_blocked_path();
@@ -1615,7 +1615,7 @@ static int __msc_batch_insert(int pid, GArray *path_array, uid_t uid)
        sqlite3 *handle = NULL;
        char *insert_path = NULL;
        char storage_id[MS_UUID_SIZE] = {0,};
-       bool power_off_status = FALSE;
+       bool power_off_status = false;
 
        /* connect to media db, if conneting is failed, db updating is stopped */
        err = ms_connect_db(&handle, uid);
@@ -1624,7 +1624,7 @@ static int __msc_batch_insert(int pid, GArray *path_array, uid_t uid)
 
        /*start db updating */
        /*call for bundle commit*/
-       ms_batch_commit_enable(TRUE, FALSE, TRUE, pid);
+       ms_batch_commit_enable(true, false, true, pid);
 
        MS_DBG_WARN("BULK REGISTER START");
 
@@ -1652,7 +1652,7 @@ static int __msc_batch_insert(int pid, GArray *path_array, uid_t uid)
        }
 
        /*call for bundle commit*/
-       ms_batch_commit_disable(TRUE, FALSE, uid);
+       ms_batch_commit_disable(true, false, uid);
 
        /*disconnect form media db*/
        if (handle) ms_disconnect_db(handle);
@@ -2031,7 +2031,7 @@ int msc_stop_scan_thread(void)
 {
        ms_comm_msg_s *data = NULL;
 
-       msc_set_power_status(TRUE);
+       msc_set_power_status(true);
 
        if (scan_queue2) {
                /*notify to scannig thread*/
index d849d8d..ff206c6 100755 (executable)
@@ -51,7 +51,7 @@ extern GAsyncQueue *folder_extract_queue;
 extern GMutex scan_req_mutex2;
 extern int g_directory_scan_processing2;
 extern bool g_directory_extract_processing;
-bool power_off2; /*If this is TRUE, poweroff notification received*/
+bool power_off2; /*If this is true, poweroff notification received*/
 
 static GMainLoop *scanner_mainloop2 = NULL;
 
index 54a4e3d..2c459b4 100755 (executable)
@@ -186,7 +186,7 @@ static int __msc_db_update(sqlite3 *handle, const char *storage_id, const ms_com
                if (err != MS_MEDIA_ERR_NONE)
                        MS_DBG_ERR("error : %d", err);
 
-               ms_set_folder_validity(handle, storage_id, start_path, 0, TRUE, scan_data->uid);
+               ms_set_folder_validity(handle, storage_id, start_path, 0, true, scan_data->uid);
 
                MS_SAFE_FREE(start_path);
        }
@@ -295,14 +295,14 @@ gboolean msc_directory_scan_thread(void *data)
                }
                start_path = g_strdup(scan_data->msg);
 
-               ms_batch_commit_enable(TRUE, TRUE, FALSE, 0);
+               ms_batch_commit_enable(true, true, false, 0);
 
                if (noti_type == MS_ITEM_INSERT)
                        ret = __msc_dir_scan(handle, storage_id, start_path, false, is_recursive, scan_data->uid);
                else
                        ret = __msc_dir_scan(handle, storage_id, start_path, true, is_recursive, scan_data->uid);
 
-               ms_batch_commit_disable(TRUE, TRUE, scan_data->uid);
+               ms_batch_commit_disable(true, true, scan_data->uid);
 
                if (!ms_delete_invalid_items(handle, storage_id, scan_data->uid))
                        MS_DBG_ERR("deleting invalid items in storage failed");
@@ -353,7 +353,7 @@ gboolean msc_storage_scan_thread(void *data)
        sqlite3 *handle = NULL;
        ms_user_storage_type_e storage_type = MS_USER_STORAGE_INTERNAL;
        int scan_type;
-       bool valid_status = TRUE;
+       bool valid_status = true;
        char *update_path = NULL;
        char *storage_id = NULL;
 
@@ -404,8 +404,8 @@ gboolean msc_storage_scan_thread(void *data)
                /*start db updating */
                ms_set_db_status(MS_DB_UPDATING, storage_type);
 
-               valid_status = (scan_type == MS_MSG_STORAGE_PARTIAL) ? TRUE : FALSE;
-               ms_batch_commit_enable(TRUE, valid_status, FALSE, 0);
+               valid_status = (scan_type == MS_MSG_STORAGE_PARTIAL) ? true : false;
+               ms_batch_commit_enable(true, valid_status, false, 0);
 
                if (scan_type == MS_MSG_STORAGE_PARTIAL) {
                        ret = ms_validity_change_all_items(handle, storage_id, false, scan_data->uid);
@@ -418,7 +418,7 @@ gboolean msc_storage_scan_thread(void *data)
                ret = __msc_db_update(handle, storage_id, scan_data);
 
                /*call for bundle commit*/
-               ms_batch_commit_disable(TRUE, valid_status, scan_data->uid);
+               ms_batch_commit_disable(true, valid_status, scan_data->uid);
 
                if (scan_type == MS_MSG_STORAGE_PARTIAL && ret == MS_MEDIA_ERR_NONE) {
                        if (!ms_delete_invalid_items(handle, storage_id, scan_data->uid))
@@ -566,7 +566,7 @@ static int __msc_batch_insert(int pid, GArray *path_array, uid_t uid)
 
        /*start db updating */
        /*call for bundle commit*/
-       ms_batch_commit_enable(TRUE, FALSE, TRUE, pid);
+       ms_batch_commit_enable(true, false, true, pid);
 
        MS_DBG_WARN("BULK REGISTER START[%d]", pid);
 
@@ -593,7 +593,7 @@ static int __msc_batch_insert(int pid, GArray *path_array, uid_t uid)
        }
 
        /*call for bundle commit*/
-       ms_batch_commit_disable(TRUE, FALSE, uid);
+       ms_batch_commit_disable(true, false, uid);
 
        /*disconnect form media db*/
        if (handle) ms_disconnect_db(handle);
index cd318f8..3b0137f 100755 (executable)
@@ -122,7 +122,7 @@ int ms_check_mediadb(uid_t uid, bool *is_reset)
                MS_DBG_ERR("THE SIZE OF MEDIA DB REACH THE LIMIT. RESET MEDIA DB.");
                MS_DBG_ERR("[DB SIZE : %lf] [LIMIT1 : %lf] [LIMIT2 : %lf]", db_size, MEDIA_DB_SIZE_LIMIT_1, MEDIA_DB_SIZE_LIMIT_2);
                __ms_remake_mediadb(uid);
-               *is_reset = TRUE;
+               *is_reset = true;
        }
 
        return MS_MEDIA_ERR_NONE;
@@ -135,7 +135,7 @@ int ms_check_corrupt_mediadb(void)
 
        ms_sys_get_uid(&uid);
 
-       if (media_db_connect(&db_handle, uid, FALSE) != MS_MEDIA_ERR_NONE) {
+       if (media_db_connect(&db_handle, uid, false) != MS_MEDIA_ERR_NONE) {
                MS_DBG_ERR("Failed to connect DB");
                return MS_MEDIA_ERR_DB_CONNECT_FAIL;
        }
index b2d555f..6774b47 100755 (executable)
@@ -30,7 +30,7 @@
 #include "media-server-db.h"
 
 static GMainLoop *g_db_mainloop = NULL;
-static bool db_thread_ready = FALSE;
+static bool db_thread_ready = false;
 
 GMainLoop *ms_db_get_mainloop(void)
 {
@@ -98,12 +98,12 @@ gboolean ms_db_thread(void *data)
        g_main_context_push_thread_default(context);
 
        MS_DBG_INFO("Media Server DB thread is running");
-       db_thread_ready = TRUE;
+       db_thread_ready = true;
 
        g_main_loop_run(g_db_mainloop);
 
        MS_DBG_INFO("Media Server DB thread is shutting down");
-       db_thread_ready = FALSE;
+       db_thread_ready = false;
 
        g_io_channel_shutdown(channel, FALSE, NULL);
        g_io_channel_unref(channel);
index f03153d..98ec975 100755 (executable)
@@ -107,7 +107,7 @@ int ms_storage_insert_handler(const char *mount_path, const char *mount_uuid)
                        /* update storage_id table set validity=0 first */
                        ms_validity_change_all_items(handle, mount_uuid, false, uid);
                        /*update folder table set validity = 0*/
-                       ms_set_folder_validity(handle, mount_uuid, storage_path, MS_INVALID, TRUE, uid);
+                       ms_set_folder_validity(handle, mount_uuid, storage_path, MS_INVALID, true, uid);
                        /* update folder table set scan_status=0 first */
                        ms_set_folder_scan_status(handle, mount_uuid, NULL, MS_DIR_SCAN_NONE, uid);
                        MS_DBG_WARN("init storage data in DB end");
@@ -243,7 +243,7 @@ static void __ms_usb_add_event(const char *mount_path)
                /* update storage_id table set validity=0 first */
                ms_validity_change_all_items(handle, storage_id, false, uid);
                /* update folder table set validity=0 first */
-               ms_set_folder_validity(handle, storage_id, mount_path, MS_INVALID, TRUE, uid);
+               ms_set_folder_validity(handle, storage_id, mount_path, MS_INVALID, true, uid);
                /* update folder table set scan_status=0 first */
                ms_set_folder_scan_status(handle, storage_id, NULL, MS_DIR_SCAN_NONE, uid);
 
@@ -291,7 +291,7 @@ static void __ms_usb_remove_event(const char *mount_path)
                                if (ms_validity_change_all_items(handle, device_id, false, uid) != MS_MEDIA_ERR_NONE)
                                        MS_DBG_ERR("ms_validity_change_all_items failed");
                                /* folder validity set 0 under the start_path in folder table*/
-                               if (ms_set_folder_validity(handle, device_id, mount_path, MS_INVALID, TRUE, uid) != MS_MEDIA_ERR_NONE)
+                               if (ms_set_folder_validity(handle, device_id, mount_path, MS_INVALID, true, uid) != MS_MEDIA_ERR_NONE)
                                        MS_DBG_ERR("set_folder_validity failed");
 
                                if (ms_get_scanner_status()) {
@@ -316,7 +316,7 @@ static void __ms_usb_remove_event(const char *mount_path)
 void ms_device_block_changed_cb(usb_device_h usb_device, char *action, void *user_data)
 {
        char *mount_path = NULL;
-       bool is_reset = FALSE;
+       bool is_reset = false;
        uid_t uid = MEDIA_DEFAULT_UID;
 
        MS_DBG_WARN("usb_event_callback BEGIN[%s]", action);
@@ -486,7 +486,7 @@ int ms_check_mounted_storage(uid_t uid)
                                                ms_set_storage_validity(handle, storage_id, 1, uid);
                                                /* update storage_id table set validity=0 first */
                                                ms_validity_change_all_items(handle, storage_id, false, uid);
-                                               ms_set_folder_validity(handle, storage_id, mounted_path, MS_INVALID, TRUE, uid);
+                                               ms_set_folder_validity(handle, storage_id, mounted_path, MS_INVALID, true, uid);
                                                /* update folder table set scan_status=0 first */
                                                ms_set_folder_scan_status(handle, storage_id, NULL, MS_DIR_SCAN_NONE, uid);
 
index ad48273..49b2ccc 100755 (executable)
@@ -46,7 +46,7 @@
 extern GMutex scanner_mutex;
 
 GMainLoop *mainloop = NULL;
-bool power_off; /*If this is TRUE, poweroff notification received*/
+bool power_off; /*If this is true, poweroff notification received*/
 
 #define SMARTHUB_RESET_VCONF "db/smarthub/reset/firstscreen"
 bool smarthub_reset_start;
@@ -101,13 +101,13 @@ void _ms_smarthub_vconf_cb(void *data)
        int thumb_pid = 0;
        uid_t uid = MEDIA_DEFAULT_UID;
 
-       if (power_off == FALSE) {
+       if (!power_off) {
                if (!ms_config_get_int(SMARTHUB_RESET_VCONF, &status))
                        MS_DBG_ERR("Get VCONFKEY_SYSMAN_MMC_STATUS failed.");
 
                MS_DBG_ERR("CURRENT STATUS OF SMARTHUB_RESET_VCONF[%d]", status);
 
-               smarthub_reset = TRUE;
+               smarthub_reset = true;
 
                if (status == 0) {
                        scanner_pid = ms_get_scanner_pid();
@@ -136,7 +136,7 @@ void _ms_smarthub_vconf_cb(void *data)
                        __ms_check_mediadb();
                        ms_config_set_int(MS_DB_RESET, 0);
                        MS_DBG_ERR("END SMART HUB RESET");
-                       smarthub_reset = FALSE;
+                       smarthub_reset = false;
                }
        }
 
@@ -206,7 +206,7 @@ void _ms_datadisc_vconf_cb(void *data)
                                /* update storage_id table set validity=0 first */
                                ms_validity_change_all_items(handle, DATADISC_STORAGE_ID, false, uid);
                                /*update folder table set validity = 0*/
-                               ms_set_folder_validity(handle, DATADISC_STORAGE_ID, mnt_path, MS_INVALID, TRUE, uid);
+                               ms_set_folder_validity(handle, DATADISC_STORAGE_ID, mnt_path, MS_INVALID, true, uid);
                                /* update folder table set scan_status=0 first */
                                ms_set_folder_scan_status(handle, DATADISC_STORAGE_ID, NULL, MS_DIR_SCAN_NONE, uid);
                                MS_DBG_WARN("init storage data in DB end");
@@ -275,7 +275,7 @@ void _power_off_cb(ms_power_info_s *power_info, void* data)
 
        GIOChannel *channel = (GIOChannel *)data;
 
-       power_off = TRUE;
+       power_off = true;
 
        /*Quit Thumbnail Thread*/
        GMainLoop *thumb_mainloop = ms_get_thumb_thread_mainloop();
@@ -344,7 +344,7 @@ void _ms_change_lang_vconf_cb(keynode_t *key, void* data)
        const char *chi = "zh";
        const char *jpn = "ja";
        const char *kor = "ko";
-       bool need_update = FALSE;
+       bool need_update = false;
 
        if (!ms_config_get_str(VCONFKEY_LANGSET, &lang)) {
                MS_DBG_ERR("Get VCONFKEY_LANGSET failed.");
@@ -355,25 +355,25 @@ void _ms_change_lang_vconf_cb(keynode_t *key, void* data)
 
        if (MS_STRING_VALID(priv_lang) && MS_STRING_VALID(lang)) {
                if (strcmp(priv_lang, lang) == 0) {
-                       need_update = FALSE;
+                       need_update = false;
                } else if ((strncmp(lang, eng, strlen(eng)) == 0) ||
                                (strncmp(lang, chi, strlen(chi)) == 0) ||
                                (strncmp(lang, jpn, strlen(jpn)) == 0) ||
                                (strncmp(lang, kor, strlen(kor)) == 0)) {
-                               need_update = TRUE;
+                               need_update = true;
                } else {
                        if ((strncmp(priv_lang, eng, strlen(eng)) == 0) ||
                                (strncmp(priv_lang, chi, strlen(chi)) == 0) ||
                                (strncmp(priv_lang, jpn, strlen(jpn)) == 0) ||
                                (strncmp(priv_lang, kor, strlen(kor)) == 0)) {
-                               need_update = TRUE;
+                               need_update = true;
                        }
                }
        } else {
-               need_update = TRUE;
+               need_update = true;
        }
 
-       if (need_update == TRUE) {
+       if (need_update) {
                uid_t uid = MEDIA_DEFAULT_UID;
                ms_sys_get_uid(&uid);
                ms_send_storage_scan_request(NULL, INTERNAL_STORAGE_ID, MS_SCAN_META, uid);
@@ -398,7 +398,7 @@ int main(int argc, char **argv)
        GThread *dcm_thread = NULL;
        GIOChannel *channel = NULL;
        bool is_dcm_supported = __ms_is_dcm_supported();
-       power_off = FALSE;
+       power_off = false;
 
 #ifdef _USE_TVPD_MODE
        uid_t uid = MEDIA_DEFAULT_UID;
@@ -693,7 +693,7 @@ static int __ms_check_disc_status(void)
                                /* update storage_id table set validity=0 first */
                                ms_validity_change_all_items(handle, DATADISC_STORAGE_ID, false, uid);
                                /*update folder table set validity = 0*/
-                               ms_set_folder_validity(handle, DATADISC_STORAGE_ID, mnt_path, MS_INVALID, TRUE, uid);
+                               ms_set_folder_validity(handle, DATADISC_STORAGE_ID, mnt_path, MS_INVALID, true, uid);
                                /* update folder table set scan_status=0 first */
                                ms_set_folder_scan_status(handle, DATADISC_STORAGE_ID, NULL, MS_DIR_SCAN_NONE, uid);
                                MS_DBG_WARN("init storage data in DB end");
@@ -790,14 +790,14 @@ static void __ms_check_mediadb(void)
 
 static bool __ms_is_dcm_supported()
 {
-       bool isFaceRecognitionSupported = FALSE;        /* face_recognition feature supported */
+       bool isFaceRecognitionSupported = false;        /* face_recognition feature supported */
        int dcm_service_mode = -1;                                      /* media-content-config:dcm_activation */
 
        const int nRetVal = system_info_get_platform_bool("http://tizen.org/feature/vision.face_recognition", &isFaceRecognitionSupported);
 
        if (nRetVal != SYSTEM_INFO_ERROR_NONE) {
                MS_DBG_ERR("SYSTEM_INFO_ERROR: vision.face_recognition [%d]", nRetVal);
-               return FALSE;
+               return false;
        }
 
        dictionary *dict = NULL;
@@ -805,7 +805,7 @@ static bool __ms_is_dcm_supported()
        dict = iniparser_load(MS_INI_DEFAULT_PATH);
        if (!dict) {
                MS_DBG_ERR("%s load failed", MS_INI_DEFAULT_PATH);
-               return -1;
+               return false;
        }
 
        dcm_service_mode = iniparser_getint(dict, "media-content-config:dcm_activation", 0);
@@ -813,6 +813,6 @@ static bool __ms_is_dcm_supported()
 
        iniparser_freedict(dict);
 
-       return (isFaceRecognitionSupported && (dcm_service_mode == 1)) ? TRUE : FALSE;
+       return (isFaceRecognitionSupported && (dcm_service_mode == 1)) ? true : false;
 }
 
index b6b62ad..d573e12 100755 (executable)
@@ -539,7 +539,7 @@ int ms_send_storage_scan_request_senior_mode(sqlite3 *handle)
                                ms_set_storage_validity(handle, storage_id, 1, uid);
                                /* update storage_id table set validity=0 first */
                                ms_validity_change_all_items(handle, storage_id, false, uid);
-                               ms_set_folder_validity(handle, storage_id, storage_path, MS_INVALID, TRUE, uid);
+                               ms_set_folder_validity(handle, storage_id, storage_path, MS_INVALID, true, uid);
                                /* update folder table set scan_status=0 first */
                                ms_set_folder_scan_status(handle, storage_id, NULL, MS_DIR_SCAN_NONE, uid);
                        }
@@ -584,7 +584,7 @@ gboolean ms_read_db_tcp_socket(GIOChannel *src, GIOCondition condition, gpointer
        int send_msg = MS_MEDIA_ERR_NONE;
        ms_peer_credentials creds;
 
-       if (power_off == TRUE) {
+       if (power_off) {
                MS_DBG_WARN("in the power off sequence");
                return TRUE;
        }
@@ -620,7 +620,7 @@ gboolean ms_read_db_tcp_socket(GIOChannel *src, GIOCondition condition, gpointer
        MS_SAFE_FREE(creds.smack);
        MS_SAFE_FREE(creds.uid);
 
-       if (media_db_connect(&db_handle, recv_msg.uid, TRUE) != MS_MEDIA_ERR_NONE) {
+       if (media_db_connect(&db_handle, recv_msg.uid, true) != MS_MEDIA_ERR_NONE) {
                MS_DBG_ERR("Failed to connect DB");
                goto ERROR;
        }
@@ -666,7 +666,7 @@ void _ms_process_tcp_message(gpointer data, gpointer user_data)
        ms_peer_credentials creds;
 
        while (1) {
-               if (power_off == TRUE) {
+               if (power_off) {
                        MS_DBG_WARN("in the power off sequence");
                        break;
                }
@@ -704,7 +704,7 @@ void _ms_process_tcp_message(gpointer data, gpointer user_data)
                                ret = media_db_update_db_batch_start(sql_query);
                        } else if (recv_msg.msg_type == MS_MSG_DB_UPDATE_BATCH_END) {
                                sqlite3 *db_handle = NULL;
-                               if (media_db_connect(&db_handle, recv_msg.uid, TRUE) != MS_MEDIA_ERR_NONE) {
+                               if (media_db_connect(&db_handle, recv_msg.uid, true) != MS_MEDIA_ERR_NONE) {
                                        MS_DBG_ERR("Failed to connect DB");
                                        send_msg = MS_MEDIA_ERR_DB_CONNECT_FAIL;
                                        media_db_request_update_db_batch_clear();
@@ -747,7 +747,7 @@ void _ms_process_tcp_message(gpointer data, gpointer user_data)
        if (close(client_sock) < 0)
                MS_DBG_STRERROR("close failed");
 
-       if (g_atomic_int_dec_and_test(&cur_running_task) == TRUE)
+       if (g_atomic_int_dec_and_test(&cur_running_task))
                MS_DBG_INFO("There is no running task");
 
        return;
@@ -763,7 +763,7 @@ ERROR:
        if (close(client_sock) < 0)
                MS_DBG_STRERROR("close failed");
 
-       if (g_atomic_int_dec_and_test(&cur_running_task) == TRUE)
+       if (g_atomic_int_dec_and_test(&cur_running_task))
                MS_DBG_INFO("There is no running task");
 
        return;