(svn r8066) - Codechange: MallocT(), CallocT(), ReallocT() now return the pointer to allocated memory instead of modifying the pointer given as parameter

This commit is contained in:
KUDr
2007-01-11 17:29:39 +00:00
parent 5675956443
commit 28e969924b
49 changed files with 141 additions and 181 deletions

View File

@@ -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);