From 9155bd34e06af07863b681f7125a51829e622950 Mon Sep 17 00:00:00 2001 From: Alexey Yakovenko Date: Mon, 30 Nov 2009 21:49:37 +0100 Subject: sanitized thread_start API --- deadbeef.h | 2 +- plugins/cdda/cdda.c | 4 ++-- plugins/hotkeys/hotkeys.c | 2 +- plugins/vfs_curl/vfs_curl.c | 4 ++-- threading.h | 2 +- threading_pthread.c | 2 +- timeline.c | 4 ++-- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/deadbeef.h b/deadbeef.h index 931b6652..cad5eaf2 100644 --- a/deadbeef.h +++ b/deadbeef.h @@ -228,7 +228,7 @@ typedef struct { const char *(*get_config_dir) (void); void (*quit) (void); // threading - intptr_t (*thread_start) (void (*fn)(uintptr_t ctx), uintptr_t ctx); + intptr_t (*thread_start) (void (*fn)(void *ctx), void *ctx); int (*thread_join) (intptr_t tid); uintptr_t (*mutex_create) (void); void (*mutex_free) (uintptr_t mtx); diff --git a/plugins/cdda/cdda.c b/plugins/cdda/cdda.c index 4effd077..56dd44a4 100644 --- a/plugins/cdda/cdda.c +++ b/plugins/cdda/cdda.c @@ -298,7 +298,7 @@ insert_single_track (CdIo_t* cdio, DB_playItem_t *after, const char* file, int t } static void -cddb_thread (uintptr_t items_i) +cddb_thread (void *items_i) { struct cddb_thread_params *params = (struct cddb_thread_params*)items_i; DB_playItem_t **items = params->items; @@ -398,7 +398,7 @@ cda_insert (DB_playItem_t *after, const char *fname) { p->items[i] = res; } trace ("cdda: querying freedb...\n"); - deadbeef->thread_start (cddb_thread, (uintptr_t)p); //will destroy cdio + deadbeef->thread_start (cddb_thread, p); //will destroy cdio } else { diff --git a/plugins/hotkeys/hotkeys.c b/plugins/hotkeys/hotkeys.c index 415e055c..5027824c 100644 --- a/plugins/hotkeys/hotkeys.c +++ b/plugins/hotkeys/hotkeys.c @@ -266,7 +266,7 @@ cleanup() { } static void -hotkeys_event_loop( uintptr_t unused ) { +hotkeys_event_loop( void *unused ) { int i; while (!finished) { diff --git a/plugins/vfs_curl/vfs_curl.c b/plugins/vfs_curl/vfs_curl.c index 034220e2..fa656a30 100644 --- a/plugins/vfs_curl/vfs_curl.c +++ b/plugins/vfs_curl/vfs_curl.c @@ -307,7 +307,7 @@ http_curl_control (void *stream, double dltotal, double dlnow, double ultotal, d } static void -http_thread_func (uintptr_t ctx) { +http_thread_func (void *ctx) { HTTP_FILE *fp = (HTTP_FILE *)ctx; CURL *curl; curl = curl_easy_init (); @@ -413,7 +413,7 @@ http_thread_func (uintptr_t ctx) { static void http_start_streamer (HTTP_FILE *fp) { fp->mutex = deadbeef->mutex_create (); - fp->tid = deadbeef->thread_start (http_thread_func, (uintptr_t)fp); + fp->tid = deadbeef->thread_start (http_thread_func, fp); } static DB_FILE * diff --git a/threading.h b/threading.h index 2e986b59..51a72f74 100644 --- a/threading.h +++ b/threading.h @@ -21,7 +21,7 @@ #include intptr_t -thread_start (void (*fn)(uintptr_t ctx), uintptr_t ctx); +thread_start (void (*fn)(void *ctx), void *ctx); int thread_join (intptr_t tid); diff --git a/threading_pthread.c b/threading_pthread.c index 942ddbfe..3ef22b26 100644 --- a/threading_pthread.c +++ b/threading_pthread.c @@ -21,7 +21,7 @@ #include "threading.h" intptr_t -thread_start (void (*fn)(uintptr_t ctx), uintptr_t ctx) { +thread_start (void (*fn)(void *ctx), void *ctx) { pthread_t tid; pthread_attr_t attr; int s = pthread_attr_init (&attr); diff --git a/timeline.c b/timeline.c index c9a40fb5..6126fa1d 100644 --- a/timeline.c +++ b/timeline.c @@ -68,7 +68,7 @@ timeline_stop (timeline_t *tl, int wait) { } void -timeline_thread_func (uintptr_t ctx) { +timeline_thread_func (void *ctx) { printf ("timeline thread started\n"); timeline_t *tl = (timeline_t *)ctx; @@ -113,7 +113,7 @@ timeline_start (timeline_t *tl) { tl->stop = 0; tl->destroy = 0; if (!tl->tid) { - tl->tid = thread_start (timeline_thread_func, (uintptr_t)tl); + tl->tid = thread_start (timeline_thread_func, tl); } else { printf ("reusing existing thread\n"); -- cgit v1.2.3