diff options
author | KUDr <KUDr@openttd.org> | 2007-01-11 17:29:39 +0000 |
---|---|---|
committer | KUDr <KUDr@openttd.org> | 2007-01-11 17:29:39 +0000 |
commit | 28e969924b9033f5132fe2ba223e2bcadd39a7ec (patch) | |
tree | d644a3831ca0947198b191fa3e4e8973d3a9786e /src/sound.cpp | |
parent | 5675956443d4e58713a0abd8cedb4eaaaccf22d4 (diff) | |
download | openttd-28e969924b9033f5132fe2ba223e2bcadd39a7ec.tar.xz |
(svn r8066) - Codechange: MallocT(), CallocT(), ReallocT() now return the pointer to allocated memory instead of modifying the pointer given as parameter
Diffstat (limited to 'src/sound.cpp')
-rw-r--r-- | src/sound.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
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<FileEntry>(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<int8>(fe->file_size); if (mem == NULL) return false; FioSeekToFile(fe->file_offset); |