]> git.0x19.co - doomgeneric-snom360/commitdiff
Removed a lot of warnings - but broke Frosted version
authorMaxime Vincent <maxime.vince@gmail.com>
Tue, 17 May 2016 21:24:21 +0000 (23:24 +0200)
committerMaxime Vincent <maxime.vince@gmail.com>
Tue, 17 May 2016 21:24:21 +0000 (23:24 +0200)
17 files changed:
frosted-doom/Makefile
frosted-doom/am_map.c
frosted-doom/d_main.c
frosted-doom/g_game.c
frosted-doom/hu_lib.c
frosted-doom/i_net.c
frosted-doom/i_sound_dummy.c
frosted-doom/info.c
frosted-doom/info.h
frosted-doom/p_doors.c
frosted-doom/p_enemy.c
frosted-doom/p_spec.c
frosted-doom/r_data.c
frosted-doom/r_things.c
frosted-doom/stubs.c
frosted-doom/w_wad.c
frosted-doom/wi_stuff.c

index 690f54e192705a7d601fe5a5f4fed99fdf5c1ca4..ceafa88caac22fb1eb36fb7566f928085131d98e 100644 (file)
@@ -4,44 +4,54 @@
 #
 # $Log:$
 #
-CROSS_COMPILE = arm-frosted-eabi-
-CC=  $(CROSS_COMPILE)gcc  # gcc or g++
 
-ifeq ($V,'1')
-       V=''
+ifeq ($(V),1)
+       VB=''
 else
-       V=@
+       VB=@
 endif
 
-CFLAGS+=-mthumb -mlittle-endian -mthumb-interwork -ffunction-sections -fdata-sections -mcpu=cortex-m3
-CFLAGS+=-DCORE_M3 -D__frosted__
-# COMPILER FLAGS -- No gcc libraries
-CFLAGS+=-nostartfiles
-# COMPILER FLAGS -- GOT/PIC
-CFLAGS+=-fPIC -mlong-calls -fno-common -msingle-pic-base -mno-pic-data-is-text-relative -Wstack-usage=1024
+ifeq ($(ARM),1)
+       CROSS_COMPILE = arm-frosted-eabi-
+       OBJS+=$(O)/i_video_fbdev.o
+       CFLAGS+=-mthumb -mlittle-endian -mthumb-interwork -ffunction-sections -fdata-sections -mcpu=cortex-m3
+       CFLAGS+=-DCORE_M3 -D__frosted__
+       # COMPILER FLAGS -- No gcc libraries
+       CFLAGS+=-nostartfiles
+       # COMPILER FLAGS -- GOT/PIC
+       CFLAGS+=-fPIC -mlong-calls -fno-common -msingle-pic-base -mno-pic-data-is-text-relative -Wstack-usage=1024
+       # LINKER FLAGS
+       LDFLAGS+=-fPIC -mlong-calls -fno-common -Wl,-elf2flt -lgloss
+else
+       CFLAGS+=-m32 -fsanitize=address -Wunused-const-variable=0 
+       LIBS+=-lXext -lX11 -lnsl -lm -lSDL2
+       OBJS+=$(O)/i_video_SDL.o
+endif
+
+CC=  $(CROSS_COMPILE)gcc  # gcc or g++
+
+
 # Debugging
 CFLAGS+=-ggdb3
-
-# LINKER FLAGS
-LDFLAGS+=-fPIC -mlong-calls -fno-common -Wl,-elf2flt -lgloss -Wl,--gc-sections
+LDFLAGS+=-Wl,--gc-sections
 CFLAGS+=-ggdb3 -Wall -DNORMALUNIX -DLINUX -DSNDSERV # -DUSEASM
 CFLAGS+=-Icompat
+LIBS+=-lm -lc
+
 #LDFLAGS=-L/usr/X11R6/lib
 #LIBS=-lXext -lX11 -lnsl -lm
-LIBS=-lm -lc
 
 # subdirectory for objects
 O=frosted
 
 # not too sophisticated dependency
