[OpenSDK-cvs] openSDK/src OPENRAPI.cc,1.22,1.23
Status: Beta
Brought to you by:
nuno-lopes
From: Nuno L. <nun...@us...> - 2007-07-16 13:05:51
|
Update of /cvsroot/opensdk/openSDK/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv21922 Modified Files: OPENRAPI.cc Log Message: fix data allocation size in NewSoundVectorData() use resolve_case_insensitive_path() on paths Index: OPENRAPI.cc =================================================================== RCS file: /cvsroot/opensdk/openSDK/src/OPENRAPI.cc,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- OPENRAPI.cc 8 Mar 2007 22:34:19 -0000 1.22 +++ OPENRAPI.cc 16 Jul 2007 13:05:48 -0000 1.23 @@ -154,7 +154,7 @@ OStatus OPENR::NewSoundVectorData(size_t numSounds, size_t dataSize, MemoryRegionID* memID, OSoundVectorData** baseAddr) { - const size_t size = sizeof(OSoundVectorData) + (sizeof(OSoundInfo) + sizeof(byte))*numSounds; + const size_t size = sizeof(OSoundVectorData) + (sizeof(OSoundInfo) + dataSize)*numSounds; OSoundVectorData *data = *baseAddr = (OSoundVectorData*)malloc(size); if (!data) { @@ -168,7 +168,7 @@ for (size_t i=0; i < numSounds; ++i) { OSoundInfo *info = data->GetInfo(i); - info->dataOffset = sizeof(ODataVectorInfo) + sizeof(OSoundInfo)*numSounds + sizeof(byte)*i; + info->dataOffset = sizeof(ODataVectorInfo) + sizeof(OSoundInfo)*numSounds + dataSize*i; } return oSUCCESS; @@ -397,7 +397,10 @@ return oFAIL; } - fstream DB("MS/OPEN-R/MW/CONF/DESIGNDB.CFG"); + char *path = resolve_case_insensitive_path("MS/OPEN-R/MW/CONF/DESIGNDB.CFG"); + fstream DB(path); + free(path); + if (!DB) { return oFAIL; } |