Const correctness

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4401 4a71c877-e1ca-e34f-864e-861f7616d084
master
Giel van Schijndel 2008-03-28 22:21:37 +00:00
parent c3fcd4bf33
commit db7f049617
2 changed files with 6 additions and 3 deletions

View File

@ -334,6 +334,8 @@ static void FreeResourceFile(RESOURCEFILE *OldResource)
static inline RES_DATA* resDataInit(const char *DebugName, UDWORD DataIDHash, void *pData, UDWORD BlockID)
{
char* resID;
// Allocate memory to hold the RES_DATA structure plus the identifying string
RES_DATA* psRes = malloc(sizeof(RES_DATA) + strlen(DebugName) + 1);
if (!psRes)
@ -343,10 +345,11 @@ static inline RES_DATA* resDataInit(const char *DebugName, UDWORD DataIDHash, vo
}
// Initialize the pointer for our ID string
psRes->aID = (char*)(psRes + 1);
resID = (char*)(psRes + 1);
// Copy over the identifying string
strcpy((char*)psRes->aID, DebugName);
strcpy(resID, DebugName);
psRes->aID = resID;
psRes->pData = pData;
psRes->blockID = BlockID;

View File

@ -74,7 +74,7 @@ UDWORD oilResFeature;
struct featureTypeMap
{
char *typeStr;
const char *typeStr;
FEATURE_TYPE type;
};