-OBJS                         \
+OBJS+=                         \
                $(O)/stubs.o            \
                $(O)/doomdef.o          \
                $(O)/doomstat.o         \
                $(O)/dstrings.o         \
                $(O)/i_system.o         \
                $(O)/i_sound_dummy.o          \
-               $(O)/i_video_fbdev.o          \
                $(O)/i_net.o                    \
                $(O)/tables.o                   \
                $(O)/f_finale.o         \
@@ -102,11 +112,12 @@ all:       $(O)/fdoom
 
 clean:
        rm -f *.o *~ *.flc
-       rm -f frosted/*
+       rm -f frosted/*.o
+       rm -f frosted/fdoom
 
 $(O)/fdoom:    $(OBJS) $(O)/i_main.o
        @echo [Linking $@]
-       $V$(CC) $(CFLAGS) $(LDFLAGS) $(OBJS) $(O)/i_main.o \
+       $(VB)$(CC) $(CFLAGS) $(LDFLAGS) $(OBJS) $(O)/i_main.o \
        -o $(O)/fdoom $(LIBS) -Wl,-Map,fdoom.map
 
 $(O):
@@ -114,7 +125,7 @@ $(O):
 
 $(O)/%.o:      %.c $(O)
        @echo [Compiling $<]
-       $V$(CC) $(CFLAGS) -c $< -o $@
+       $(VB)$(CC) $(CFLAGS) -c $< -o $@
 
 #############################################################
 #
index 999e4558d69706a1d2d42958d59c77fadd32e271..84c9cf7baecf0d58362329a18a4ed97d4d46f4e6 100644 (file)
@@ -616,7 +616,7 @@ AM_Responder
 {
 
     int rc;
-    static int cheatstate=0;
+    //static int cheatstate=0;
     static int bigstate=0;
     static char buffer[20];
 
@@ -695,7 +695,7 @@ AM_Responder
            plr->message = AMSTR_MARKSCLEARED;
            break;
          default:
-           cheatstate=0;
+           //cheatstate=0;
            rc = false;
        }
        if (!deathmatch && cht_CheckCheat(&cheat_amap, ev->data1))
@@ -783,7 +783,7 @@ void AM_doFollowPlayer(void)
 //
 void AM_updateLightLev(void)
 {
-    static nexttic = 0;
+    static int nexttic = 0;
     //static int litelevels[] = { 0, 3, 5, 6, 6, 7, 7, 7 };
     static int litelevels[] = { 0, 4, 7, 10, 12, 14, 15, 15 };
     static int litelevelscnt = 0;
@@ -856,9 +856,9 @@ AM_clipMline
        TOP     =8
     };
     
-    register   outcode1 = 0;
-    register   outcode2 = 0;
-    register   outside;
+    register int outcode1 = 0;
+    register int outcode2 = 0;
+    register int outside;
     
     fpoint_t   tmp;
     int                dx;
@@ -989,7 +989,7 @@ AM_drawFline
     register int ay;
     register int d;
     
-    static fuck = 0;
+    //static fuck = 0;
 
     // For debugging only
     if (      fl->a.x < 0 || fl->a.x >= f_w
@@ -997,7 +997,7 @@ AM_drawFline
           || fl->b.x < 0 || fl->b.x >= f_w
           || fl->b.y < 0 || fl->b.y >= f_h)
     {
-       fprintf(stderr, "fuck %d \r", fuck++);
+       //fprintf(stderr, "fuck %d \r", fuck++);
        return;
     }
 
index c8c7a2bf021003133305009a81a2c55281162cc6..4c69af5a0ba020ebc5537ab3cc4108435834bc4b 100644 (file)
@@ -150,7 +150,7 @@ int                 eventtail;
 void D_PostEvent (event_t* ev)
 {
     events[eventhead] = *ev;
-    eventhead = (++eventhead)&(MAXEVENTS-1);
+    eventhead = (eventhead + 1) % MAXEVENTS;
 }
 
 
@@ -576,9 +576,11 @@ void IdentifyVersion (void)
     char *home;
     char *doomwaddir;
     doomwaddir = getenv("DOOMWADDIR");
+#ifdef __linux__
+       doomwaddir = ".";
+#endif
     if (!doomwaddir)
-       doomwaddir = "/mnt";
-       //XXX doomwaddir = ".";
+        doomwaddir = "/mnt";
 
     // Commercial.
     doom2wad = malloc(strlen(doomwaddir)+1+9+1);
index 1da23538de1a715d0d7891bdb1717ee80f41f4b5..0b84cb76057a66eff3a90e42730bc3911e372f47 100644 (file)
@@ -760,10 +760,10 @@ void G_Ticker (void)
 //
 void G_InitPlayer (int player) 
 { 
-    player_t*  p; 
+    //player_t*        p; 
  
     // set up the saved info         
-    p = &players[player]; 
+    //p = &players[player]; 
         
     // clear everything else to defaults 
     G_PlayerReborn (player); 
@@ -1200,20 +1200,21 @@ void G_LoadGame (char* name)
 
 void G_DoLoadGame (void) 
 { 
-    int                length; 
+    //int              length; 
     int                i; 
     int                a,b,c; 
     char       vcheck[VERSIONSIZE]; 
         
     gameaction = ga_nothing; 
         
-    length = M_ReadFile (savename, &savebuffer); 
+    //length = M_ReadFile (savename, &savebuffer); 
+    M_ReadFile (savename, &savebuffer); 
     save_p = savebuffer + SAVESTRINGSIZE;
     
     // skip the description field 
     memset (vcheck,0,sizeof(vcheck)); 
     sprintf (vcheck,"version %i",VERSION); 
-    if (strcmp (save_p, vcheck)) 
+    if (strcmp ((const char*)save_p, vcheck)) 
        return;                         // bad version 
     save_p += VERSIONSIZE; 
                         
index 7ab5e3d3c9211c75ed24c4f2f7c063c72a1642db..57fb52e4fe54e97eea6605926b8dff3d193d9541 100644 (file)
@@ -145,7 +145,7 @@ void HUlib_eraseTextLine(hu_textline_t* l)
     int                        lh;
     int                        y;
     int                        yoffset;
-    static boolean     lastautomapactive = true;
+    //static boolean   lastautomapactive = true;
 
     // Only erases when NOT in automap and the screen is reduced,
     // and the text must either need updating or refreshing
@@ -168,7 +168,7 @@ void HUlib_eraseTextLine(hu_textline_t* l)
        }
     }
 
-    lastautomapactive = automapactive;
+    //lastautomapactive = automapactive;
     if (l->needsupdate) l->needsupdate--;
 
 }
index 9678931ab02bcdf1e32881d0cccd40ef8db9a5ff..71f54989277449f9f9111cf8e8290a0b4770656c 100644 (file)
@@ -49,23 +49,6 @@ rcsid[] = "$Id: m_bbox.c,v 1.1 1997/02/03 22:45:10 b1 Exp $";
 #include "i_net.h"
 
 
-
-
-
-// For some odd reason...
-#define ntohl(x) \
-        ((unsigned long int)((((unsigned long int)(x) & 0x000000ffU) << 24) | \
-                             (((unsigned long int)(x) & 0x0000ff00U) <<  8) | \
-                             (((unsigned long int)(x) & 0x00ff0000U) >>  8) | \
-                             (((unsigned long int)(x) & 0xff000000U) >> 24)))
-
-#define ntohs(x) \
-        ((unsigned short int)((((unsigned short int)(x) & 0x00ff) << 8) | \
-                              (((unsigned short int)(x) & 0xff00) >> 8))) \
-         
-#define htonl(x) ntohl(x)
-#define htons(x) ntohs(x)
-
 void   NetSend (void);
 boolean NetListen (void);
 
@@ -164,7 +147,7 @@ void PacketGet (void)
     int                        i;
     int                        c;
     struct sockaddr_in fromaddress;
-    int                        fromlen;
+    unsigned int       fromlen;
     doomdata_t         sw;
                                
     fromlen = sizeof(fromaddress);
@@ -244,7 +227,7 @@ int GetLocalAddress (void)
 //
 void I_InitNetwork (void)
 {
-    boolean            trueval = true;
+    //boolean          trueval = true;
     int                        i;
     int                        p;
     struct hostent*    hostentry;      // host information entry
index add55a8924e03690e1699e2ce45d61d11af19b19..97b6bf98bddd36f703cb384b0d897cecfef9ebf5 100644 (file)
@@ -906,9 +906,6 @@ int I_QrySongPlaying(int handle)
 //  time independend timer happens to get lost due to heavy load.
 // SIGALRM and ITIMER_REAL doesn't really work well.
 // There are issues with profiling as well.
-static int /*__itimer_which*/  itimer = ITIMER_REAL;
-
-static int sig = SIGALRM;
 
 // Interrupt handler.
 void I_HandleSoundTimer( int ignore )
