summaryrefslogtreecommitdiff
path: root/src/input
diff options
context:
space:
mode:
Diffstat (limited to 'src/input')
-rw-r--r--src/input/input_dvb.c8
-rw-r--r--src/input/input_file.c27
2 files changed, 17 insertions, 18 deletions
diff --git a/src/input/input_dvb.c b/src/input/input_dvb.c
index d29b08c49..9ff40f7ea 100644
--- a/src/input/input_dvb.c
+++ b/src/input/input_dvb.c
@@ -1306,8 +1306,8 @@ static void dvb_parse_si(dvb_input_plugin_t *this) {
/* Helper function for finding the channel index in the channels struct
given the service_id. If channel is not found, -1 is returned. */
-static int channel_index(dvb_input_plugin_t* this, unsigned int service_id) {
- unsigned int n;
+static int channel_index(dvb_input_plugin_t* this, int service_id) {
+ int n;
for (n=0; n < this->num_channels; n++)
if (this->channels[n].service_id == service_id)
return n;
@@ -2802,7 +2802,7 @@ static int dvb_plugin_open(input_plugin_t * this_gen)
* by numbers...
*/
int chanlen = strlen(channame);
- int offset = 0;
+ size_t offset = 0;
xprintf(this->class->xine, XINE_VERBOSITY_LOG,
_("input_dvb: exact match for %s not found: trying partial matches\n"), channame);
@@ -2819,7 +2819,7 @@ static int dvb_plugin_open(input_plugin_t * this_gen)
idx++;
}
offset++;
- xprintf(this->class->xine,XINE_VERBOSITY_LOG,"%d,%d,%d\n", offset, idx, num_channels);
+ xprintf(this->class->xine,XINE_VERBOSITY_LOG,"%zd,%d,%d\n", offset, idx, num_channels);
}
while ((offset < 6) && (idx == num_channels));
if (idx < num_channels) {
diff --git a/src/input/input_file.c b/src/input/input_file.c
index cc1e55c87..dd67d06ed 100644
--- a/src/input/input_file.c
+++ b/src/input/input_file.c
@@ -82,8 +82,8 @@ typedef struct {
int fh;
#ifdef HAVE_MMAP
int mmap_on;
- void *mmap_base;
- void *mmap_curr;
+ uint8_t *mmap_base;
+ uint8_t *mmap_curr;
off_t mmap_len;
#endif
char *mrl;
@@ -223,7 +223,7 @@ static off_t file_plugin_seek (input_plugin_t *this_gen, off_t offset, int origi
#ifdef HAVE_MMAP /* Simulate f*() library calls */
if ( check_mmap_file(this) ) {
- void *new_point = this->mmap_curr;
+ uint8_t *new_point = this->mmap_curr;
switch(origin) {
case SEEK_SET: new_point = this->mmap_base + offset; break;
case SEEK_CUR: new_point = this->mmap_curr + offset; break;
@@ -359,9 +359,6 @@ static int file_plugin_open (input_plugin_t *this_gen ) {
file_input_plugin_t *this = (file_input_plugin_t *) this_gen;
char *filename;
struct stat sbuf;
-#ifdef HAVE_MMAP
- size_t tmp_size;
-#endif
lprintf("file_plugin_open\n");
@@ -426,14 +423,16 @@ static int file_plugin_open (input_plugin_t *this_gen ) {
}
#ifdef HAVE_MMAP
- tmp_size = sbuf.st_size; /* may cause truncation - if it does, DON'T mmap! */
- if ((tmp_size == sbuf.st_size) &&
- ( (this->mmap_base = mmap(NULL, tmp_size, PROT_READ, MAP_SHARED, this->fh, 0)) != (void*)-1 )) {
- this->mmap_on = 1;
- this->mmap_curr = this->mmap_base;
- this->mmap_len = sbuf.st_size;
- } else {
- this->mmap_base = NULL;
+ {
+ size_t tmp_size = sbuf.st_size; /* may cause truncation - if it does, DON'T mmap! */
+ if ((tmp_size == sbuf.st_size) &&
+ ( (this->mmap_base = mmap(NULL, tmp_size, PROT_READ, MAP_SHARED, this->fh, 0)) != (void*)-1 )) {
+ this->mmap_on = 1;
+ this->mmap_curr = this->mmap_base;
+ this->mmap_len = sbuf.st_size;
+ } else {
+ this->mmap_base = NULL;
+ }
}
#endif