/* -------------------------------------------------------------------------------
-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.
/* count brushes */
- for( brushes; brushes != NULL; brushes = brushes->next )
+ for( ; brushes != NULL; brushes = brushes->next )
c++;
return c;
}
brush_t *AllocBrush( int numSides )
{
brush_t *bb;
- int c;
+ size_t c;
/* allocate and clear */
if( numSides <= 0 )
Error( "AllocBrush called with numsides = %d", numSides );
- c = (int) &(((brush_t*) 0)->sides[ numSides ]);
+ c = (size_t)&(((brush_t*) 0)->sides[ numSides ]);
bb = safe_malloc( c );
memset( bb, 0, c );
if( numthreads == 1 )
/* error check */
- if( *((int*) b) == 0xFEFEFEFE )
+ if( *((unsigned int*) b) == 0xFEFEFEFE )
{
Sys_FPrintf( SYS_VRB, "WARNING: Attempt to free an already freed brush!\n" );
return;
FreeWinding( b->sides[ i ].winding );
/* ydnar: overwrite it */
- memset( b, 0xFE, (int) &(((brush_t*) 0)->sides[ b->numsides ]) );
- *((int*) b) = 0xFEFEFEFE;
+ memset( b, 0xFE, (size_t)&(((brush_t*) 0)->sides[ b->numsides ]) );
+ *((unsigned int*) b) = 0xFEFEFEFE;
/* free it */
free( b );
/* walk brush list */
- for( brushes; brushes != NULL; brushes = next )
+ for( ; brushes != NULL; brushes = next )
{
next = brushes->next;
FreeBrush( brushes );
brush_t *CopyBrush( brush_t *brush )
{
brush_t *newBrush;
- int size;
+ size_t size;
int i;
/* copy brush */
- size = (int) &(((brush_t*) 0)->sides[ brush->numsides ]);
+ size = (size_t)&(((brush_t*) 0)->sides[ brush->numsides ]);
newBrush = AllocBrush( brush->numsides );
memcpy( newBrush, brush, size );