@@ -937,39 +934,7 @@ void I_HandleSoundTimer( int ignore )
 // Get the interrupt. Set duration in millisecs.
 int I_SoundSetTimer( int duration_of_tick )
 {
-  // Needed for gametick clockwork.
-  struct itimerval    value;
-  struct itimerval    ovalue;
-  struct sigaction    act;
-  struct sigaction    oact;
-
-  int res;
-  
-  // This sets to SA_ONESHOT and SA_NOMASK, thus we can not use it.
-  //     signal( _sig, handle_SIG_TICK );
-  
-  // Now we have to change this attribute for repeated calls.
-  act.sa_handler = I_HandleSoundTimer;
-#ifndef sun    
-  //ac t.sa_mask = _sig;
-#endif
-  act.sa_flags = SA_RESTART;
-  
-  sigaction( sig, &act, &oact );
-
-  value.it_interval.tv_sec    = 0;
-  value.it_interval.tv_usec   = duration_of_tick;
-  value.it_value.tv_sec       = 0;
-  value.it_value.tv_usec      = duration_of_tick;
-
-  // Error is -1.
-  res = -1; //setitimer( itimer, &value, &ovalue );
-
-  // Debug.
-  if ( res == -1 )
-    fprintf( stderr, "I_SoundSetTimer: interrupt n.a.\n");
-  
-  return res;
+  return -1;
 }
 
 
