From a7d0cdf95fd8847ab76b35446e1c9b77f8ef1cb7 Mon Sep 17 00:00:00 2001 From: rubidium Date: Wed, 10 Jan 2007 18:56:51 +0000 Subject: (svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b. --- src/sound.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/sound.cpp') diff --git a/src/sound.cpp b/src/sound.cpp index 7e78b07dd..c1d9c73f4 100644 --- a/src/sound.cpp +++ b/src/sound.cpp @@ -11,6 +11,7 @@ #include "viewport.h" #include "fileio.h" #include "newgrf_sound.h" +#include "helpers.hpp" static uint _file_count; static FileEntry *_files; @@ -28,7 +29,7 @@ static void OpenBankFile(const char *filename) FioOpenFile(SOUND_SLOT, filename); count = FioReadDword() / 8; - fe = calloc(count, sizeof(*fe)); + CallocT(&fe, count); if (fe == NULL) { _file_count = 0; @@ -109,7 +110,7 @@ static bool SetBankSource(MixerChannel *mc, uint bank) if (fe->file_size == 0) return false; - mem = malloc(fe->file_size); + MallocT(&mem, fe->file_size); if (mem == NULL) return false; FioSeekToFile(fe->file_offset); -- cgit v1.2.3-54-g00ecf