From 3af0c0cf8fc68473fe6fa38e3291f05c2c2f8ac4 Mon Sep 17 00:00:00 2001 From: Jaeyun Jung Date: Tue, 2 May 2023 16:28:53 +0900 Subject: [PATCH] [C-Api/CodeClean] remove unnecessary code Code clean, 1. fix indent and remove unnecessary lines. 2. replace function to compare pkg type (case-insensitive). Signed-off-by: Jaeyun Jung --- c/src/ml-api-service-common.c | 2 +- c/src/ml-api-service-private.h | 11 ----------- daemon/pkg-mgr.cc | 7 +++---- 3 files changed, 4 insertions(+), 16 deletions(-) diff --git a/c/src/ml-api-service-common.c b/c/src/ml-api-service-common.c index 1c66a60..e696ff3 100644 --- a/c/src/ml-api-service-common.c +++ b/c/src/ml-api-service-common.c @@ -13,7 +13,7 @@ #include "ml-api-internal.h" #include "ml-api-service.h" #include "ml-api-service-private.h" -#include "../../daemon/includes/ml-agent-dbus-interface.h" +#include "ml-agent-dbus-interface.h" /** * @brief Destroy the pipeline of given ml_service_h diff --git a/c/src/ml-api-service-private.h b/c/src/ml-api-service-private.h index 3daa95f..5ff4b0d 100644 --- a/c/src/ml-api-service-private.h +++ b/c/src/ml-api-service-private.h @@ -65,17 +65,6 @@ typedef struct GAsyncQueue *out_data_queue; } _ml_service_query_s; - -/** - * @brief Internal function to get proxy of the pipeline d-bus interface - */ -MachinelearningServicePipeline * _get_mlsp_proxy_new_for_bus_sync (void); - -/** - * @brief Internal function to get proxy of the model d-bus interface - */ -MachinelearningServiceModel * _get_mlsm_proxy_new_for_bus_sync (void); - #ifdef __cplusplus } #endif /* __cplusplus */ diff --git a/daemon/pkg-mgr.cc b/daemon/pkg-mgr.cc index 3f00fcc..c133d82 100644 --- a/daemon/pkg-mgr.cc +++ b/daemon/pkg-mgr.cc @@ -30,7 +30,6 @@ _pkg_mgr_echo_pkg_path_info (const gchar *pkg_path) GDir *dir; if (g_file_test (pkg_path, G_FILE_TEST_IS_DIR)) { - _I ("package path: %s", pkg_path); dir = g_dir_open (pkg_path, 0, NULL); @@ -73,7 +72,7 @@ _pkg_mgr_event_cb (const char *type, const char *package_name, return; } - if (g_strcmp0 (type, "rpk") != 0) + if (g_ascii_strcasecmp (type, "rpk") != 0) return; /* TODO handle allowed resources. Currently this only supports global resources */ @@ -236,11 +235,11 @@ pkg_mgr_init (void) } /* Monitoring install, uninstall and upgrade events of the resource package. */ + /** @todo Find when these ACKAGE_MANAGER_STATUS_TYPE_RES_* status called */ ret = package_manager_set_event_status (pkg_mgr, PACKAGE_MANAGER_STATUS_TYPE_INSTALL | PACKAGE_MANAGER_STATUS_TYPE_UNINSTALL | PACKAGE_MANAGER_STATUS_TYPE_UPGRADE | PACKAGE_MANAGER_STATUS_TYPE_RES_COPY - | /* TODO: Find when these RES_* status called */ - PACKAGE_MANAGER_STATUS_TYPE_RES_CREATE_DIR | PACKAGE_MANAGER_STATUS_TYPE_RES_REMOVE + | PACKAGE_MANAGER_STATUS_TYPE_RES_CREATE_DIR | PACKAGE_MANAGER_STATUS_TYPE_RES_REMOVE | PACKAGE_MANAGER_STATUS_TYPE_RES_UNINSTALL); if (ret != PACKAGE_MANAGER_ERROR_NONE) { _E ("package_manager_set_event_status() failed: %d", ret); -- 2.7.4