index 230c72ba1330234e24ddf2d3237f9cb5c71abb0d..72a7362a85fa419a3e901d66e66885d1caef2571 100644 (file)
@@ -37,7 +37,7 @@ rcsid[] = "$Id: info.c,v 1.3 1997/01/26 07:45:00 b1 Exp $";
 
 #include "p_mobj.h"
 
-char *sprnames[NUMSPRITES] = {
+char *sprnames[] = {
     "TROO","SHTG","PUNG","PISG","PISF","SHTF","SHT2","CHGG","CHGF","MISG",
     "MISF","SAWG","PLSG","PLSF","BFGG","BFGF","BLUD","PUFF","BAL1","BAL2",
     "PLSS","PLSE","MISL","BFS1","BFE1","BFE2","TFOG","IFOG","PLAY","POSS",
@@ -51,7 +51,7 @@ char *sprnames[NUMSPRITES] = {
     "POL3","POL1","POL6","GOR2","GOR3","GOR4","GOR5","SMIT","COL1","COL2",
     "COL3","COL4","CAND","CBRA","COL6","TRE1","TRE2","ELEC","CEYE","FSKU",
     "COL5","TBLU","TGRN","TRED","SMBT","SMGT","SMRT","HDB1","HDB2","HDB3",
-    "HDB4","HDB5","HDB6","POB1","POB2","BRS1","TLMP","TLP2"
+    "HDB4","HDB5","HDB6","POB1","POB2","BRS1","TLMP","TLP2",NULL,"DUMM"
 };
 
 
index 786a7174ad617c1e463d59b418ab3b2934a65980..cc35e3340ba2dc8cd9d42e1b3798762574871459 100644 (file)
@@ -1156,7 +1156,7 @@ typedef struct
 } state_t;
 
 extern state_t states[NUMSTATES];
-extern char *sprnames[NUMSPRITES];
+extern char *sprnames[];
 
 
 
index b22dd150b32fa3780d5b2027288f3e0ede4f7228..2e0442eb4ef3fbd76b9c932bb65d41b9d1b14835 100644 (file)
@@ -356,7 +356,7 @@ EV_VerticalDoor
   mobj_t*      thing )
 {
     player_t*  player;
-    int                secnum;
+    //int              secnum;
     sector_t*  sec;
     vldoor_t*  door;
     int                side;
@@ -411,7 +411,7 @@ EV_VerticalDoor
        
     // if the sector has an active thinker, use it
     sec = sides[ line->sidenum[side^1]] .sector;
-    secnum = sec-sectors;
+    //secnum = sec-sectors;
 
     if (sec->specialdata)
     {
index 25b5b2d11efd34c8e06d1c02efcbcbe4ada1699a..6d0175ae93b8f3848c83bd826a83d045c470dd04 100644 (file)
@@ -503,11 +503,11 @@ P_LookForPlayers
     int                c;
     int                stop;
     player_t*  player;
-    sector_t*  sector;
+    //sector_t*        sector;
     angle_t    an;
     fixed_t    dist;
                
-    sector = actor->subsector->sector;
+    //sector = actor->subsector->sector;
        
     c = 0;
     stop = (actor->lastlook-1)&3;
index 78452c835698dabf6b380f24e36ab4ded47b5041..ba334607d37fb5aab8362a26cc3b54ee238e1dcc 100644 (file)
@@ -72,7 +72,7 @@ typedef struct
 //
 typedef struct
 {
-    boolean    istexture;      // if false, it is a flat
+    int            istexture;  // if false, it is a flat
     char       endname[9];
     char       startname[9];
     int                speed;
@@ -128,7 +128,7 @@ animdef_t           animdefs[] =
     {true,     "WFALL4",       "WFALL1",       8},
     {true,     "DBRAIN4",      "DBRAIN1",      8},
        
-    {false, "\0", "\0", 0}
+    {-1,    "",         "",         0}
 };
 
 anim_t         anims[MAXANIMS];
@@ -149,11 +149,9 @@ void P_InitPicAnims (void)
 {
     int                i;
 
-    
     // Init animation
     lastanim = anims;
-    //for (i=0 ; animdefs[i].istexture != -1 ; i++)
-    for (i=0 ; animdefs[i].startname[0] != NULL ; i++)
+    for (i=0 ; animdefs[i].istexture != -1 ; i++)
     {
        if (animdefs[i].istexture)
        {
@@ -1185,7 +1183,7 @@ int EV_DoDonut(line_t*    line)
        s2 = getNextSector(s1->lines[0],s1);
        for (i = 0;i < s2->linecount;i++)
        {
-           if ((!s2->lines[i]->flags & ML_TWOSIDED) ||
+           if ((!(s2->lines[i]->flags & ML_TWOSIDED)) ||
                (s2->lines[i]->backsector == s1))
                continue;
            s3 = s2->lines[i]->backsector;
@@ -1241,11 +1239,11 @@ void P_SpawnSpecials (void)
 {
     sector_t*  sector;
     int                i;
-    int                episode;
+    //int              episode;
 
-    episode = 1;
+    //episode = 1;
     if (W_CheckNumForName("texture2") >= 0)
-       episode = 2;
+       //episode = 2;
 
     
     // See if -TIMER needs to be used.
index 54e6ec5c3d93b4180f8eb1c7a6aaf4f3d76e46cf..cb29313925f16dfed2c969d69fcfc95f28831023 100644 (file)
@@ -44,6 +44,7 @@ rcsid[] = "$Id: r_data.c,v 1.4 1997/02/03 16:47:55 b1 Exp $";
 #ifdef LINUX
 #include  <alloca.h>
 #endif
+#include  <stdlib.h>
 
 
 #include "r_data.h"
@@ -191,9 +192,9 @@ R_DrawColumnInCache
     int                count;
     int                position;
     byte*      source;
-    byte*      dest;
-       
-    dest = (byte *)cache + 3;
+    //byte*    dest;
+       //
+    //dest = (byte *)cache + 3;
        
     while (patch->topdelta != 0xff)
     {
@@ -297,6 +298,7 @@ void R_GenerateLookup (int texnum)
 {
     texture_t*         texture;
     byte*              patchcount;     // patchcount[texture->width]
+    byte*              patchcount_alloc;
     texpatch_t*                patch;  
     patch_t*           realpatch;
     int                        x;
@@ -321,6 +323,7 @@ void R_GenerateLookup (int texnum)
     //  with only a single patch are all done.
     //XXX patchcount = (byte *)alloca (texture->width);
     patchcount = (byte *)malloc (texture->width);
+    patchcount_alloc = patchcount;
     if (!patchcount)
         return;
     memset (patchcount, 0, texture->width);
@@ -375,7 +378,7 @@ void R_GenerateLookup (int texnum)
        }
     }
 
-    free(patchcount);
+    free(patchcount_alloc);
 }
 
 
@@ -432,6 +435,7 @@ void R_InitTextures (void)
     char*              name_p;
     
     int*               patchlookup;
+    int*               patchlookup_alloc;
     
     int                        totalwidth;
     int                        nummappatches;
@@ -455,6 +459,7 @@ void R_InitTextures (void)
     name_p = names+4;
     //XXX patchlookup = alloca (nummappatches*sizeof(*patchlookup));
     patchlookup = malloc (nummappatches*sizeof(*patchlookup));
+    patchlookup_alloc = patchlookup;
     if (!patchlookup)
         return;
     
@@ -580,7 +585,7 @@ void R_InitTextures (void)
     for (i=0 ; i<numtextures ; i++)
        texturetranslation[i] = i;
 
-    free(patchlookup);
+    free(patchlookup_alloc);
 }
 
 
@@ -753,8 +758,11 @@ int                spritememory;
 void R_PrecacheLevel (void)
 {
     char*              flatpresent;
+    char*              flatpresent_alloc;
     char*              texturepresent;
+    char*              texturepresent_alloc;
     char*              spritepresent;
+    char*              spritepresent_alloc;
 
     int                        i;
     int                        j;
@@ -771,6 +779,7 @@ void R_PrecacheLevel (void)
     // Precache flats.
     //XXX flatpresent = alloca(numflats);
     flatpresent = malloc(numflats);
+    flatpresent_alloc = flatpresent;
     if (!flatpresent)
         return;
     memset (flatpresent,0,numflats);   
@@ -793,11 +802,12 @@ void R_PrecacheLevel (void)
        }
     }
 
-    free(flatpresent);
+    free(flatpresent_alloc);
     
     // Precache textures.
     //XXX texturepresent = alloca(numtextures);
     texturepresent = malloc(numtextures);
+    texturepresent_alloc = texturepresent;
     if (!texturepresent)
         return;
     memset (texturepresent,0, numtextures);
@@ -833,12 +843,13 @@ void R_PrecacheLevel (void)
        }
     }
 
-    free(texturepresent);
+    free(texturepresent_alloc);
     
     // Precache sprites.
     //XXX spritepresent = alloca(numsprites);
     spritepresent = malloc(numsprites);
-    if (!numsprites)
+    spritepresent_alloc = spritepresent;
+    if (!spritepresent)
         return;
     memset (spritepresent,0, numsprites);
        
@@ -866,7 +877,7 @@ void R_PrecacheLevel (void)
        }
     }
 
-    free(numsprites);
+    free(spritepresent_alloc);
 }
 
 
