From 05f0ba9654f24c081c99b2c8cd6137dbf01f18cd Mon Sep 17 00:00:00 2001 From: Abhay agarwal Date: Fri, 6 Sep 2019 15:05:46 +0530 Subject: [PATCH] Remove extra comments from code Change-Id: I4a03ab1b941a2c3cca4392d99fe0dd9073268ddb Signed-off-by: Abhay agarwal --- ua-daemon/src/ua-manager-db.c | 3 --- ua-daemon/src/ua-manager-device-db.c | 32 ---------------------------- ua-daemon/src/ua-manager-device-service-db.c | 19 ----------------- ua-daemon/src/ua-manager-service-db.c | 16 -------------- ua-daemon/src/ua-manager-user-db.c | 19 ----------------- 5 files changed, 89 deletions(-) diff --git a/ua-daemon/src/ua-manager-db.c b/ua-daemon/src/ua-manager-db.c index 8077b77..0782a3a 100644 --- a/ua-daemon/src/ua-manager-db.c +++ b/ua-daemon/src/ua-manager-db.c @@ -306,9 +306,6 @@ static int __uam_db_verify() /* check db integrity */ retv_if(UAM_ERROR_NONE != __uam_db_check_integrity(), UAM_ERROR_DB_FAILED); - /* - * 11) why this is required? If it is not needed, please remove it - */ /* set locking mode */ retv_if(UAM_ERROR_NONE != __uam_db_set_locking_mode(), UAM_ERROR_DB_FAILED); return UAM_ERROR_NONE; diff --git a/ua-daemon/src/ua-manager-device-db.c b/ua-daemon/src/ua-manager-device-db.c index da7c1e2..ba10af0 100644 --- a/ua-daemon/src/ua-manager-device-db.c +++ b/ua-daemon/src/ua-manager-device-db.c @@ -330,10 +330,6 @@ int _ua_device_db_update_device_ip_address(char *device_id, int tech_type, DB_ACTION(sqlite3_bind_text(stmt, 4, address, -1, SQLITE_TRANSIENT), error_code, handle_error); - /* 6) SQLITE_DONE or SQITE_ROW can be returned but is not error - * SQLITE_ROW can be returned multiple times, so we consider SQLITE_ROW case as well - * Lastly, we just regard SQLITE_ERROR is actual error. - */ if (sqlite3_step(stmt) != SQLITE_DONE) { UAM_ERR("Failed to update ip address: %s", sqlite3_errmsg(__uam_db_recover_database())); @@ -367,10 +363,6 @@ int _ua_device_db_update_device_presence(char *device_id, int tech_type, DB_ACTION(sqlite3_bind_text(stmt, 4, address, -1, SQLITE_TRANSIENT), error_code, handle_error); - /* 6) SQLITE_DONE or SQITE_ROW can be returned but is not error - * SQLITE_ROW can be returned multiple times, so we consider SQLITE_ROW case as well - * Lastly, we just regard SQLITE_ERROR is actual error. - */ if (sqlite3_step(stmt) != SQLITE_DONE) { UAM_ERR("Failed to update presence: %s", sqlite3_errmsg(__uam_db_recover_database())); @@ -404,10 +396,6 @@ int _ua_device_db_update_device_timestamp(char *device_id, int tech_type, DB_ACTION(sqlite3_bind_text(stmt, 4, address, -1, SQLITE_TRANSIENT), error_code, handle_error); - /* 6) SQLITE_DONE or SQITE_ROW can be returned but is not error - * SQLITE_ROW can be returned multiple times, so we consider SQLITE_ROW case as well - * Lastly, we just regard SQLITE_ERROR is actual error. - */ if (sqlite3_step(stmt) != SQLITE_DONE) { UAM_ERR("Failed to update device timestamp: %s", sqlite3_errmsg(__uam_db_recover_database())); @@ -453,10 +441,6 @@ int _ua_device_db_update_device_device(char *device_id, int tech_type, DB_ACTION(sqlite3_bind_text(stmt, 10, address, -1, SQLITE_TRANSIENT), error_code, handle_error); - /* 6) SQLITE_DONE or SQITE_ROW can be returned but is not error - * SQLITE_ROW can be returned multiple times, so we consider SQLITE_ROW case as well - * Lastly, we just regard SQLITE_ERROR is actual error. - */ if (sqlite3_step(stmt) != SQLITE_DONE) { UAM_ERR("Failed to update device discriminant: %s", sqlite3_errmsg(__uam_db_recover_database())); @@ -515,10 +499,6 @@ int _ua_device_db_insert_device_info(int user_id, DB_ACTION(sqlite3_bind_int(stmt, 14, max_device_number + 1), error_code, handle_error); - /* 6) SQLITE_DONE or SQITE_ROW can be returned but is not error - * SQLITE_ROW can be returned multiple times, so we consider SQLITE_ROW case as well - * Lastly, we just regard SQLITE_ERROR is actual error. - */ if (sqlite3_step(stmt) != SQLITE_DONE) { UAM_ERR("Failed to insert device info: %s", sqlite3_errmsg(__uam_db_recover_database())); @@ -552,10 +532,6 @@ int _ua_device_db_delete_device_info(const char *device_id, int tech_type, DB_ACTION(sqlite3_bind_text(stmt, 3, address, -1, SQLITE_STATIC), error_code, handle_error); - /* 6) SQLITE_DONE or SQITE_ROW can be returned but is not error - * SQLITE_ROW can be returned multiple times, so we consider SQLITE_ROW case as well - * Lastly, we just regard SQLITE_ERROR is actual error. - */ if (sqlite3_step(stmt) != SQLITE_DONE) { UAM_ERR("Failed to delete device info %s", sqlite3_errmsg(__uam_db_recover_database())); @@ -587,10 +563,6 @@ int _ua_device_db_get_device(char *device_id, int tech_type, char *address, DB_ACTION(sqlite3_bind_text(stmt, 3, address, -1, SQLITE_STATIC), error_code, handle_error); - /* 6) SQLITE_DONE or SQITE_ROW can be returned but is not error - * SQLITE_ROW can be returned multiple times, so we consider SQLITE_ROW case as well - * Lastly, we just regard SQLITE_ERROR is actual error. - */ if (sqlite3_step(stmt) != SQLITE_DONE) { UAM_ERR("Failed to select device info %s", sqlite3_errmsg(__uam_db_recover_database())); @@ -748,10 +720,6 @@ int _uam_device_db_clear(void) int error_code = UAM_ERROR_NONE; sqlite3_stmt *stmt = delete_all_devices; - /* 6) SQLITE_DONE or SQITE_ROW can be returned but is not error - * SQLITE_ROW can be returned multiple times, so we consider SQLITE_ROW case as well - * Lastly, we just regard SQLITE_ERROR is actual error. - */ if (sqlite3_step(stmt) != SQLITE_DONE) { UAM_ERR("Failed to delete device data %s", sqlite3_errmsg(__uam_db_recover_database())); diff --git a/ua-daemon/src/ua-manager-device-service-db.c b/ua-daemon/src/ua-manager-device-service-db.c index 9088f24..4b9a9dc 100644 --- a/ua-daemon/src/ua-manager-device-service-db.c +++ b/ua-daemon/src/ua-manager-device-service-db.c @@ -51,9 +51,6 @@ static sqlite3_stmt *delete_device_service; static sqlite3_stmt *select_service; static sqlite3_stmt *select_device_services_count; -/* UPDATE statements */ -//TO-DO - /* INSERT statements */ static sqlite3_stmt *insert_device_service; extern sqlite3 *database; @@ -241,10 +238,6 @@ int _uam_db_insert_service(int device_number, int service_number) DB_ACTION(sqlite3_bind_int(stmt, 1, device_number), error_code, handle_error); DB_ACTION(sqlite3_bind_int(stmt, 2, service_number), error_code, handle_error); - /* 6) SQLITE_DONE or SQITE_ROW can be returned but is not error - * SQLITE_ROW can be returned multiple times, so we consider SQLITE_ROW case as well - * Lastly, we just regard SQLITE_ERROR is actual error. - */ if (sqlite3_step(stmt) != SQLITE_DONE) { UAM_ERR("Failed to insert device-service info: %s", sqlite3_errmsg(__uam_db_recover_database())); @@ -302,10 +295,6 @@ int _ua_device_service_db_clear(void) int error_code = UAM_ERROR_NONE; sqlite3_stmt *stmt = delete_all_device_services; - /* 6) SQLITE_DONE or SQITE_ROW can be returned but is not error - * SQLITE_ROW can be returned multiple times, so we consider SQLITE_ROW case as well - * Lastly, we just regard SQLITE_ERROR is actual error. - */ if (sqlite3_step(stmt) != SQLITE_DONE) { UAM_ERR("Failed to delete device data %s", sqlite3_errmsg(__uam_db_recover_database())); @@ -331,10 +320,6 @@ int _uam_db_delete_service_number(int service_number) DB_ACTION(sqlite3_bind_int(stmt, 1, service_number), error_code, handle_error); - /* 6) SQLITE_DONE or SQITE_ROW can be returned but is not error - * SQLITE_ROW can be returned multiple times, so we consider SQLITE_ROW case as well - * Lastly, we just regard SQLITE_ERROR is actual error. - */ if (sqlite3_step(stmt) != SQLITE_DONE) { UAM_ERR("Failed to delete device-service info %s", sqlite3_errmsg(__uam_db_recover_database())); @@ -359,10 +344,6 @@ int _uam_db_delete_device_service_number(int device_number, int service_number) DB_ACTION(sqlite3_bind_int(stmt, 1, device_number), error_code, handle_error); DB_ACTION(sqlite3_bind_int(stmt, 2, service_number), error_code, handle_error); - /* 6) SQLITE_DONE or SQITE_ROW can be returned but is not error - * SQLITE_ROW can be returned multiple times, so we consider SQLITE_ROW case as well - * Lastly, we just regard SQLITE_ERROR is actual error. - */ if (sqlite3_step(stmt) != SQLITE_DONE) { UAM_ERR("Failed to delete device-service info %s", sqlite3_errmsg(__uam_db_recover_database())); diff --git a/ua-daemon/src/ua-manager-service-db.c b/ua-daemon/src/ua-manager-service-db.c index 9de7a30..3fb037c 100644 --- a/ua-daemon/src/ua-manager-service-db.c +++ b/ua-daemon/src/ua-manager-service-db.c @@ -288,10 +288,6 @@ int _uam_db_insert_service_info( DB_ACTION(sqlite3_bind_int(stmt, 3, cycle), error_code, handle_error); - /* 6) SQLITE_DONE or SQITE_ROW can be returned but is not error - * SQLITE_ROW can be returned multiple times, so we consider SQLITE_ROW case as well - * Lastly, we just regard SQLITE_ERROR is actual error. - */ if (sqlite3_step(stmt) != SQLITE_DONE) { UAM_ERR("Failed to insert service info: %s", sqlite3_errmsg(__uam_db_recover_database())); @@ -326,10 +322,6 @@ int _uam_db_delete_service_info(const char *service_name) DB_ACTION(sqlite3_bind_text(stmt, 1, service_name, -1, SQLITE_STATIC), error_code, handle_error); - /* 6) SQLITE_DONE or SQITE_ROW can be returned but is not error - * SQLITE_ROW can be returned multiple times, so we consider SQLITE_ROW case as well - * Lastly, we just regard SQLITE_ERROR is actual error. - */ if (sqlite3_step(stmt) != SQLITE_DONE) { UAM_ERR("Failed to delete service info %s", sqlite3_errmsg(__uam_db_recover_database())); @@ -348,10 +340,6 @@ int _ua_service_db_clear(void) int error_code = UAM_ERROR_NONE; sqlite3_stmt *stmt = delete_all_services; - /* 6) SQLITE_DONE or SQITE_ROW can be returned but is not error - * SQLITE_ROW can be returned multiple times, so we consider SQLITE_ROW case as well - * Lastly, we just regard SQLITE_ERROR is actual error. - */ if (sqlite3_step(stmt) != SQLITE_DONE) { UAM_ERR("Failed to delete service data %s", sqlite3_errmsg(__uam_db_recover_database())); @@ -379,10 +367,6 @@ int _uam_db_update_service_cycle(const char *service_name, int cycle) DB_ACTION(sqlite3_bind_text(stmt, 2, service_name, -1, SQLITE_TRANSIENT), error_code, handle_error); - /* 6) SQLITE_DONE or SQITE_ROW can be returned but is not error - * SQLITE_ROW can be returned multiple times, so we consider SQLITE_ROW case as well - * Lastly, we just regard SQLITE_ERROR is actual error. - */ if (sqlite3_step(stmt) != SQLITE_DONE) { UAM_ERR("Failed to update service timestamp: %s", sqlite3_errmsg(__uam_db_recover_database())); diff --git a/ua-daemon/src/ua-manager-user-db.c b/ua-daemon/src/ua-manager-user-db.c index 57fb9b0..e8eec14 100644 --- a/ua-daemon/src/ua-manager-user-db.c +++ b/ua-daemon/src/ua-manager-user-db.c @@ -51,9 +51,6 @@ static sqlite3_stmt *select_all_users_data; static sqlite3_stmt *select_user_data; static sqlite3_stmt *select_max_user_id; -/* UPDATE statements */ -//TODO - /* INSERT statements */ static sqlite3_stmt *insert_user_info; @@ -269,10 +266,6 @@ int _ua_db_insert_user_info(int *user_id, const char *name, const char *account) DB_ACTION(sqlite3_bind_text(stmt, 3, account, -1, SQLITE_TRANSIENT), error_code, handle_error); - /* 6) SQLITE_DONE or SQITE_ROW can be returned but is not error - * SQLITE_ROW can be returned multiple times, so we consider SQLITE_ROW case as well - * Lastly, we just regard SQLITE_ERROR is actual error. - */ if (sqlite3_step(stmt) != SQLITE_DONE) { UAM_ERR("Failed to insert user info: %s", sqlite3_errmsg(__uam_db_recover_database())); @@ -302,10 +295,6 @@ int _ua_db_delete_by_user_id(int user_id) DB_ACTION(sqlite3_bind_int(stmt, 1, user_id), error_code, handle_error); - /* 6) SQLITE_DONE or SQITE_ROW can be returned but is not error - * SQLITE_ROW can be returned multiple times, so we consider SQLITE_ROW case as well - * Lastly, we just regard SQLITE_ERROR is actual error. - */ if (sqlite3_step(stmt) != SQLITE_DONE) { UAM_ERR("Failed to delete user info %s", sqlite3_errmsg(__uam_db_recover_database())); @@ -332,10 +321,6 @@ int _ua_db_get_user(int user_id, db_user_info_t *info) DB_ACTION(sqlite3_bind_int(stmt, 1, user_id), error_code, handle_error); - /* 6) SQLITE_DONE or SQITE_ROW can be returned but is not error - * SQLITE_ROW can be returned multiple times, so we consider SQLITE_ROW case as well - * Lastly, we just regard SQLITE_ERROR is actual error. - */ if (sqlite3_step(stmt) != SQLITE_DONE) { UAM_ERR("Failed to select user info %s", sqlite3_errmsg(__uam_db_recover_database())); @@ -403,10 +388,6 @@ int _uam_user_db_clear(void) int error_code = UAM_ERROR_NONE; sqlite3_stmt *stmt = delete_all_users_data; - /* 6) SQLITE_DONE or SQITE_ROW can be returned but is not error - * SQLITE_ROW can be returned multiple times, so we consider SQLITE_ROW case as well - * Lastly, we just regard SQLITE_ERROR is actual error. - */ if (sqlite3_step(stmt) != SQLITE_DONE) { UAM_ERR("Failed to delete user data %s", sqlite3_errmsg(__uam_db_recover_database())); -- 2.7.4