Lot of cleanings with the help of gcc3

This commit is contained in:
Abramo Bagnara 2001-03-29 17:50:28 +00:00
parent ce8275b943
commit 5b50ec848a
59 changed files with 669 additions and 667 deletions

View file

@ -44,9 +44,9 @@ int snd_seq_open(snd_seq_t **seqp, const char *name,
int err;
snd_config_t *seq_conf, *conf, *type_conf;
snd_config_iterator_t i, next;
const char *lib = NULL, *open = NULL;
int (*open_func)(snd_seq_t **seqp, const char *name, snd_config_t *conf,
int streams, int mode);
const char *lib = NULL, *open_name = NULL;
int (*open_func)(snd_seq_t **, const char *, snd_config_t *,
int, int);
void *h;
const char *name1;
assert(seqp && name);
@ -91,7 +91,7 @@ int snd_seq_open(snd_seq_t **seqp, const char *name,
continue;
}
if (strcmp(id, "open") == 0) {
err = snd_config_get_string(n, &open);
err = snd_config_get_string(n, &open_name);
if (err < 0) {
SNDERR("Invalid type for %s", id);
return -EINVAL;
@ -102,8 +102,8 @@ int snd_seq_open(snd_seq_t **seqp, const char *name,
return -EINVAL;
}
}
if (!open) {
open = buf;
if (!open_name) {
open_name = buf;
snprintf(buf, sizeof(buf), "_snd_seq_%s_open", str);
}
if (!lib)
@ -113,9 +113,9 @@ int snd_seq_open(snd_seq_t **seqp, const char *name,
SNDERR("Cannot open shared library %s", lib);
return -ENOENT;
}
open_func = dlsym(h, open);
open_func = dlsym(h, open_name);
if (!open_func) {
SNDERR("symbol %s is not defined inside %s", open, lib);
SNDERR("symbol %s is not defined inside %s", open_name, lib);
dlclose(h);
return -ENXIO;
}
@ -147,12 +147,6 @@ int snd_seq_close(snd_seq_t *seq)
/*
* returns the file descriptor of the client
*/
int _snd_seq_poll_descriptor(snd_seq_t *seq)
{
assert(seq);
return seq->poll_fd;
}
int snd_seq_poll_descriptors_count(snd_seq_t *seq, short events)
{
int result = 0;
@ -753,8 +747,7 @@ int snd_seq_event_output_direct(snd_seq_t *seq, snd_seq_event_t *ev)
memcpy(seq->tmpbuf + 1, ev->data.ext.ptr, ev->data.ext.len);
buf = seq->tmpbuf;
}
return seq->ops->write(seq, buf, len);
return seq->ops->write(seq, buf, (size_t) len);
}
/*

View file

@ -25,11 +25,11 @@
/* midi status */
struct snd_midi_event {
int qlen; /* queue length */
int read; /* chars read */
size_t qlen; /* queue length */
size_t read; /* chars read */
int type; /* current event type */
unsigned char lastcmd;
int bufsize;
size_t bufsize;
unsigned char *buf; /* input buffer */
};
@ -116,7 +116,7 @@ static struct extra_event_list_t {
* new/delete record
*/
int snd_midi_event_new(int bufsize, snd_midi_event_t **rdev)
int snd_midi_event_new(size_t bufsize, snd_midi_event_t **rdev)
{
snd_midi_event_t *dev;
@ -174,7 +174,7 @@ void snd_midi_event_init(snd_midi_event_t *dev)
/*
* resize buffer
*/
int snd_midi_event_resize_buffer(snd_midi_event_t *dev, int bufsize)
int snd_midi_event_resize_buffer(snd_midi_event_t *dev, size_t bufsize)
{
unsigned char *new_buf, *old_buf;

View file

@ -47,12 +47,12 @@ void snd_seq_ev_schedule_tick(snd_seq_event_t *ev, int q, int relative,
/* queued on real-time */
void snd_seq_ev_schedule_real(snd_seq_event_t *ev, int q, int relative,
snd_seq_real_time_t *time)
snd_seq_real_time_t *_time)
{
ev->flags &= ~( SND_SEQ_TIME_STAMP_MASK | SND_SEQ_TIME_MODE_MASK);
ev->flags |= SND_SEQ_TIME_STAMP_REAL;
ev->flags |= relative ? SND_SEQ_TIME_MODE_REL : SND_SEQ_TIME_MODE_ABS;
ev->time.time = *time;
ev->time.time = *_time;
ev->queue = q;
}