index b91016f8af3d14b1087810eb0a0d72ac0c9eb595..09c3653214052ea4c485d003e8d1031be0cf80ae 100644 (file)
@@ -189,7 +189,7 @@ void R_InitSpriteDefs (char** namelist)
     // count the number of sprite names
     check = namelist;
     while (*check != NULL)
-       check++;
+        check++;
 
     numsprites = check-namelist;
        
index fc4152c68b07ae32b434d3f13545d2651700c197..afaaecf84da1c57e70c9b4763f5c51c81f59631d 100644 (file)
@@ -2,6 +2,7 @@
 #include <sys/socket.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
+#include <string.h>
 
 //XXX FIXME
 in_addr_t inet_addr(const char *cp)
@@ -9,14 +10,3 @@ in_addr_t inet_addr(const char *cp)
     return (in_addr_t)NULL;
 }
 
-// XXX FIXME
-//int usleep(useconds_t us)
-//{
-//    return 0;
-//}
-//
-//
-//struct hostent *gethostbyname(const char *name)
-//{
-//    return NULL;
-//}
index 636e4fb5ed78cab83e9604780c0bead09f42cc1a..7bf69b7dac6c34c88f0b00d0cf92fb39165f83a2 100644 (file)
@@ -147,6 +147,7 @@ void W_AddFile (char *filename)
     int                        length;
     int                        startlump;
     filelump_t*                fileinfo;
