/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
return;
}
- lightBytes = safe_malloc_info( numLightBytes, "SetLightBytes" );
-
- memset( lightBytes, 0, numLightBytes );
+ lightBytes = safe_malloc0_info( numLightBytes, "SetLightBytes" );
}
void SetGridPoints( int n ){
return;
}
- gridData = safe_malloc_info( numGridPoints * 8, "SetGridPoints" );
-
- memset( gridData, 0, numGridPoints * 8 );
+ gridData = safe_malloc0_info( numGridPoints * 8, "SetGridPoints" );
}
void IncDrawVerts(){
numDrawVerts = n;
numDrawVertsBuffer = numDrawVerts;
- drawVerts = safe_malloc_info( sizeof( drawVert_t ) * numDrawVertsBuffer, "IncDrawVerts" );
-
- memset( drawVerts, 0, n * sizeof( drawVert_t ) );
+ drawVerts = safe_malloc0_info( sizeof( drawVert_t ) * numDrawVertsBuffer, "IncDrawVerts" );
}
void SetDrawSurfacesBuffer(){
numDrawSurfacesBuffer = MAX_MAP_DRAW_SURFS;
- drawSurfaces = safe_malloc_info( sizeof( dsurface_t ) * numDrawSurfacesBuffer, "IncDrawSurfaces" );
-
- memset( drawSurfaces, 0, MAX_MAP_DRAW_SURFS * sizeof( drawVert_t ) );
+ drawSurfaces = safe_malloc0_info( sizeof( dsurface_t ) * numDrawSurfacesBuffer, "IncDrawSurfaces" );
}
void SetDrawSurfaces( int n ){
numDrawSurfaces = n;
numDrawSurfacesBuffer = numDrawSurfaces;
- drawSurfaces = safe_malloc_info( sizeof( dsurface_t ) * numDrawSurfacesBuffer, "IncDrawSurfaces" );
-
- memset( drawSurfaces, 0, n * sizeof( drawVert_t ) );
+ drawSurfaces = safe_malloc0_info( sizeof( dsurface_t ) * numDrawSurfacesBuffer, "IncDrawSurfaces" );
}
void BspFilesCleanup(){
=============
*/
int GetLumpElements( dheader_t *header, int lump, int size ) {
- int length, ofs;
-
- length = header->lumps[lump].filelen;
- ofs = header->lumps[lump].fileofs;
+ int length = header->lumps[lump].filelen;
if ( length % size ) {
Error( "LoadBSPFile: odd lump size" );
epair_t *ParseEpair( void ) {
epair_t *e;
- e = safe_malloc( sizeof( epair_t ) );
- memset( e, 0, sizeof( epair_t ) );
+ e = safe_malloc0( sizeof( epair_t ) );
if ( strlen( token ) >= MAX_KEY - 1 ) {
Error( "ParseEpar: token too long" );