diff options
author | Sangyoon Jang <s89.jang@samsung.com> | 2015-09-18 14:38:32 +0900 |
---|---|---|
committer | Sangyoon Jang <s89.jang@samsung.com> | 2015-09-18 17:21:27 +0900 |
commit | 47c06994d99f34bff2f4c13bd26bc43ee57c362d (patch) | |
tree | 37f3ad7adfe23ca20b12611b853b76404fb85fb1 | |
parent | 52b5f2dc30424e7ca473d269d7fd51eeaf5cf6a3 (diff) | |
download | aul-1-47c06994d99f34bff2f4c13bd26bc43ee57c362d.tar.gz aul-1-47c06994d99f34bff2f4c13bd26bc43ee57c362d.tar.bz2 aul-1-47c06994d99f34bff2f4c13bd26bc43ee57c362d.zip |
Fix different size warnings
in 64bit environment, "int"(4byte) and "void *"(8byte) have different size.
so we pass "int" type variable to "intptr_t".
intptr_t size depends on architecture.
Change-Id: I5eceda7fb80e2c0196cf1ebd6c271c9c9fa52aa3
Signed-off-by: Sangyoon Jang <s89.jang@samsung.com>
-rw-r--r-- | am_daemon/amd_app_group.c | 23 | ||||
-rw-r--r-- | am_daemon/amd_appinfo.c | 10 | ||||
-rw-r--r-- | am_session_agent/sigchild.h | 4 | ||||
-rw-r--r-- | app_launcher.c | 5 | ||||
-rw-r--r-- | test/launch_app.c | 5 | ||||
-rw-r--r-- | test/open_app.c | 5 |
6 files changed, 29 insertions, 23 deletions
diff --git a/am_daemon/amd_app_group.c b/am_daemon/amd_app_group.c index 5ad42117..1b66a380 100644 --- a/am_daemon/amd_app_group.c +++ b/am_daemon/amd_app_group.c @@ -1,6 +1,7 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> +#include <stdint.h> #include <glib.h> @@ -28,7 +29,7 @@ static gint __comp_pid(gconstpointer a, gconstpointer b) { app_group_context_t *ac1 = (app_group_context_t*) a; - return ac1->pid - (int)b; + return ac1->pid - GPOINTER_TO_INT(b); } static void __list_destroy_cb(gpointer data) @@ -39,7 +40,7 @@ static void __list_destroy_cb(gpointer data) static gboolean __hash_table_cb(gpointer key, gpointer value, gpointer user_data) { - int pid = (int) user_data; + int pid = GPOINTER_TO_INT(user_data); GList *list = (GList*) value; GList *itr = g_list_first(list); @@ -113,7 +114,7 @@ static GList* __find_removable_apps(int from) } if (found) { - list = g_list_append(list, (gpointer) gpids[j]); + list = g_list_append(list, GINT_TO_POINTER(gpids[j])); } } @@ -151,7 +152,7 @@ void app_group_add(int leader_pid, int pid, int wid) GList *list = (GList*) g_hash_table_lookup(app_group_hash, GINT_TO_POINTER(leader_pid)); if (list != NULL) { - if (g_list_find_custom(list, (gconstpointer)pid, __comp_pid) != NULL) { + if (g_list_find_custom(list, (gconstpointer)(intptr_t)pid, __comp_pid) != NULL) { _E("pid exist"); free(ac); return; @@ -199,7 +200,7 @@ void app_group_clear_top(int pid) GList *itr = g_list_last(list); while (itr != NULL) { - int p = (int)(itr->data); + int p = GPOINTER_TO_INT((itr->data)); aul_app_group_detach_window(p); _term_sub_app(p); @@ -279,7 +280,7 @@ void app_group_get_leader_pids(int *cnt, int **pids) g_hash_table_iter_init(&iter, app_group_hash); int i = 0; while (g_hash_table_iter_next(&iter, &key, &value)) { - leader_pids[i] = (int) key; + leader_pids[i] = GPOINTER_TO_INT(key); i++; } @@ -319,7 +320,7 @@ void app_group_get_group_pids(int leader_pid, int *cnt, int **pids) g_hash_table_iter_init(&iter, app_group_hash); while (g_hash_table_iter_next(&iter, &key, &value)) { - if ((int) key == leader_pid) { + if (GPOINTER_TO_INT(key) == leader_pid) { GList *list = (GList*) value; GList *i = g_list_first(list); int size = g_list_length(list); @@ -368,7 +369,7 @@ gboolean app_group_is_sub_app(int pid) GList *found = NULL; if (list != NULL) { - if ((found = g_list_find_custom(list, (gconstpointer)pid, __comp_pid)) != NULL) { + if ((found = g_list_find_custom(list, (gconstpointer)(intptr_t)pid, __comp_pid)) != NULL) { if (g_list_first(list) == found) return FALSE; return TRUE; @@ -392,7 +393,7 @@ void app_group_reroute(int pid) GList *after = NULL; if (list != NULL) { - if ((found = g_list_find_custom(list, (gconstpointer)pid, __comp_pid)) != NULL) { + if ((found = g_list_find_custom(list, (gconstpointer)(intptr_t)pid, __comp_pid)) != NULL) { before = g_list_previous(found); after = g_list_next(found); @@ -424,8 +425,8 @@ repeat: GList *list = (GList*) value; if (list != NULL) { - if (g_list_find_custom(list, (gconstpointer)pid, __comp_pid) != NULL) { - lpid = (int)key; + if (g_list_find_custom(list, (gconstpointer)(intptr_t)pid, __comp_pid) != NULL) { + lpid = GPOINTER_TO_INT(key); break; } } diff --git a/am_daemon/amd_appinfo.c b/am_daemon/amd_appinfo.c index c57b5e7c..e98254ec 100644 --- a/am_daemon/amd_appinfo.c +++ b/am_daemon/amd_appinfo.c @@ -1,5 +1,6 @@ #include <stdio.h> #include <stdlib.h> +#include <stdint.h> #include <string.h> #include <errno.h> #include <glib.h> @@ -265,7 +266,7 @@ static void _remove_user_appinfo(uid_t uid) static void __handle_onboot(void *user_data, const char *appid, struct appinfo *info) { - uid_t uid = (uid_t)user_data; + uid_t uid = (uid_t)(intptr_t)user_data; if (!strcmp(info->val[_AI_ONBOOT], "true")) { if (_status_app_is_running(appid, uid) > 0) @@ -304,8 +305,9 @@ static struct user_appinfo *_add_user_appinfo(uid_t uid) } if (uid != GLOBAL_USER) { - appinfo_foreach(uid, __handle_onboot, (void *)uid); - appinfo_foreach(GLOBAL_USER, __handle_onboot, (void *)uid); + appinfo_foreach(uid, __handle_onboot, (void *)(intptr_t)uid); + appinfo_foreach(GLOBAL_USER, __handle_onboot, + (void *)(intptr_t)uid); } _D("loaded appinfo table for uid %d", uid); @@ -374,7 +376,7 @@ static void _appinfo_delete_on_event(uid_t uid, const char *pkgid) static void _appinfo_insert_on_event(uid_t uid, const char *pkgid) { appinfo_insert(uid, pkgid); - appinfo_foreach(uid, __handle_onboot, (void *)uid); + appinfo_foreach(uid, __handle_onboot, (void *)(intptr_t)uid); } static int __package_event_cb(uid_t target_uid, int req_id, diff --git a/am_session_agent/sigchild.h b/am_session_agent/sigchild.h index 654d1386..e3add6c3 100644 --- a/am_session_agent/sigchild.h +++ b/am_session_agent/sigchild.h @@ -151,7 +151,7 @@ static int __sigchild_action(void *data) pid_t dead_pid; char buf[MAX_LOCAL_BUFSZ]; - dead_pid = (pid_t) data; + dead_pid = (pid_t)(intptr_t)data; if (dead_pid <= 0) goto end; @@ -186,7 +186,7 @@ static void __agent_sig_child(int sigchld_fd) while ((child_pid = waitpid(-1, &status, WNOHANG)) > 0) { if (child_pid == child_pgid) killpg(child_pgid, SIGKILL); - __sigchild_action((void *)child_pid); + __sigchild_action((void *)(intptr_t)child_pid); } return; diff --git a/app_launcher.c b/app_launcher.c index 781f3673..2d331d2d 100644 --- a/app_launcher.c +++ b/app_launcher.c @@ -22,6 +22,7 @@ #include <stdio.h> #include <getopt.h> #include <stdlib.h> +#include <stdint.h> #include <unistd.h> #include <sys/types.h> #include <string.h> @@ -66,7 +67,7 @@ static bundle *_create_internal_bundle(struct launch_arg *args) static int __launch_app_dead_handler(int pid, void *data) { - int listen_pid = (int)data; + int listen_pid = (intptr_t)data; if (listen_pid == pid) g_main_loop_quit(mainloop); @@ -92,7 +93,7 @@ static gboolean run_func(void *data) printf("... successfully launched pid = %d with debug %d\n", pid, launch_arg_data->flag_debug); if (launch_arg_data->sync) { - aul_listen_app_dead_signal(__launch_app_dead_handler, (void *)pid); + aul_listen_app_dead_signal(__launch_app_dead_handler, (void *)(intptr_t)pid); return FALSE; } } else { diff --git a/test/launch_app.c b/test/launch_app.c index 344e39fb..2e083f96 100644 --- a/test/launch_app.c +++ b/test/launch_app.c @@ -21,6 +21,7 @@ #include <stdio.h> #include <stdlib.h> +#include <stdint.h> #include <unistd.h> #include <sys/types.h> #include <string.h> @@ -90,7 +91,7 @@ void print_usage(char *progname) static int __launch_app_dead_handler(int pid, void *data) { - int listen_pid = (int) data; + int listen_pid = (intptr_t)data; if(listen_pid == pid) g_main_loop_quit(mainloop); @@ -108,7 +109,7 @@ static gboolean run_func(void *data) str = bundle_get_val(kb, "__LAUNCH_APP_MODE__"); if (str && strcmp(str, "SYNC") == 0 ) - aul_listen_app_dead_signal(__launch_app_dead_handler, (void *)pid); + aul_listen_app_dead_signal(__launch_app_dead_handler, (void *)(intptr_t)pid); else g_main_loop_quit(mainloop); } else { diff --git a/test/open_app.c b/test/open_app.c index 6ed774d1..c5c3111d 100644 --- a/test/open_app.c +++ b/test/open_app.c @@ -21,6 +21,7 @@ #include <stdio.h> #include <stdlib.h> +#include <stdint.h> #include <unistd.h> #include <sys/types.h> #include <string.h> @@ -72,7 +73,7 @@ void print_usage(char *progname) static int __launch_app_dead_handler(int pid, void *data) { - int listen_pid = (int) data; + int listen_pid = (intptr_t)data; if(listen_pid == pid) g_main_loop_quit(mainloop); @@ -94,7 +95,7 @@ static gboolean run_func(void *data) str = bundle_get_val(kb, "__LAUNCH_APP_MODE__"); if (str && strcmp(str, "SYNC") == 0 ) - aul_listen_app_dead_signal(__launch_app_dead_handler, (void *)pid); + aul_listen_app_dead_signal(__launch_app_dead_handler, (void *)(intptr_t)pid); else g_main_loop_quit(mainloop); |