+    filelump_t*                fileinfo_alloc;
     filelump_t         singleinfo;
     int                        storehandle;
     
@@ -198,6 +199,7 @@ void W_AddFile (char *filename)
        length = header.numlumps*sizeof(filelump_t);
        //XXX fileinfo = alloca (length);
        fileinfo = malloc (length);
+       fileinfo_alloc = fileinfo;
        lseek (handle, header.infotableofs, SEEK_SET);
        read (handle, fileinfo, length);
        numlumps += header.numlumps;
@@ -223,7 +225,7 @@ void W_AddFile (char *filename)
     }
 
     //XXX: Alloca replacement
-    free(fileinfo);
+    free(fileinfo_alloc);
        
     if (reloadname)
        close (handle);
@@ -246,6 +248,7 @@ void W_Reload (void)
     int                        handle;
     int                        length;
     filelump_t*                fileinfo;
+    filelump_t*                fileinfo_alloc;
        
     if (!reloadname)
        return;
@@ -259,6 +262,7 @@ void W_Reload (void)
     length = lumpcount*sizeof(filelump_t);
     //XXX fileinfo = alloca (length);
     fileinfo = malloc (length);
+    fileinfo_alloc = fileinfo;
     if (!fileinfo)
         return;
     lseek (handle, header.infotableofs, SEEK_SET);
