shithub: cstory

Download patch

ref: d025fecf54cc30f1186c209a73c8896392b48632
parent: 274de9e0f9c674b603927a9d14d408c03858db19
author: Clownacy <Clownacy@users.noreply.github.com>
date: Fri Apr 17 11:47:56 EDT 2020

Minor cleanup

--- a/src/Backends/Audio/WiiU.cpp
+++ b/src/Backends/Audio/WiiU.cpp
@@ -43,7 +43,7 @@
 {
 	static uint64_t accumulator;
 
-	static unsigned long last_tick;
+	static unsigned long last_tick;	// For some dumbass reason, OSTick is signed, so force unsigned here instead
 
 	unsigned long current_tick = OSGetTick();
 
@@ -94,8 +94,7 @@
 {
 	if (!AXIsInit())
 	{
-		static AXInitParams initparams =
-		{
+		AXInitParams initparams = {
 			.renderer = AX_INIT_RENDERER_48KHZ,
 			.pipeline = AX_INIT_PIPELINE_SINGLE,
 		};
@@ -213,8 +212,9 @@
 {
 	if (sound->voice != NULL)
 	{
-		AXFreeVoice(sound->voice);
+		AXVoice *voice = sound->voice;
 		sound->voice = NULL;
+		AXFreeVoice(voice);
 	}
 }
 
@@ -241,9 +241,7 @@
 
 	if (sound->voice != NULL)
 	{
-		AXVoiceVeData vol = {
-			.volume = sound->volume,
-		};
+		AXVoiceVeData vol = {.volume = sound->volume};
 
 		AXSetVoiceVe(sound->voice, &vol);
 	}