]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
fix Black's mistake of using 'long' (32bit/64bit depending on architecture) type...
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 2 Jul 2005 03:06:23 +0000 (03:06 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 2 Jul 2005 03:06:23 +0000 (03:06 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@5480 d7cf8633-e32d-0410-b094-e92efae38249

prvm_edict.c

index e1143248971b26b71c897d8491945bb256290c3e..fd4440b8319cb14277c2e827b832dcea37deb71b 100644 (file)
@@ -1228,7 +1228,7 @@ PRVM_LoadLNO
 */
 void PRVM_LoadLNO( const char *progname ) {
        qbyte *lno;
-       unsigned long *header;
+       unsigned int *header;
        char filename[512];
 
        FS_StripExtension( progname, filename, sizeof( filename ) );
@@ -1248,20 +1248,20 @@ void PRVM_LoadLNO( const char *progname ) {
 <Spike>    SafeWrite (h, &numstatements, sizeof(int));
 <Spike>    SafeWrite (h, statement_linenums, numstatements*sizeof(int));
 */
-       if( (unsigned) fs_filesize < (6 + prog->progs->numstatements) * sizeof( long ) ) {
+       if( (unsigned) fs_filesize < (6 + prog->progs->numstatements) * sizeof( int ) ) {
         return;
        }
 
-       header = (unsigned long *) lno;
-       if( header[ 0 ] == *(unsigned long *) "LNOF" &&
+       header = (unsigned int *) lno;
+       if( header[ 0 ] == *(unsigned int *) "LNOF" &&
                LittleLong( header[ 1 ] ) == 1 &&
-               LittleLong( header[ 2 ] ) == prog->progs->numglobaldefs && 
-               LittleLong( header[ 3 ] ) == prog->progs->numglobals &&
-               LittleLong( header[ 4 ] ) == prog->progs->numfielddefs &&
-               LittleLong( header[ 5 ] ) == prog->progs->numstatements ) 
+               (unsigned int)LittleLong( header[ 2 ] ) == (unsigned int)prog->progs->numglobaldefs &&
+               (unsigned int)LittleLong( header[ 3 ] ) == (unsigned int)prog->progs->numglobals &&
+               (unsigned int)LittleLong( header[ 4 ] ) == (unsigned int)prog->progs->numfielddefs &&
+               (unsigned int)LittleLong( header[ 5 ] ) == (unsigned int)prog->progs->numstatements )
        {
-               prog->statement_linenums = Mem_Alloc(prog->progs_mempool, prog->progs->numstatements * sizeof( long ) );
-               memcpy( prog->statement_linenums, (long *) lno + 6, prog->progs->numstatements * sizeof( long ) ); 
+               prog->statement_linenums = Mem_Alloc(prog->progs_mempool, prog->progs->numstatements * sizeof( int ) );
+               memcpy( prog->statement_linenums, (int *) lno + 6, prog->progs->numstatements * sizeof( int ) );
        }
        Mem_Free( lno );
 }