shithub: sf2mid

Download patch

ref: 39b19ef81949d40dce389c10dfdef3a619750160
parent: a298ba47b2d18c23b1ed9f9b222959295f040968
author: Ryo Suzuki <reputeless+github@gmail.com>
date: Thu May 3 17:09:39 EDT 2018

Fix MSVC 2017 warning

`warning C4701: potentially uninitialized local variable 'vMatchLast' used`
This becomes an error with SDL checks (/sdl).

--- a/tsf.h
+++ b/tsf.h
@@ -1307,7 +1307,7 @@
 
 TSFDEF void tsf_note_off(tsf* f, int preset_index, int key)
 {
-	struct tsf_voice *v = f->voices, *vEnd = v + f->voiceNum, *vMatchFirst = TSF_NULL, *vMatchLast;
+	struct tsf_voice *v = f->voices, *vEnd = v + f->voiceNum, *vMatchFirst = TSF_NULL, *vMatchLast = TSF_NULL;
 	for (; v != vEnd; v++)
 	{
 		//Find the first and last entry in the voices list with matching preset, key and look up the smallest play index