From 4ccc53146ceecf9658327a570297c15ff5ab375d Mon Sep 17 00:00:00 2001 From: Michael Roitzsch Date: Sun, 26 Oct 2003 10:48:24 +0000 Subject: fix some prominent compiler warnings CVS patchset: 5600 CVS date: 2003/10/26 10:48:24 --- src/input/input_dvd.c | 26 ++++++++++---------------- src/input/input_file.c | 8 ++++---- src/input/input_net.c | 10 +++++++--- src/input/input_v4l.c | 13 ------------- src/input/media_helper.c | 10 +++------- src/input/media_helper.h | 2 +- src/input/mmsh.c | 27 +++++++++++---------------- 7 files changed, 36 insertions(+), 60 deletions(-) (limited to 'src') diff --git a/src/input/input_dvd.c b/src/input/input_dvd.c index cdb250e2a..1a0fbc9a8 100644 --- a/src/input/input_dvd.c +++ b/src/input/input_dvd.c @@ -18,7 +18,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: input_dvd.c,v 1.168 2003/08/25 21:51:39 f1rmb Exp $ + * $Id: input_dvd.c,v 1.169 2003/10/26 10:48:24 mroi Exp $ * */ @@ -266,7 +266,7 @@ static uint32_t dvd_plugin_get_capabilities (input_plugin_t *this_gen) { INPUT_CAP_AUDIOLANG | INPUT_CAP_SPULANG | INPUT_CAP_CHAPTERS; } -void read_ahead_cb(void *this_gen, xine_cfg_entry_t *entry) { +static void read_ahead_cb(void *this_gen, xine_cfg_entry_t *entry) { dvd_input_class_t *class = (dvd_input_class_t*)this_gen; if(!class) @@ -281,7 +281,7 @@ void read_ahead_cb(void *this_gen, xine_cfg_entry_t *entry) { } } -void seek_mode_cb(void *this_gen, xine_cfg_entry_t *entry) { +static void seek_mode_cb(void *this_gen, xine_cfg_entry_t *entry) { dvd_input_class_t *class = (dvd_input_class_t*)this_gen; if(!class) @@ -296,7 +296,7 @@ void seek_mode_cb(void *this_gen, xine_cfg_entry_t *entry) { } } -void region_changed_cb (void *this_gen, xine_cfg_entry_t *entry) { +static void region_changed_cb (void *this_gen, xine_cfg_entry_t *entry) { dvd_input_class_t *class = (dvd_input_class_t*)this_gen; if(!class) @@ -311,7 +311,7 @@ void region_changed_cb (void *this_gen, xine_cfg_entry_t *entry) { } } -void language_changed_cb(void *this_gen, xine_cfg_entry_t *entry) { +static void language_changed_cb(void *this_gen, xine_cfg_entry_t *entry) { dvd_input_class_t *class = (dvd_input_class_t*)this_gen; if(!class) @@ -406,13 +406,6 @@ static void update_title_display(dvd_input_plugin_t *this) { xine_event_send(this->stream, &uevent); } -static void dvd_plugin_stop (input_plugin_t *this_gen) { - dvd_input_plugin_t *this = (dvd_input_plugin_t*) this_gen; - if (this->dvdnav) { - dvdnav_still_skip(this->dvdnav); - } -} - static void dvd_plugin_dispose (input_plugin_t *this_gen) { dvd_input_plugin_t *this = (dvd_input_plugin_t*)this_gen; @@ -437,9 +430,9 @@ static void dvd_plugin_dispose (input_plugin_t *this_gen) { #define PTR_ALIGN(p, align) ((void*) (((long)(p) + (align) - 1) & ~((align)-1)) ) -static void dvd_build_mrl_list(dvd_input_plugin_t *this) { /* FIXME */ #if 0 +static void dvd_build_mrl_list(dvd_input_plugin_t *this) { int num_titles, *num_parts; /* skip DVD if already open */ @@ -512,10 +505,8 @@ static void dvd_build_mrl_list(dvd_input_plugin_t *this) { } free(num_parts); } -#else - return; -#endif } +#endif static void dvd_plugin_free_buffer(buf_element_t *buf) { dvd_input_plugin_t *this = buf->source; @@ -1736,6 +1727,9 @@ static void *init_class (xine_t *xine, void *data) { /* * $Log: input_dvd.c,v $ + * Revision 1.169 2003/10/26 10:48:24 mroi + * fix some prominent compiler warnings + * * Revision 1.168 2003/08/25 21:51:39 f1rmb * Reduce GCC verbosity (various prototype declaration fixes). ffmpeg, wine and fft*post are untouched (fft: for now). * diff --git a/src/input/input_file.c b/src/input/input_file.c index f4652a4dc..1e053cb51 100644 --- a/src/input/input_file.c +++ b/src/input/input_file.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: input_file.c,v 1.84 2003/10/15 13:51:21 valtri Exp $ + * $Id: input_file.c,v 1.85 2003/10/26 10:48:24 mroi Exp $ */ #ifdef HAVE_CONFIG_H @@ -351,7 +351,7 @@ static void origin_change_cb(void *data, xine_cfg_entry_t *cfg) { #define CMP 2 #define LEN 3 #define ISDIGIT(c) ((unsigned) (c) - '0' <= 9) -static int strverscmp(const char *s1, const char *s2) { +static int _strverscmp(const char *s1, const char *s2) { const unsigned char *p1 = (const unsigned char *) s1; const unsigned char *p2 = (const unsigned char *) s2; unsigned char c1, c2; @@ -408,10 +408,10 @@ static int strverscmp(const char *s1, const char *s2) { } /* - * Wrapper to strverscmp() for qsort() calls, which sort mrl_t type array. + * Wrapper to _strverscmp() for qsort() calls, which sort mrl_t type array. */ static int _sortfiles_default(const xine_mrl_t *s1, const xine_mrl_t *s2) { - return(strverscmp(s1->mrl, s2->mrl)); + return(_strverscmp(s1->mrl, s2->mrl)); } /* diff --git a/src/input/input_net.c b/src/input/input_net.c index de16aaccd..cac1fcc1b 100644 --- a/src/input/input_net.c +++ b/src/input/input_net.c @@ -20,7 +20,7 @@ * Read from a tcp network stream over a lan (put a tweaked mp1e encoder the * other end and you can watch tv anywhere in the house ..) * - * $Id: input_net.c,v 1.52 2003/09/25 13:47:17 f1rmb Exp $ + * $Id: input_net.c,v 1.53 2003/10/26 10:48:24 mroi Exp $ * * how to set up mp1e for use with this plugin: * @@ -109,6 +109,7 @@ typedef struct { /* Private functions */ /* **************************************************************** */ +#ifndef ENABLE_IPV6 static int host_connect_attempt_ipv4(struct in_addr ia, int port, xine_t *xine) { int s; @@ -139,7 +140,7 @@ static int host_connect_attempt_ipv4(struct in_addr ia, int port, xine_t *xine) return s; } - +#else static int host_connect_attempt(int family, struct sockaddr* sin, int addrlen, xine_t *xine) { int s; @@ -165,7 +166,9 @@ static int host_connect_attempt(int family, struct sockaddr* sin, int addrlen, x return s; } +#endif +#ifndef ENABLE_IPV6 static int host_connect_ipv4(const char *host, int port, xine_t *xine) { struct hostent *h; int i; @@ -190,11 +193,12 @@ static int host_connect_ipv4(const char *host, int port, xine_t *xine) { _("input_net: unable to connect to '%s'.\n"), host); return -1; } +#endif static int host_connect(const char *host, int port, xine_t *xine) { #ifndef ENABLE_IPV6 - return host_connect_ipv4(host, port, xine); + return host_connect_ipv4(host, port, xine); #else struct addrinfo hints, *res, *tmpaddr; diff --git a/src/input/input_v4l.c b/src/input/input_v4l.c index add768ce5..663543cf4 100644 --- a/src/input/input_v4l.c +++ b/src/input/input_v4l.c @@ -776,19 +776,6 @@ static int open_radio_capture_device(v4l_input_plugin_t *this) return 2; } -static int close_radio_capture_device(v4l_input_plugin_t *this) -{ - if (this->radio_fd > 0) - close(this->radio_fd); - else - /* Radio device probably never opened. So nothing left to cleanup. */ - return 0; - - this->radio_fd = 0; - - return 1; -} - /** * Open the video capture device. * diff --git a/src/input/media_helper.c b/src/input/media_helper.c index 9c209f333..ce8f0d701 100644 --- a/src/input/media_helper.c +++ b/src/input/media_helper.c @@ -51,20 +51,16 @@ #define LOG_MEDIA_EJECT -static int media_umount_media(char *device) +static int media_umount_media(const char *device) { #ifndef WIN32 - char *argv[10]; int i; pid_t pid; int status; - argv[0]="umount"; - argv[1]=device; - argv[2]=0; pid=fork(); if (pid == 0) { - i= execv("/bin/umount", argv); + i= execl("/bin/umount", "umount", device, NULL); exit(127); } do { @@ -83,7 +79,7 @@ static int media_umount_media(char *device) #endif /* WIN32 */ } -int media_eject_media (char *device) { +int media_eject_media (const char *device) { #ifndef WIN32 int ret, status; diff --git a/src/input/media_helper.h b/src/input/media_helper.h index 41aeb6cb2..48ef7b383 100644 --- a/src/input/media_helper.h +++ b/src/input/media_helper.h @@ -19,5 +19,5 @@ * */ -int media_eject_media (char *device); +int media_eject_media (const char *device); diff --git a/src/input/mmsh.c b/src/input/mmsh.c index 2ff02a87f..7ff4a9f99 100644 --- a/src/input/mmsh.c +++ b/src/input/mmsh.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: mmsh.c,v 1.17 2003/05/26 17:00:14 tchamp Exp $ + * $Id: mmsh.c,v 1.18 2003/10/26 10:48:25 mroi Exp $ * * MMS over HTTP protocol * written by Thibaut Mattern @@ -972,22 +972,17 @@ static int get_media_packet (mmsh_t *this) { return 0; } - if (this->chunk_length > CHUNK_SIZE) { - printf("libmmsh: invalid chunk length\n"); - return 0; + len = xine_read_abort (this->stream, this->s, this->buf, this->chunk_length); + + if (len == this->chunk_length) { + /* explicit padding with 0 */ + memset(this->buf + this->chunk_length, 0, + this->packet_length - this->chunk_length); + this->buf_size = this->packet_length; + return 1; } else { - len = xine_read_abort (this->stream, this->s, this->buf, this->chunk_length); - - if (len == this->chunk_length) { - /* explicit padding with 0 */ - memset(this->buf + this->chunk_length, 0, - this->packet_length - this->chunk_length); - this->buf_size = this->packet_length; - return 1; - } else { - printf("libmmsh: read error, %d != %d\n", len, this->chunk_length); - return 0; - } + printf("libmmsh: read error, %d != %d\n", len, this->chunk_length); + return 0; } } else { return 0; -- cgit v1.2.3