From 28e969924b9033f5132fe2ba223e2bcadd39a7ec Mon Sep 17 00:00:00 2001 From: KUDr Date: Thu, 11 Jan 2007 17:29:39 +0000 Subject: (svn r8066) - Codechange: MallocT(), CallocT(), ReallocT() now return the pointer to allocated memory instead of modifying the pointer given as parameter --- src/sound.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/sound.cpp') diff --git a/src/sound.cpp b/src/sound.cpp index c1d9c73f4..1a60b14ba 100644 --- a/src/sound.cpp +++ b/src/sound.cpp @@ -23,13 +23,12 @@ static FileEntry *_files; static void OpenBankFile(const char *filename) { - FileEntry *fe; uint count; uint i; FioOpenFile(SOUND_SLOT, filename); count = FioReadDword() / 8; - CallocT(&fe, count); + FileEntry *fe = CallocT(count); if (fe == NULL) { _file_count = 0; @@ -102,7 +101,6 @@ uint GetNumOriginalSounds(void) static bool SetBankSource(MixerChannel *mc, uint bank) { const FileEntry *fe; - int8 *mem; uint i; if (bank >= GetNumSounds()) return false; @@ -110,7 +108,7 @@ static bool SetBankSource(MixerChannel *mc, uint bank) if (fe->file_size == 0) return false; - MallocT(&mem, fe->file_size); + int8 *mem = MallocT(fe->file_size); if (mem == NULL) return false; FioSeekToFile(fe->file_offset); -- cgit v1.2.3-54-g00ecf