diff options
Diffstat (limited to 'adb/services.c')
-rw-r--r-- | adb/services.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/adb/services.c b/adb/services.c index 951048e..1c9db0d 100644 --- a/adb/services.c +++ b/adb/services.c @@ -86,7 +86,7 @@ void restart_tcp_service(int fd, void *cookie) { char buf[100]; char value[PROPERTY_VALUE_MAX]; - int port = (int)cookie; + int port = (int) (uintptr_t) cookie; if (port <= 0) { snprintf(buf, sizeof(buf), "invalid port\n"); @@ -269,7 +269,7 @@ static int create_subprocess(const char *cmd, const char *arg0, const char *arg1 #if !ADB_HOST static void subproc_waiter_service(int fd, void *cookie) { - pid_t pid = (pid_t)cookie; + pid_t pid = (pid_t) (uintptr_t) cookie; D("entered. fd=%d of pid=%d\n", fd, pid); for (;;) { @@ -314,7 +314,7 @@ static int create_subproc_thread(const char *name) sti = malloc(sizeof(stinfo)); if(sti == 0) fatal("cannot allocate stinfo"); sti->func = subproc_waiter_service; - sti->cookie = (void*)pid; + sti->cookie = (void*) (uintptr_t) pid; sti->fd = ret_fd; if(adb_thread_create( &t, service_bootstrap_func, sti)){ @@ -397,7 +397,7 @@ int service_to_fd(const char *name) if (sscanf(name + 6, "%d", &port) == 0) { port = 0; } - ret = create_service_thread(restart_tcp_service, (void *)port); + ret = create_service_thread(restart_tcp_service, (void *) (uintptr_t) port); } else if(!strncmp(name, "usb:", 4)) { ret = create_service_thread(restart_usb_service, NULL); #endif |