From 4d7e574abefe9cd15c04cf0145faf55c9e282e83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20=27Flameeyes=27=20Petten=C3=B2?= Date: Sat, 9 Jun 2007 11:44:00 +0200 Subject: Convert all input plugins to use void * as type for the buf parameter of read() function, and declare a new buf variable in the function as needed. --- src/input/input_cdda.c | 2 +- src/input/input_dvb.c | 4 +++- src/input/input_dvd.c | 3 ++- src/input/input_file.c | 2 +- src/input/input_gnome_vfs.c | 3 ++- src/input/input_http.c | 3 ++- src/input/input_mms.c | 3 ++- src/input/input_net.c | 3 ++- src/input/input_pnm.c | 3 ++- src/input/input_pvr.c | 3 ++- src/input/input_rtp.c | 3 ++- src/input/input_rtsp.c | 2 +- src/input/input_smb.c | 3 ++- src/input/input_stdin_fifo.c | 3 ++- src/input/input_v4l.c | 2 +- src/input/input_vcd.c | 9 ++++++--- src/vdr/input_vdr.c | 3 ++- src/xine-engine/input_cache.c | 3 ++- src/xine-engine/input_rip.c | 3 ++- 19 files changed, 39 insertions(+), 21 deletions(-) diff --git a/src/input/input_cdda.c b/src/input/input_cdda.c index b85bc534e..e35ee5b9c 100644 --- a/src/input/input_cdda.c +++ b/src/input/input_cdda.c @@ -2243,7 +2243,7 @@ static uint32_t cdda_plugin_get_capabilities (input_plugin_t *this_gen) { } -static off_t cdda_plugin_read (input_plugin_t *this_gen, char *buf, off_t len) { +static off_t cdda_plugin_read (input_plugin_t *this_gen, void *buf, off_t len) { /* only allow reading in block-sized chunks */ diff --git a/src/input/input_dvb.c b/src/input/input_dvb.c index 50162c7db..38ad0be82 100644 --- a/src/input/input_dvb.c +++ b/src/input/input_dvb.c @@ -2468,8 +2468,10 @@ static void ts_rewrite_packets (dvb_input_plugin_t *this, unsigned char * origin } static off_t dvb_plugin_read (input_plugin_t *this_gen, - char *buf, off_t len) { + void *buf_gen, off_t len) { dvb_input_plugin_t *this = (dvb_input_plugin_t *) this_gen; + char *buf = (char *)buf_gen; + off_t n=0, total=0; int have_mutex=0; struct pollfd pfd; diff --git a/src/input/input_dvd.c b/src/input/input_dvd.c index 1a8861289..dc38ceecd 100644 --- a/src/input/input_dvd.c +++ b/src/input/input_dvd.c @@ -853,8 +853,9 @@ static buf_element_t *dvd_plugin_read_block (input_plugin_t *this_gen, return buf; } -static off_t dvd_plugin_read (input_plugin_t *this_gen, char *ch_buf, off_t len) { +static off_t dvd_plugin_read (input_plugin_t *this_gen, void *buf_gen, off_t len) { /* dvd_input_plugin_t *this = (dvd_input_plugin_t*)this_gen; */ + char *ch_buf = (char *)buf_gen; /* FIXME: Tricking the demux_mpeg_block plugin */ ch_buf[0] = 0; diff --git a/src/input/input_file.c b/src/input/input_file.c index 1dce8baad..cc1e55c87 100644 --- a/src/input/input_file.c +++ b/src/input/input_file.c @@ -144,7 +144,7 @@ static int check_mmap_file(file_input_plugin_t *this) { } #endif -static off_t file_plugin_read (input_plugin_t *this_gen, char *buf, off_t len) { +static off_t file_plugin_read (input_plugin_t *this_gen, void *buf, off_t len) { file_input_plugin_t *this = (file_input_plugin_t *) this_gen; #ifdef HAVE_MMAP diff --git a/src/input/input_gnome_vfs.c b/src/input/input_gnome_vfs.c index 540abd0f4..1fe29fbcd 100644 --- a/src/input/input_gnome_vfs.c +++ b/src/input/input_gnome_vfs.c @@ -75,8 +75,9 @@ gnomevfs_plugin_get_capabilities (input_plugin_t *this_gen) #define SSH_BUFFER_SIZE 256 * 1024 static off_t -gnomevfs_plugin_read (input_plugin_t *this_gen, char *buf, off_t len) +gnomevfs_plugin_read (input_plugin_t *this_gen, void *buf_gen, off_t len) { + char *buf = (char *)buf_gen; gnomevfs_input_t *this = (gnomevfs_input_t *) this_gen; off_t n, num_bytes; diff --git a/src/input/input_http.c b/src/input/input_http.c index d1202ae14..3db5af002 100644 --- a/src/input/input_http.c +++ b/src/input/input_http.c @@ -404,8 +404,9 @@ error: } static off_t http_plugin_read (input_plugin_t *this_gen, - char *buf, off_t nlen) { + void *buf_gen, off_t nlen) { http_input_plugin_t *this = (http_input_plugin_t *) this_gen; + char *buf = (char *)buf_gen; off_t n, num_bytes; num_bytes = 0; diff --git a/src/input/input_mms.c b/src/input/input_mms.c index 739d81a59..23102ac18 100644 --- a/src/input/input_mms.c +++ b/src/input/input_mms.c @@ -98,8 +98,9 @@ typedef struct { } mms_input_class_t; static off_t mms_plugin_read (input_plugin_t *this_gen, - char *buf, off_t len) { + void *buf_gen, off_t len) { mms_input_plugin_t *this = (mms_input_plugin_t *) this_gen; + char *buf = (char *)buf_gen; off_t n = 0; lprintf ("mms_plugin_read: %"PRId64" bytes ...\n", len); diff --git a/src/input/input_net.c b/src/input/input_net.c index 0ce2e1340..dd318c37c 100644 --- a/src/input/input_net.c +++ b/src/input/input_net.c @@ -249,8 +249,9 @@ static int host_connect(const char *host, int port, xine_t *xine) { #define HIGH_WATER_MARK 100 static off_t net_plugin_read (input_plugin_t *this_gen, - char *buf, off_t len) { + void *buf_gen, off_t len) { net_input_plugin_t *this = (net_input_plugin_t *) this_gen; + char *buf = (char *)buf_gen; off_t n, total; lprintf("reading %" PRIdMAX " bytes...\n", (intmax_t)len); diff --git a/src/input/input_pnm.c b/src/input/input_pnm.c index e1413b0f7..29d65da2d 100644 --- a/src/input/input_pnm.c +++ b/src/input/input_pnm.c @@ -76,8 +76,9 @@ typedef struct { static off_t pnm_plugin_read (input_plugin_t *this_gen, - char *buf, off_t len) { + void *buf_gen, off_t len) { pnm_input_plugin_t *this = (pnm_input_plugin_t *) this_gen; + char *buf = (char *)buf_gen; off_t n; lprintf ("pnm_plugin_read: %"PRId64" bytes ...\n", len); diff --git a/src/input/input_pvr.c b/src/input/input_pvr.c index bcf93af2b..48b69c8f5 100644 --- a/src/input/input_pvr.c +++ b/src/input/input_pvr.c @@ -423,8 +423,9 @@ static uint32_t pvr_plugin_get_capabilities (input_plugin_t *this_gen) { } -static off_t pvr_plugin_read (input_plugin_t *this_gen, char *buf, off_t len) { +static off_t pvr_plugin_read (input_plugin_t *this_gen, void *buf_gen, off_t len) { /*pvr_input_plugin_t *this = (pvr_input_plugin_t *) this_gen;*/ + char *buf = (char *)buf_gen; /* FIXME: Tricking the demux_mpeg_block plugin */ buf[0] = 0; diff --git a/src/input/input_rtp.c b/src/input/input_rtp.c index d4ba804c6..2c6c581c2 100644 --- a/src/input/input_rtp.c +++ b/src/input/input_rtp.c @@ -432,8 +432,9 @@ static void * input_plugin_read_loop(void *arg) { /* ***************************************************************** */ static off_t rtp_plugin_read (input_plugin_t *this_gen, - char *buf, off_t length) { + void *buf_gen, off_t length) { rtp_input_plugin_t *this = (rtp_input_plugin_t *) this_gen; + char *buf = (char *)buf_gen; struct timeval tv; struct timespec timeout; diff --git a/src/input/input_rtsp.c b/src/input/input_rtsp.c index 693e8af66..cd2209baa 100644 --- a/src/input/input_rtsp.c +++ b/src/input/input_rtsp.c @@ -77,7 +77,7 @@ typedef struct { static off_t rtsp_plugin_read (input_plugin_t *this_gen, - char *buf, off_t len) { + void *buf, off_t len) { rtsp_input_plugin_t *this = (rtsp_input_plugin_t *) this_gen; off_t n; diff --git a/src/input/input_smb.c b/src/input/input_smb.c index 4cacebf89..87f2a81fa 100644 --- a/src/input/input_smb.c +++ b/src/input/input_smb.c @@ -66,9 +66,10 @@ smb_plugin_get_capabilities (input_plugin_t *this_gen) static off_t -smb_plugin_read (input_plugin_t *this_gen, char *buf, off_t len) +smb_plugin_read (input_plugin_t *this_gen, void *buf_gen, off_t len) { smb_input_t *this = (smb_input_t *) this_gen; + char *buf = (char *)buf_gen; off_t n, num_bytes; num_bytes = 0; diff --git a/src/input/input_stdin_fifo.c b/src/input/input_stdin_fifo.c index 939f56f25..2b3cf1376 100644 --- a/src/input/input_stdin_fifo.c +++ b/src/input/input_stdin_fifo.c @@ -81,9 +81,10 @@ static off_t stdin_plugin_get_current_pos (input_plugin_t *this_gen); static off_t stdin_plugin_read (input_plugin_t *this_gen, - char *buf, off_t len) { + void *buf_gen, off_t len) { stdin_input_plugin_t *this = (stdin_input_plugin_t *) this_gen; + char *buf = (char *)buf_gen; off_t n, total; lprintf ("reading %"PRId64" bytes...\n", len); diff --git a/src/input/input_v4l.c b/src/input/input_v4l.c index 6829470ff..959874b14 100644 --- a/src/input/input_v4l.c +++ b/src/input/input_v4l.c @@ -1192,7 +1192,7 @@ static int v4l_adjust_realtime_speed(v4l_input_plugin_t *this, fifo_buffer_t *fi * Plugin read. * This function is not supported by the plugin. */ -static off_t v4l_plugin_read (input_plugin_t *this_gen, char *buf, off_t len) { +static off_t v4l_plugin_read (input_plugin_t *this_gen, void *buf, off_t len) { lprintf("Read not supported\n"); return 0; } diff --git a/src/input/input_vcd.c b/src/input/input_vcd.c index bcd50ecc1..7d2ea0063 100644 --- a/src/input/input_vcd.c +++ b/src/input/input_vcd.c @@ -340,9 +340,10 @@ static int sun_vcd_read(vcd_input_plugin_t *this, long lba, cdsector_t *data) #if defined (__linux__) static off_t vcd_plugin_read (input_plugin_t *this_gen, - char *buf, off_t nlen) { + void *buf_gen, off_t nlen) { vcd_input_plugin_t *this = (vcd_input_plugin_t *) this_gen; + char *buf = (char *)buf_gen; static struct cdrom_msf msf ; static cdsector_t data; struct cdrom_msf0 *end_msf; @@ -398,8 +399,9 @@ static off_t vcd_plugin_read (input_plugin_t *this_gen, } #elif defined (__FreeBSD__) static off_t vcd_plugin_read (input_plugin_t *this_gen, - char *buf, off_t nlen) { + void *buf_gen, off_t nlen) { vcd_input_plugin_t *this = (vcd_input_plugin_t *) this_gen; + char *buf = (char *)buf_gen; static cdsector_t data; int bsize = 2352; @@ -422,9 +424,10 @@ static off_t vcd_plugin_read (input_plugin_t *this_gen, } #elif defined (__sun) static off_t vcd_plugin_read (input_plugin_t *this_gen, - char *buf, off_t nlen) { + void *buf_gen, off_t nlen) { vcd_input_plugin_t *this = (vcd_input_plugin_t *) this_gen; + char *buf = (char *)buf_gen; static cdsector_t data; struct cdrom_msf0 *end_msf; long lba; diff --git a/src/vdr/input_vdr.c b/src/vdr/input_vdr.c index 1f82def28..97da8e834 100644 --- a/src/vdr/input_vdr.c +++ b/src/vdr/input_vdr.c @@ -1308,9 +1308,10 @@ static int internal_write_event_play_external(vdr_input_plugin_t *this, uint32_t } static off_t vdr_plugin_read(input_plugin_t *this_gen, - char *buf, off_t len) + void *buf_gen, off_t len) { vdr_input_plugin_t *this = (vdr_input_plugin_t *) this_gen; + char *buf = (char *)buf_gen; off_t n, total; #ifdef LOG_READ lprintf ("reading %lld bytes...\n", len); diff --git a/src/xine-engine/input_cache.c b/src/xine-engine/input_cache.c index 75c4beb43..7537c4d16 100644 --- a/src/xine-engine/input_cache.c +++ b/src/xine-engine/input_cache.c @@ -62,8 +62,9 @@ typedef struct { /* * read data from input plugin and write it into file */ -static off_t cache_plugin_read(input_plugin_t *this_gen, char *buf, off_t len) { +static off_t cache_plugin_read(input_plugin_t *this_gen, void *buf_gen, off_t len) { cache_input_plugin_t *this = (cache_input_plugin_t *)this_gen; + char *buf = (char *)buf_gen; off_t read_len = 0; off_t main_read; diff --git a/src/xine-engine/input_rip.c b/src/xine-engine/input_rip.c index 56850ba2d..774ef82c5 100644 --- a/src/xine-engine/input_rip.c +++ b/src/xine-engine/input_rip.c @@ -100,8 +100,9 @@ static off_t min_off(off_t a, off_t b) { /* * read data from input plugin and write it into file */ -static off_t rip_plugin_read(input_plugin_t *this_gen, char *buf, off_t len) { +static off_t rip_plugin_read(input_plugin_t *this_gen, void *buf_gen, off_t len) { rip_input_plugin_t *this = (rip_input_plugin_t *)this_gen; + char *buf = (char *)buf_gen; off_t retlen, npreview, nread, nwrite, nread_orig, nread_file; lprintf("reading %"PRId64" bytes (curpos = %"PRId64", savepos = %"PRId64")\n", len, this->curpos, this->savepos); -- cgit v1.2.3