shithub: choc

Download patch

ref: b30d12e14b364fb009869201788f2f21ae63bad6
parent: d29e73f05afa62a514e1156afa2fb40abae6346e
author: Simon Howard <[email protected]>
date: Thu Sep 22 09:13:47 EDT 2005

Remove external statistics driver support (-statcopy):
nonfunctional on modern systems and never used.
Fix for systems where sizeof(int) != sizeof(void *)

Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 120

--- a/src/d_main.c
+++ b/src/d_main.c
@@ -1,7 +1,7 @@
 // Emacs style mode select   -*- C++ -*- 
 //-----------------------------------------------------------------------------
 //
-// $Id: d_main.c 98 2005-09-11 20:25:56Z fraggle $
+// $Id: d_main.c 120 2005-09-22 13:13:47Z fraggle $
 //
 // Copyright(C) 1993-1996 Id Software, Inc.
 // Copyright(C) 2005 Simon Howard
@@ -22,6 +22,11 @@
 // 02111-1307, USA.
 //
 // $Log$
+// Revision 1.15  2005/09/22 13:13:47  fraggle
+// Remove external statistics driver support (-statcopy):
+// nonfunctional on modern systems and never used.
+// Fix for systems where sizeof(int) != sizeof(void *)
+//
 // Revision 1.14  2005/09/11 20:25:56  fraggle
 // Second configuration file to allow chocolate doom-specific settings.
 // Adjust some existing command line logic (for graphics settings and
@@ -82,7 +87,7 @@
 //-----------------------------------------------------------------------------
 
 
-static const char rcsid[] = "$Id: d_main.c 98 2005-09-11 20:25:56Z fraggle $";
+static const char rcsid[] = "$Id: d_main.c 120 2005-09-22 13:13:47Z fraggle $";
 
 #define	BGCOLOR		7
 #define	FGCOLOR		8
@@ -1156,17 +1161,6 @@
     printf ("ST_Init: Init status bar.\n");
     ST_Init ();
 
-    // check for a driver that wants intermission stats
-    p = M_CheckParm ("-statcopy");
-    if (p && p<myargc-1)
-    {
-	// for statistics driver
-	extern  void*	statcopy;                            
-
-	statcopy = (void*)atoi(myargv[p+1]);
-	printf ("External statistics registered.\n");
-    }
-    
     // start the apropriate game based on parms
     p = M_CheckParm ("-record");
 
--- a/src/d_net.c
+++ b/src/d_net.c
@@ -1,7 +1,7 @@
 // Emacs style mode select   -*- C++ -*- 
 //-----------------------------------------------------------------------------
 //
-// $Id: d_net.c 95 2005-09-08 22:10:40Z fraggle $
+// $Id: d_net.c 120 2005-09-22 13:13:47Z fraggle $
 //
 // Copyright(C) 1993-1996 Id Software, Inc.
 // Copyright(C) 2005 Simon Howard
@@ -22,6 +22,11 @@
 // 02111-1307, USA.
 //
 // $Log$
+// Revision 1.8  2005/09/22 13:13:47  fraggle
+// Remove external statistics driver support (-statcopy):
+// nonfunctional on modern systems and never used.
+// Fix for systems where sizeof(int) != sizeof(void *)
+//
 // Revision 1.7  2005/09/08 22:10:40  fraggle
 // Delay calls so we don't use the entire CPU
 //
@@ -53,7 +58,7 @@
 //-----------------------------------------------------------------------------
 
 
-static const char rcsid[] = "$Id: d_net.c 95 2005-09-08 22:10:40Z fraggle $";
+static const char rcsid[] = "$Id: d_net.c 120 2005-09-22 13:13:47Z fraggle $";
 
 
 #include "m_menu.h"
@@ -119,7 +124,9 @@
 //
 int NetbufferSize (void)
 {
-    return (int)&(((doomdata_t *)0)->cmds[netbuffer->numtics]); 
+    doomdata_t *dummy = NULL;
+
+    return ((byte *) &dummy->cmds[netbuffer->numtics]) - ((byte *) dummy);
 }
 
 //
--- a/src/g_game.c
+++ b/src/g_game.c
@@ -1,7 +1,7 @@
 // Emacs style mode select   -*- C++ -*- 
 //-----------------------------------------------------------------------------
 //
-// $Id: g_game.c 110 2005-09-17 20:25:56Z fraggle $
+// $Id: g_game.c 120 2005-09-22 13:13:47Z fraggle $
 //
 // Copyright(C) 1993-1996 Id Software, Inc.
 // Copyright(C) 2005 Simon Howard
@@ -22,6 +22,11 @@
 // 02111-1307, USA.
 //
 // $Log$
+// Revision 1.11  2005/09/22 13:13:47  fraggle
+// Remove external statistics driver support (-statcopy):
+// nonfunctional on modern systems and never used.
+// Fix for systems where sizeof(int) != sizeof(void *)
+//
 // Revision 1.10  2005/09/17 20:25:56  fraggle
 // Set the default values for variables in their initialisers.  Remove the
 // "defaultvalue" parameter and associated code from the configuration
@@ -66,7 +71,7 @@
 
 
 static const char
-rcsid[] = "$Id: g_game.c 110 2005-09-17 20:25:56Z fraggle $";
+rcsid[] = "$Id: g_game.c 120 2005-09-22 13:13:47Z fraggle $";
 
 #include <string.h>
 #include <stdlib.h>
@@ -263,10 +268,8 @@
 mobj_t*		bodyque[BODYQUESIZE]; 
 int		bodyqueslot; 
  
