From caab60e9f09c25d26ae2149f612b935e3ea6ac7a Mon Sep 17 00:00:00 2001
From: Marco Z <mar.marcoz@outlook.com>
Date: Thu, 3 Jan 2019 18:46:30 -0500
Subject: [PATCH] Fix MSVC compile errors

---
 src/sdl/mixer_sound.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/sdl/mixer_sound.c b/src/sdl/mixer_sound.c
index 3434ab295..53b86831a 100644
--- a/src/sdl/mixer_sound.c
+++ b/src/sdl/mixer_sound.c
@@ -118,8 +118,8 @@ static UINT16 current_subsong;
 
 static void var_cleanup(void)
 {
-	loop_point = song_length =\
-	 music_bytes = fading_source = fading_target =\
+	loop_point = song_length = 0.0f;
+	music_bytes = fading_source = fading_target =\
 	 fading_timer = fading_duration = 0;
 
 	songpaused = is_looping =\
@@ -598,7 +598,7 @@ static void music_loop(void)
 	{
 		Mix_PlayMusic(music, 0);
 		Mix_SetMusicPosition(loop_point);
-		music_bytes = loop_point*44100.0L*4; //assume 44.1khz, 4-byte length (see I_GetSongPosition)
+		music_bytes = (UINT32)(loop_point*44100.0L*4); //assume 44.1khz, 4-byte length (see I_GetSongPosition)
 	}
 	else
 		I_StopSong();
@@ -925,7 +925,7 @@ boolean I_SetSongPosition(UINT32 position)
 
 		Mix_RewindMusic(); // needed for mp3
 		if(Mix_SetMusicPosition((float)(position/1000.0L)) == 0)
-			music_bytes = position/1000.0L*44100.0L*4; //assume 44.1khz, 4-byte length (see I_GetSongPosition)
+			music_bytes = (UINT32)(position/1000.0L*44100.0L*4); //assume 44.1khz, 4-byte length (see I_GetSongPosition)
 		else
 			// NOTE: This block fires on incorrect song format,
 			// NOT if position input is greater than song length.
@@ -977,7 +977,7 @@ UINT32 I_GetSongPosition(void)
 	if (!music || I_SongType() == MU_MID)
 		return 0;
 	else
-		return music_bytes/44100.0L*1000.0L/4; //assume 44.1khz
+		return (UINT32)(music_bytes/44100.0L*1000.0L/4); //assume 44.1khz
 		// 4 = byte length for 16-bit samples (AUDIO_S16SYS), stereo (2-channel)
 		// This is hardcoded in I_StartupSound. Other formats for factor:
 		// 8M: 1 | 8S: 2 | 16M: 2 | 16S: 4