From: ehofman Date: Tue, 5 Aug 2003 18:59:58 +0000 (+0000) Subject: Melchior FRANZ: Make the clouds3d code valgrind clean X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=5a13068aaa9576f7fa6c4598d288423532a1cc8c;p=simgear.git Melchior FRANZ: Make the clouds3d code valgrind clean --- diff --git a/simgear/scene/sky/clouds3d/SkyArchive.cpp b/simgear/scene/sky/clouds3d/SkyArchive.cpp index f6a1886d..3ff75095 100644 --- a/simgear/scene/sky/clouds3d/SkyArchive.cpp +++ b/simgear/scene/sky/clouds3d/SkyArchive.cpp @@ -39,9 +39,9 @@ inline double ulEndianLittleDouble(double x) { struct SkyArchiveEntry { SkyArchiveEntry() : type(0), pData(NULL), iDataSize(0) {} - unsigned char type; - void* pData; - unsigned int iDataSize; + unsigned char type; + unsigned char* pData; + unsigned int iDataSize; }; struct SkyArchiveFileEntry @@ -192,7 +192,7 @@ SKYRESULT SkyArchive::AddData(const char* pName, } else { - pNewEntry->pData = (void*)pData; + pNewEntry->pData = (unsigned char*)pData; } char* pInternalName = new char[::strlen(pName)+1]; @@ -1206,7 +1206,7 @@ SKYRESULT SkyArchive::_Load( FILE* pSrcFile) break; default: { - void* pData = new unsigned char[embeddedItem.iDataSize]; + unsigned char* pData = new unsigned char[embeddedItem.iDataSize]; iNumItemsRead = fread((void*)pData, embeddedItem.iDataSize, 1, pSrcFile); if (1 > iNumItemsRead) FAIL_RETURN_MSG(SKYRESULT_FAIL, "Error: SkyArchive::_Load(): failed to read item data.");