diff options
author | Alexey Yakovenko <wakeroid@gmail.com> | 2009-11-30 21:49:37 +0100 |
---|---|---|
committer | Alexey Yakovenko <wakeroid@gmail.com> | 2009-11-30 21:49:37 +0100 |
commit | 9155bd34e06af07863b681f7125a51829e622950 (patch) | |
tree | d61e03fb3cf7a49294562fdbd6f52896e7f83e18 | |
parent | 7e20827fce4ac2609a834329e16fad363c58a201 (diff) |
sanitized thread_start API
-rw-r--r-- | deadbeef.h | 2 | ||||
-rw-r--r-- | plugins/cdda/cdda.c | 4 | ||||
-rw-r--r-- | plugins/hotkeys/hotkeys.c | 2 | ||||
-rw-r--r-- | plugins/vfs_curl/vfs_curl.c | 4 | ||||
-rw-r--r-- | threading.h | 2 | ||||
-rw-r--r-- | threading_pthread.c | 2 | ||||
-rw-r--r-- | timeline.c | 4 |
7 files changed, 10 insertions, 10 deletions
@@ -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 <stdint.h> 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); @@ -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"); |