shithub: cstory

Download patch

ref: 92ce7aeb5d94190af5d47c5c2545ac910e7f135b
parent: d6bbb013f93adbb8c3767108c8aff765f4553ccd
author: Clownacy <Clownacy@users.noreply.github.com>
date: Wed Jul 8 12:35:09 EDT 2020

Use fixed-size types for the WAV header struct

This matches the WAVEFORMATEX struct

--- a/src/Sound.cpp
+++ b/src/Sound.cpp
@@ -300,19 +300,19 @@
 	// when it only needs a WAVEFORMATEX
 	typedef struct WavHeader
 	{
-		char riff[4];
-		unsigned long wav_size;
-		char wave[4];
-		char fmt[4];
-		unsigned long fmt_chunk_size;
-		unsigned short audio_format;
-		unsigned short num_channels;
-		unsigned long sample_rate;
-		unsigned long byte_rate;
-		unsigned short sample_alignment;
-		unsigned short bit_depth;
-		char data[4];
-		unsigned long data_bytes;
+		CHAR riff[4];
+		DWORD wav_size;
+		CHAR wave[4];
+		CHAR fmt[4];
+		DWORD fmt_chunk_size;
+		WORD audio_format;
+		WORD num_channels;
+		DWORD sample_rate;
+		DWORD byte_rate;
+		WORD sample_alignment;
+		WORD bit_depth;
+		CHAR data[4];
+		DWORD data_bytes;
 	} WavHeader;
 
 	int sample_count;