-void*		statcopy;				// for statistics driver
  
  
- 
 int G_CmdChecksum (ticcmd_t* cmd) 
 { 
     int		i;
@@ -1203,9 +1206,6 @@
     viewactive = false; 
     automapactive = false; 
  
-    if (statcopy)
-	memcpy (statcopy, &wminfo, sizeof(wminfo));
-	
     WI_Start (&wminfo); 
 } 
 
--- a/src/i_system.c
+++ b/src/i_system.c
@@ -1,7 +1,7 @@
 // Emacs style mode select   -*- C++ -*- 
 //-----------------------------------------------------------------------------
 //
-// $Id: i_system.c 95 2005-09-08 22:10:40Z fraggle $
+// $Id: i_system.c 120 2005-09-22 13:13:47Z fraggle $
 //
 // Copyright(C) 1993-1996 Id Software, Inc.
 // Copyright(C) 2005 Simon Howard
@@ -22,6 +22,11 @@
 // 02111-1307, USA.
 //
 // $Log$
+// Revision 1.10  2005/09/22 13:13:47  fraggle
+// Remove external statistics driver support (-statcopy):
+// nonfunctional on modern systems and never used.
+// Fix for systems where sizeof(int) != sizeof(void *)
+//
 // Revision 1.9  2005/09/08 22:10:40  fraggle
 // Delay calls so we don't use the entire CPU
 //
@@ -55,7 +60,7 @@
 //-----------------------------------------------------------------------------
 
 static const char
-rcsid[] = "$Id: i_system.c 95 2005-09-08 22:10:40Z fraggle $";
+rcsid[] = "$Id: i_system.c 120 2005-09-22 13:13:47Z fraggle $";
 
 
 #include <stdlib.h>
@@ -108,8 +113,8 @@
     byte *zonemem;
     *size = mb_used*1024*1024;
     zonemem = malloc (*size);
-    printf("zone memory: %x, %x allocated for zone\n", 
-	   (int) zonemem, *size);
+    printf("zone memory: %p, %x allocated for zone\n", 
+           zonemem, *size);
     return zonemem;
 }
 
--- a/src/r_data.c
+++ b/src/r_data.c
@@ -1,7 +1,7 @@
 // Emacs style mode select   -*- C++ -*- 
 //-----------------------------------------------------------------------------
 //
-// $Id: r_data.c 36 2005-08-04 18:40:22Z fraggle $
+// $Id: r_data.c 120 2005-09-22 13:13:47Z fraggle $
 //
 // Copyright(C) 1993-1996 Id Software, Inc.
 // Copyright(C) 2005 Simon Howard
@@ -22,6 +22,11 @@
 // 02111-1307, USA.
 //
 // $Log$
+// Revision 1.7  2005/09/22 13:13:47  fraggle
+// Remove external statistics driver support (-statcopy):
+// nonfunctional on modern systems and never used.
+// Fix for systems where sizeof(int) != sizeof(void *)
+//
 // Revision 1.6  2005/08/04 18:40:22  fraggle
 // Use zone memory functions instead of alloca/malloc/free
 //
@@ -50,7 +55,7 @@
 
 
 static const char
-rcsid[] = "$Id: r_data.c 36 2005-08-04 18:40:22Z fraggle $";
+rcsid[] = "$Id: r_data.c 120 2005-09-22 13:13:47Z fraggle $";
 
 #include "i_system.h"
 #include "z_zone.h"
@@ -662,10 +667,8 @@
     // Load in the light tables, 
     //  256 byte align tables.
     lump = W_GetNumForName("COLORMAP"); 
-    length = W_LumpLength (lump) + 255; 
-    colormaps = Z_Malloc (length, PU_STATIC, 0); 
-    colormaps = (byte *)( ((int)colormaps + 255)&~0xff); 
-    W_ReadLump (lump,colormaps); 
+    length = W_LumpLength (lump);
+    colormaps = W_CacheLumpNum(lump, PU_STATIC);
 }
 
 
--- a/src/r_draw.c
+++ b/src/r_draw.c
@@ -1,7 +1,7 @@
 // Emacs style mode select   -*- C++ -*- 
 //-----------------------------------------------------------------------------
 //
-// $Id: r_draw.c 45 2005-08-06 18:37:47Z fraggle $
+// $Id: r_draw.c 120 2005-09-22 13:13:47Z fraggle $
 //
 // Copyright(C) 1993-1996 Id Software, Inc.
 // Copyright(C) 2005 Simon Howard
@@ -22,6 +22,11 @@
 // 02111-1307, USA.
 //
 // $Log$
+// Revision 1.4  2005/09/22 13:13:47  fraggle
+// Remove external statistics driver support (-statcopy):
+// nonfunctional on modern systems and never used.
+// Fix for systems where sizeof(int) != sizeof(void *)
+//
 // Revision 1.3  2005/08/06 18:37:47  fraggle
 // Fix low resolution mode
 //
@@ -41,7 +46,7 @@
 
 
 static const char
-rcsid[] = "$Id: r_draw.c 45 2005-08-06 18:37:47Z fraggle $";
+rcsid[] = "$Id: r_draw.c 120 2005-09-22 13:13:47Z fraggle $";
 
 
 #include "doomdef.h"
@@ -550,8 +555,7 @@
 {
     int		i;
 	
-    translationtables = Z_Malloc (256*3+255, PU_STATIC, 0);
-    translationtables = (byte *)(( (int)translationtables + 255 )& ~255);
+    translationtables = Z_Malloc (256*3, PU_STATIC, 0);
     
     // translate just the 16 green colors
     for (i=0 ; i<256 ; i++)