Fix static analysis issue 42/320542/2
authorChanggyu Choi <changyu.choi@samsung.com>
Mon, 18 Nov 2024 07:44:26 +0000 (16:44 +0900)
committerChanggyu Choi <changyu.choi@samsung.com>
Mon, 18 Nov 2024 08:36:16 +0000 (17:36 +0900)
Cannot cast surf pointer as int.

Change-Id: I4c02617a838e126a0800a65290d63c357a618d7f
Signed-off-by: Changgyu Choi <changyu.choi@samsung.com>
src/lib/api/amd_api_noti_msg.h
src/modules/ui-core/src/amd_screen_connector.c
src/modules/widget/src/amd_widget.c

index 0ba86228df47734dbb4f1d83e937c2ee40d93235..536f24e9138af13dd610181d311dfe6d7c8dffa6 100644 (file)
@@ -898,7 +898,7 @@ extern "C" {
  * @brief Definition for the notification message: Sending the running widget information is started.
  * @details Input: arg2(uid_t) The user ID.\n
  *          Input: arg3(const char*) The instance ID.\n
- *          Output: arg1(int *) The window ID.\n
+ *          Output: data(bundle *) The window ID. It must be used after casting with (unsigned int *).\n
  * @since_tizen 5.5
  *
  * @see __send_running_info()
index 5b142690519ce83aeccc2369f461f89c90f2ac54..d789b4572c859ca37844f7b24f01aa0370fc68de 100644 (file)
@@ -1558,7 +1558,7 @@ static int __on_widget_app_restart(const char *msg, int arg1, int arg2,
 static int __on_widget_running_info(const char *msg, int arg1, int arg2,
                void *arg3, bundle *data)
 {
-       unsigned int *surf = GINT_TO_POINTER(arg1);
+       unsigned int *surf = (unsigned int *)(data);
        uid_t uid = (uid_t)arg2;
        const char *instance_id = (const char *)arg3;
 
index 5a97d0d2b78b5c88dac24246771333f09bbc9b3d..158e9b930f526b53e021f576f2043054db8a2c16 100644 (file)
@@ -1180,8 +1180,8 @@ static int __send_running_info(widget_t *widget, int fd)
                instance_id = (const char *)iter->data;
                surf = 0;
                amd_noti_send(AMD_NOTI_MSG_WIDGET_RUNNING_INFO_SEND,
-                               GPOINTER_TO_INT_SAFE(&surf), (int)widget->uid,
-                               (void *)instance_id, NULL);
+                               0, (int)widget->uid,
+                               (void *)instance_id, (bundle *)(&surf));
                snprintf(buf, sizeof(buf), "%u", surf);
                bundle_del(b, AUL_K_WID);
                bundle_add_str(b, AUL_K_WID, buf);