@@ -278,7 +282,7 @@ void W_Reload (void)
        lump_p->size = LONG(fileinfo->size);
     }
 
-    free(fileinfo);
+    free(fileinfo_alloc);
     close (handle);
 }
 
@@ -492,16 +496,20 @@ W_CacheLumpNum
                
     if (!lumpcache[lump])
     {
-       // read the lump in
-       
-       //printf ("cache miss on lump %i\n",lump);
-       ptr = Z_Malloc (W_LumpLength (lump), tag, &lumpcache[lump]);
-       W_ReadLump (lump, lumpcache[lump]);
+         // read the lump in
+         //printf ("cache miss on lump %i\n",lump);
+         ptr = Z_Malloc (W_LumpLength (lump), tag, &lumpcache[lump]);
+      if (!ptr)
+        return NULL;
+         W_ReadLump (lump, lumpcache[lump]);
     }
     else
     {
-       //printf ("cache hit on lump %i\n",lump);
-       Z_ChangeTag (lumpcache[lump],tag);
+         //printf ("cache hit on lump %i\n",lump);
+         //Z_ChangeTag (lumpcache[lump],tag);
+        if (( (memblock_t *)( (byte *)(lumpcache[lump]) - sizeof(memblock_t)))->id!=0x1d4a11)
+            I_Error("Z_CT at "__FILE__":%i",__LINE__);
+        Z_ChangeTag2(lumpcache[lump],tag);
     }
        
     return lumpcache[lump];
index 01502c89f5015061df9edcf459b1aa6d6b857160..98be302a1c98c06fd711c6a9b0dd8b48bb5af9b5 100644 (file)
@@ -987,9 +987,9 @@ void WI_drawDeathmatchStats(void)
     int                y;
     int                w;
     
-    int                lh;     // line height
+    //int              lh;     // line height
 
-    lh = WI_SPACINGY;
+    //lh = WI_SPACINGY;
 
     WI_slamBackground();