some fixes to issues pointed by @tkoeppe
authorThomas Debesse <dev@illwieckz.net>
Sun, 28 Jan 2018 00:34:30 +0000 (01:34 +0100)
committerThomas Debesse <dev@illwieckz.net>
Sun, 28 Jan 2018 02:17:29 +0000 (03:17 +0100)
tools/quake3/common/threads.c
tools/quake3/common/vfs.c

index 4f8951f..054dc74 100644 (file)
@@ -577,7 +577,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], &attr, (void *(*)(void *)) func, (void*)(size_t)i ) != 0 ) {
+                       if ( pthread_create(&work_threads[i], &attr, (void *(*)(void *)) func, (void*)(uintptr_t)i ) != 0 ) {
                                Error( "pthread_create failed" );
                        }
                }
index 4e38c94..16a7828 100644 (file)
@@ -316,7 +316,6 @@ int vfsLoadFile( const char *filename, void **bufferptr, int index ){
 
                f = fopen( filename, "rb" );
                if ( f == NULL ) {
-                       fclose( f );
                        return -1;
                }