Fix compilation with -Werror=float-conversion

Better make the conversions explicit so that we don't get any surprises.

Fixes #4065
This commit is contained in:
Wim Taymans 2024-06-18 12:17:56 +02:00
parent 50870aac57
commit 1ae4374ccf
71 changed files with 286 additions and 284 deletions

View file

@ -433,7 +433,7 @@ int midi_file_write_event(struct midi_file *mf, const struct midi_event *event)
tr = &mf->tracks[event->track];
tick = event->sec * (1000000.0 * mf->info.division) / (double)mf->tempo;
tick = (uint32_t)(event->sec * (1000000.0 * mf->info.division) / (double)mf->tempo);
CHECK_RES(write_varlen(mf, tr, tick - tr->tick));
tr->tick = tick;