From 181e19017dde9f7e4e58654685de3bca3146369c Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Wed, 30 Aug 2023 12:54:50 +0200 Subject: [PATCH] aplaymidi: fix the verbose compilation warnings for latest gcc Signed-off-by: Jaroslav Kysela --- seq/aplaymidi/aplaymidi.c | 7 ++++--- seq/aplaymidi/arecordmidi.c | 6 +++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/seq/aplaymidi/aplaymidi.c b/seq/aplaymidi/aplaymidi.c index e96364f..88d4e63 100644 --- a/seq/aplaymidi/aplaymidi.c +++ b/seq/aplaymidi/aplaymidi.c @@ -624,7 +624,7 @@ static void handle_big_sysex(snd_seq_event_t *ev) if (length > MIDI_BYTES_PER_SEC) ev->data.ext.len = MIDI_BYTES_PER_SEC; event_size = snd_seq_event_length(ev); - if (event_size + 1 > snd_seq_get_output_buffer_size(seq)) { + if (event_size + 1 > (ssize_t)snd_seq_get_output_buffer_size(seq)) { err = snd_seq_drain_output(seq); check_snd("drain output", err); err = snd_seq_set_output_buffer_size(seq, event_size + 1); @@ -803,7 +803,7 @@ static void play_midi(void) for (i = 0; i < num_tracks; ++i) { struct track *track = &tracks[i]; struct event *e2 = track->current_event; - if (e2 && e2->tick < min_tick) { + if (e2 && e2->tick < (unsigned int)min_tick) { min_tick = e2->tick; event = e2; event_track = track; @@ -988,7 +988,7 @@ int main(int argc, char *argv[]) {"delay", 1, NULL, 'd'}, {0} }; - int c, err; + int c; int do_list = 0; init_seq(); @@ -1029,6 +1029,7 @@ int main(int argc, char *argv[]) #ifdef HAVE_SEQ_CLIENT_INFO_GET_MIDI_VERSION if (ump_mode) { + int err; err = snd_seq_set_client_midi_version(seq, SND_SEQ_CLIENT_UMP_MIDI_1_0); check_snd("set midi version", err); } diff --git a/seq/aplaymidi/arecordmidi.c b/seq/aplaymidi/arecordmidi.c index 2034df7..ce71472 100644 --- a/seq/aplaymidi/arecordmidi.c +++ b/seq/aplaymidi/arecordmidi.c @@ -455,7 +455,7 @@ static void record_port_numbers(void) static void record_event(const snd_seq_event_t *ev) { - unsigned int i; + int i; struct smf_track *track; /* ignore events without proper timestamps */ @@ -583,7 +583,7 @@ static void record_event(const snd_seq_event_t *ev) else command(track, 0xf7), i = 0; var_value(track, ev->data.ext.len - i); - for (; i < ev->data.ext.len; ++i) + for (; i < (int)ev->data.ext.len; ++i) add_byte(track, ((unsigned char*)ev->data.ext.ptr)[i]); break; default: @@ -719,7 +719,7 @@ static void version(void) fputs("arecordmidi version " SND_UTIL_VERSION_STR "\n", stderr); } -static void sighandler(int sig) +static void sighandler(int) { stop = 1; }