mirror of
https://github.com/TTimo/GtkRadiant.git
synced 2025-01-10 03:51:18 +00:00
q3map2: fix some more warnings
imported from netradiant, initial commit message: > fix some more warnings
This commit is contained in:
parent
4d558e10c7
commit
5a40208a05
6 changed files with 15 additions and 7 deletions
|
@ -297,7 +297,7 @@ void Q_getwd( char *out ){
|
|||
strcat( out, "\\" );
|
||||
#else
|
||||
// Gef: Changed from getwd() to getcwd() to avoid potential buffer overflow
|
||||
getcwd( out, 256 );
|
||||
if( !getcwd ( out, 256 ) ) *out = 0;
|
||||
strcat( out, "/" );
|
||||
#endif
|
||||
while ( out[i] != 0 )
|
||||
|
|
|
@ -461,7 +461,7 @@ winding_t *BaseWindingForPlane( vec3_t normal, vec_t dist ){
|
|||
==================
|
||||
*/
|
||||
winding_t *CopyWinding( winding_t *w ){
|
||||
int size;
|
||||
size_t size;
|
||||
winding_t *c;
|
||||
|
||||
if ( !w ) {
|
||||
|
@ -469,7 +469,7 @@ winding_t *CopyWinding( winding_t *w ){
|
|||
}
|
||||
|
||||
c = AllocWinding( w->numpoints );
|
||||
size = sizeof( *w ) + sizeof( *w->p ) * w->numpoints;
|
||||
size = (size_t)sizeof( *w ) + sizeof( *w->p ) * w->numpoints;
|
||||
memcpy( c, w, size );
|
||||
return c;
|
||||
}
|
||||
|
|
|
@ -551,7 +551,7 @@ void RunThreadsOn( int workcnt, qboolean showpacifier, void ( *func )( int ) ){
|
|||
for ( i = 0 ; i < numthreads ; i++ )
|
||||
{
|
||||
/* Default pthread attributes: joinable & non-realtime scheduling */
|
||||
if ( pthread_create( &work_threads[i], NULL, (void*)func, (void*)i ) != 0 ) {
|
||||
if ( pthread_create( &work_threads[i], NULL, (void*)func, (void*)(size_t)i ) != 0 ) {
|
||||
Error( "pthread_create failed" );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -289,6 +289,7 @@ int vfsLoadFile( const char *filename, void **bufferptr, int index ){
|
|||
|
||||
f = fopen( filename, "rb" );
|
||||
if ( f == NULL ) {
|
||||
fclose(f);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -298,6 +299,7 @@ int vfsLoadFile( const char *filename, void **bufferptr, int index ){
|
|||
|
||||
*bufferptr = safe_malloc( len + 1 );
|
||||
if ( *bufferptr == NULL ) {
|
||||
fclose(f);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
|
@ -297,7 +297,7 @@ void ClearSurface( mapDrawSurface_t *ds ){
|
|||
|
||||
void TidyEntitySurfaces( entity_t *e ){
|
||||
int i, j, deleted;
|
||||
mapDrawSurface_t *out, *in;
|
||||
mapDrawSurface_t *out, *in = NULL;
|
||||
|
||||
|
||||
/* note it */
|
||||
|
|
|
@ -954,7 +954,10 @@ void LoadPortals( char *name ){
|
|||
for ( k = 0 ; k < 3 ; k++ )
|
||||
w->points[j][k] = v[k];
|
||||
}
|
||||
fscanf( f, "\n" );
|
||||
if ( fscanf( f, "\n" ) != 0)
|
||||
{
|
||||
// silence gcc warning
|
||||
}
|
||||
|
||||
// calc plane
|
||||
PlaneFromWinding( w, &plane );
|
||||
|
@ -1029,7 +1032,10 @@ void LoadPortals( char *name ){
|
|||
for ( k = 0 ; k < 3 ; k++ )
|
||||
w->points[j][k] = v[k];
|
||||
}
|
||||
fscanf( f, "\n" );
|
||||
if ( fscanf( f, "\n" ) != 0)
|
||||
{
|
||||
// silence gcc warning
|
||||
}
|
||||
|
||||
// calc plane
|
||||
PlaneFromWinding( w, &plane );
|
||||
|
|
Loading…
Reference in a new issue