foxygit / doom Log in
commit 14737bd64c6b7f0a02c4f26055d5f9a93c6cac53
Author:     Simon Howard <fraggle@gmail.com>
AuthorDate: Sat Jul 23 19:17:11 2005 +0000
Commit:     Simon Howard <fraggle@gmail.com>
CommitDate: Sat Jul 23 19:17:11 2005 +0000

    Use ANSI-standard limit constants. Remove LINUX define.

    Subversion-branch: /trunk/chocolate-doom
    Subversion-revision: 19
---
 src/Makefile.am |  2 +-
 src/am_map.c    | 21 ++++++++++++---------
 src/d_net.c     | 11 +++++++----
 src/doomtype.h  | 25 +++++--------------------
 src/i_sound.c   | 11 +++++------
 src/i_video.c   | 12 +++++-------
 src/m_bbox.c    | 11 +++++++----
 src/m_bbox.h    |  7 +++++--
 src/m_fixed.c   |  9 ++++++---
 src/m_misc.c    | 26 +++++---------------------
 src/p_floor.c   |  9 ++++++---
 src/p_local.h   | 13 ++++++++-----
 src/p_maputl.c  | 13 ++++++++-----
 src/p_setup.c   |  9 ++++++---
 src/p_spec.c    |  9 ++++++---
 src/r_data.c    | 17 +++++++++--------
 src/r_main.c    |  9 ++++++---
 src/r_segs.c    | 27 +++++++++++++++------------
 src/r_things.c  |  9 ++++++---
 src/tables.h    | 12 ++++--------
 20 files changed, 132 insertions(+), 130 deletions(-)

diff --git a/src/Makefile.am b/src/Makefile.am
index 8713afaa..593e9464 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,7 +1,7 @@

 bindir = $(prefix)/bin

-CFLAGS = @CFLAGS@ @X_CFLAGS@ -DNORMALUNIX -DLINUX
+CFLAGS = @CFLAGS@ @X_CFLAGS@ -DNORMALUNIX
 LDFLAGS = @LDFLAGS@ @X_LDFLAGS@ -lX11 -lXext

 chocolate_doom_SOURCES=\
diff --git a/src/am_map.c b/src/am_map.c
index 46f6ebad..c78015d7 100644
--- a/src/am_map.c
+++ b/src/am_map.c
@@ -1,7 +1,7 @@
 // Emacs style mode select   -*- C++ -*-
 //-----------------------------------------------------------------------------
 //
-// $Id: am_map.c 8 2005-07-23 16:44:57Z fraggle $
+// $Id: am_map.c 19 2005-07-23 19:17:11Z fraggle $
 //
 // Copyright(C) 1993-1996 Id Software, Inc.
 // Copyright(C) 2005 Simon Howard
@@ -23,6 +23,9 @@
 //
 //
 // $Log$
+// Revision 1.3  2005/07/23 19:17:11  fraggle
+// Use ANSI-standard limit constants.  Remove LINUX define.
+//
 // Revision 1.2  2005/07/23 16:44:55  fraggle
 // Update copyright to GNU GPL
 //
@@ -34,7 +37,7 @@
 //
 //-----------------------------------------------------------------------------

-static const char rcsid[] = "$Id: am_map.c 8 2005-07-23 16:44:57Z fraggle $";
+static const char rcsid[] = "$Id: am_map.c 19 2005-07-23 19:17:11Z fraggle $";

 #include <stdio.h>

@@ -327,9 +330,9 @@ AM_getIslope

     dy = ml->a.y - ml->b.y;
     dx = ml->b.x - ml->a.x;
-    if (!dy) is->islp = (dx<0?-MAXINT:MAXINT);
+    if (!dy) is->islp = (dx<0?-INT_MAX:INT_MAX);
     else is->islp = FixedDiv(dx, dy);
-    if (!dx) is->slp = (dy<0?-MAXINT:MAXINT);
+    if (!dx) is->slp = (dy<0?-INT_MAX:INT_MAX);
     else is->slp = FixedDiv(dy, dx);

 }
@@ -405,8 +408,8 @@ void AM_findMinMaxBoundaries(void)
     fixed_t a;
     fixed_t b;

-    min_x = min_y =  MAXINT;
-    max_x = max_y = -MAXINT;
+    min_x = min_y =  INT_MAX;
+    max_x = max_y = -INT_MAX;

     for (i=0;i<numvertexes;i++)
     {
@@ -444,7 +447,7 @@ void AM_changeWindowLoc(void)
     if (m_paninc.x || m_paninc.y)
     {
 	followplayer = 0;
-	f_oldloc.x = MAXINT;
+	f_oldloc.x = INT_MAX;
     }

     m_x += m_paninc.x;
@@ -476,7 +479,7 @@ void AM_initVariables(void)
     automapactive = true;
     fb = screens[0];

-    f_oldloc.x = MAXINT;
+    f_oldloc.x = INT_MAX;
     amclock = 0;
     lightlev = 0;

@@ -691,7 +694,7 @@ AM_Responder
 	    break;
 	  case AM_FOLLOWKEY:
 	    followplayer = !followplayer;
-	    f_oldloc.x = MAXINT;
+	    f_oldloc.x = INT_MAX;
 	    plr->message = followplayer ? AMSTR_FOLLOWON : AMSTR_FOLLOWOFF;
 	    break;
 	  case AM_GRIDKEY:
diff --git a/src/d_net.c b/src/d_net.c
index 51616abf..9c7eb3c3 100644
--- a/src/d_net.c
+++ b/src/d_net.c
@@ -1,7 +1,7 @@
 // Emacs style mode select   -*- C++ -*-
 //-----------------------------------------------------------------------------
 //
-// $Id: d_net.c 8 2005-07-23 16:44:57Z fraggle $
+// $Id: d_net.c 19 2005-07-23 19:17:11Z fraggle $
 //
 // Copyright(C) 1993-1996 Id Software, Inc.
 // Copyright(C) 2005 Simon Howard
@@ -22,6 +22,9 @@
 // 02111-1307, USA.
 //
 // $Log$
+// Revision 1.3  2005/07/23 19:17:11  fraggle
+// Use ANSI-standard limit constants.  Remove LINUX define.
+//
 // Revision 1.2  2005/07/23 16:44:55  fraggle
 // Update copyright to GNU GPL
 //
@@ -36,7 +39,7 @@
 //-----------------------------------------------------------------------------


-static const char rcsid[] = "$Id: d_net.c 8 2005-07-23 16:44:57Z fraggle $";
+static const char rcsid[] = "$Id: d_net.c 19 2005-07-23 19:17:11Z fraggle $";


 #include "m_menu.h"
@@ -665,7 +668,7 @@ void TryRunTics (void)
     // get available tics
     NetUpdate ();

-    lowtic = MAXINT;
+    lowtic = INT_MAX;
     numplaying = 0;
     for (i=0 ; i<doomcom->numnodes ; i++)
     {
@@ -728,7 +731,7 @@ void TryRunTics (void)
     while (lowtic < gametic/ticdup + counts)
     {
 	NetUpdate ();
-	lowtic = MAXINT;
+	lowtic = INT_MAX;

 	for (i=0 ; i<doomcom->numnodes ; i++)
 	    if (nodeingame[i] && nettics[i] < lowtic)
diff --git a/src/doomtype.h b/src/doomtype.h
index 4b7c7b8f..b5e2147c 100644
--- a/src/doomtype.h
+++ b/src/doomtype.h
@@ -1,7 +1,7 @@
 // Emacs style mode select   -*- C++ -*-
 //-----------------------------------------------------------------------------
 //
-// $Id: doomtype.h 8 2005-07-23 16:44:57Z fraggle $
+// $Id: doomtype.h 19 2005-07-23 19:17:11Z fraggle $
 //
 // Copyright(C) 1993-1996 Id Software, Inc.
 // Copyright(C) 2005 Simon Howard
@@ -44,31 +44,16 @@ typedef unsigned char byte;
 #endif


-// Predefined with some OS.
-#ifdef LINUX
-#include <values.h>
-#else
-#define MAXCHAR		((char)0x7f)
-#define MAXSHORT	((short)0x7fff)
-
-// Max pos 32-bit int.
-#define MAXINT		((int)0x7fffffff)
-#define MAXLONG		((long)0x7fffffff)
-#define MINCHAR		((char)0x80)
-#define MINSHORT	((short)0x8000)
-
-// Max negative 32-bit integer.
-#define MININT		((int)0x80000000)
-#define MINLONG		((long)0x80000000)
-#endif
-
-
+#include <limits.h>


 #endif
 //-----------------------------------------------------------------------------
 //
 // $Log$
+// Revision 1.3  2005/07/23 19:17:11  fraggle
+// Use ANSI-standard limit constants.  Remove LINUX define.
+//
 // Revision 1.2  2005/07/23 16:44:55  fraggle
 // Update copyright to GNU GPL
 //
diff --git a/src/i_sound.c b/src/i_sound.c
index b0feb982..5812941d 100644
--- a/src/i_sound.c
+++ b/src/i_sound.c
@@ -1,7 +1,7 @@
 // Emacs style mode select   -*- C++ -*-
 //-----------------------------------------------------------------------------
 //
-// $Id: i_sound.c 12 2005-07-23 17:21:35Z fraggle $
+// $Id: i_sound.c 19 2005-07-23 19:17:11Z fraggle $
 //
 // Copyright(C) 1993-1996 Id Software, Inc.
 // Copyright(C) 2005 Simon Howard
@@ -22,6 +22,9 @@
 // 02111-1307, USA.
 //
 // $Log$
+// Revision 1.4  2005/07/23 19:17:11  fraggle
+// Use ANSI-standard limit constants.  Remove LINUX define.
+//
 // Revision 1.3  2005/07/23 17:21:35  fraggle
 // Remove step table (unused, adds dependency on pow function)
 //
@@ -38,7 +41,7 @@
 //-----------------------------------------------------------------------------

 static const char
-rcsid[] = "$Id: i_sound.c 12 2005-07-23 17:21:35Z fraggle $";
+rcsid[] = "$Id: i_sound.c 19 2005-07-23 19:17:11Z fraggle $";

 #include <stdio.h>
 #include <stdlib.h>
@@ -49,10 +52,6 @@ rcsid[] = "$Id: i_sound.c 12 2005-07-23 17:21:35Z fraggle $";
 #include <sys/time.h>
 #include <sys/types.h>

-#ifndef LINUX
-#include <sys/filio.h>
-#endif
-
 #include <fcntl.h>
 #include <unistd.h>
 #include <sys/ioctl.h>
diff --git a/src/i_video.c b/src/i_video.c
index a4a9c617..b718e4d8 100644
--- a/src/i_video.c
+++ b/src/i_video.c
@@ -1,7 +1,7 @@
 // Emacs style mode select   -*- C++ -*-
 //-----------------------------------------------------------------------------
 //
-// $Id: i_video.c 13 2005-07-23 17:27:04Z fraggle $
+// $Id: i_video.c 19 2005-07-23 19:17:11Z fraggle $
 //
 // Copyright(C) 1993-1996 Id Software, Inc.
 // Copyright(C) 2005 Simon Howard
@@ -22,6 +22,9 @@
 // 02111-1307, USA.
 //
 // $Log$
+// Revision 1.4  2005/07/23 19:17:11  fraggle
+// Use ANSI-standard limit constants.  Remove LINUX define.
+//
 // Revision 1.3  2005/07/23 17:27:04  fraggle
 // Stop crash on shutdown
 //
@@ -38,7 +41,7 @@
 //-----------------------------------------------------------------------------

 static const char
-rcsid[] = "$Id: i_video.c 13 2005-07-23 17:27:04Z fraggle $";
+rcsid[] = "$Id: i_video.c 19 2005-07-23 19:17:11Z fraggle $";

 #include <stdlib.h>
 #include <unistd.h>
@@ -50,11 +53,6 @@ rcsid[] = "$Id: i_video.c 13 2005-07-23 17:27:04Z fraggle $";
 #include <X11/keysym.h>

 #include <X11/extensions/XShm.h>
-// Had to dig up XShm.c for this one.
-// It is in the libXext, but not in the XFree86 headers.
-#ifdef LINUX
-int XShmGetEventBase( Display* dpy ); // problems with g++?
-#endif

 #include <stdarg.h>
 #include <sys/time.h>
diff --git a/src/m_bbox.c b/src/m_bbox.c
index b7753e71..9e929bad 100644
--- a/src/m_bbox.c
+++ b/src/m_bbox.c
@@ -1,7 +1,7 @@
 // Emacs style mode select   -*- C++ -*-
 //-----------------------------------------------------------------------------
 //
-// $Id: m_bbox.c 18 2005-07-23 18:56:07Z fraggle $
+// $Id: m_bbox.c 19 2005-07-23 19:17:11Z fraggle $
 //
 // Copyright(C) 1993-1996 Id Software, Inc.
 // Copyright(C) 2005 Simon Howard
@@ -22,6 +22,9 @@
 // 02111-1307, USA.
 //
 // $Log$
+// Revision 1.4  2005/07/23 19:17:11  fraggle
+// Use ANSI-standard limit constants.  Remove LINUX define.
+//
 // Revision 1.3  2005/07/23 18:56:07  fraggle
 // Remove unneccessary pragmas
 //
@@ -41,7 +44,7 @@
 //-----------------------------------------------------------------------------

 static const char
-rcsid[] = "$Id: m_bbox.c 18 2005-07-23 18:56:07Z fraggle $";
+rcsid[] = "$Id: m_bbox.c 19 2005-07-23 19:17:11Z fraggle $";


 #include "m_bbox.h"
@@ -51,8 +54,8 @@ rcsid[] = "$Id: m_bbox.c 18 2005-07-23 18:56:07Z fraggle $";

 void M_ClearBox (fixed_t *box)
 {
-    box[BOXTOP] = box[BOXRIGHT] = MININT;
-    box[BOXBOTTOM] = box[BOXLEFT] = MAXINT;
+    box[BOXTOP] = box[BOXRIGHT] = INT_MIN;
+    box[BOXBOTTOM] = box[BOXLEFT] = INT_MAX;
 }

 void
diff --git a/src/m_bbox.h b/src/m_bbox.h
index 47619857..18e58953 100644
--- a/src/m_bbox.h
+++ b/src/m_bbox.h
@@ -1,7 +1,7 @@
 // Emacs style mode select   -*- C++ -*-
 //-----------------------------------------------------------------------------
 //
-// $Id: m_bbox.h 8 2005-07-23 16:44:57Z fraggle $
+// $Id: m_bbox.h 19 2005-07-23 19:17:11Z fraggle $
 //
 // Copyright(C) 1993-1996 Id Software, Inc.
 // Copyright(C) 2005 Simon Howard
@@ -30,7 +30,7 @@
 #ifndef __M_BBOX__
 #define __M_BBOX__

-#include <values.h>
+#include <limits.h>

 #include "m_fixed.h"

@@ -58,6 +58,9 @@ M_AddToBox
 //-----------------------------------------------------------------------------
 //
 // $Log$
+// Revision 1.3  2005/07/23 19:17:11  fraggle
+// Use ANSI-standard limit constants.  Remove LINUX define.
+//
 // Revision 1.2  2005/07/23 16:44:55  fraggle
 // Update copyright to GNU GPL
 //
diff --git a/src/m_fixed.c b/src/m_fixed.c
index 10bb0d28..8c72ac9b 100644
--- a/src/m_fixed.c
+++ b/src/m_fixed.c
@@ -1,7 +1,7 @@
 // Emacs style mode select   -*- C++ -*-
 //-----------------------------------------------------------------------------
 //
-// $Id: m_fixed.c 18 2005-07-23 18:56:07Z fraggle $
+// $Id: m_fixed.c 19 2005-07-23 19:17:11Z fraggle $
 //
 // Copyright(C) 1993-1996 Id Software, Inc.
 // Copyright(C) 2005 Simon Howard
@@ -22,6 +22,9 @@
 // 02111-1307, USA.
 //
 // $Log$
+// Revision 1.4  2005/07/23 19:17:11  fraggle
+// Use ANSI-standard limit constants.  Remove LINUX define.
+//
 // Revision 1.3  2005/07/23 18:56:07  fraggle
 // Remove unneccessary pragmas
 //
@@ -39,7 +42,7 @@


 static const char
-rcsid[] = "$Id: m_fixed.c 18 2005-07-23 18:56:07Z fraggle $";
+rcsid[] = "$Id: m_fixed.c 19 2005-07-23 19:17:11Z fraggle $";

 #include "stdlib.h"

@@ -73,7 +76,7 @@ FixedDiv
   fixed_t	b )
 {
     if ( (abs(a)>>14) >= abs(b))
-	return (a^b)<0 ? MININT : MAXINT;
+	return (a^b)<0 ? INT_MIN : INT_MAX;
     return FixedDiv2 (a,b);
 }

diff --git a/src/m_misc.c b/src/m_misc.c
index 511086e7..36bb461c 100644
--- a/src/m_misc.c
+++ b/src/m_misc.c
@@ -1,7 +1,7 @@
 // Emacs style mode select   -*- C++ -*-
 //-----------------------------------------------------------------------------
 //
-// $Id: m_misc.c 8 2005-07-23 16:44:57Z fraggle $
+// $Id: m_misc.c 19 2005-07-23 19:17:11Z fraggle $
 //
 // Copyright(C) 1993-1996 Id Software, Inc.
 // Copyright(C) 2005 Simon Howard
@@ -23,6 +23,9 @@
 //
 //
 // $Log$
+// Revision 1.3  2005/07/23 19:17:11  fraggle
+// Use ANSI-standard limit constants.  Remove LINUX define.
+//
 // Revision 1.2  2005/07/23 16:44:55  fraggle
 // Update copyright to GNU GPL
 //
@@ -38,7 +41,7 @@
 //-----------------------------------------------------------------------------

 static const char
-rcsid[] = "$Id: m_misc.c 8 2005-07-23 16:44:57Z fraggle $";
+rcsid[] = "$Id: m_misc.c 19 2005-07-23 19:17:11Z fraggle $";

 #include <sys/stat.h>
 #include <sys/types.h>
@@ -226,11 +229,6 @@ extern char*	sndserver_filename;
 extern int	mb_used;
 #endif

-#ifdef LINUX
-char*		mousetype;
-char*		mousedev;
-#endif
-
 extern char*	chat_macros[];


@@ -252,7 +250,6 @@ default_t	defaults[] =
     {"show_messages",&showMessages, 1},


-#ifdef NORMALUNIX
     {"key_right",&key_right, KEY_RIGHTARROW},
     {"key_left",&key_left, KEY_LEFTARROW},
     {"key_up",&key_up, KEY_UPARROW},
@@ -265,19 +262,6 @@ default_t	defaults[] =
     {"key_strafe",&key_strafe, KEY_RALT},
     {"key_speed",&key_speed, KEY_RSHIFT},

-// UNIX hack, to be removed.
-#ifdef SNDSERV
-    {"sndserver", (int *) &sndserver_filename, (int) "sndserver"},
-    {"mb_used", &mb_used, 2},
-#endif
-
-#endif
-
-#ifdef LINUX
-    {"mousedev", (int*)&mousedev, (int)"/dev/ttyS0"},
-    {"mousetype", (int*)&mousetype, (int)"microsoft"},
-#endif
-
     {"use_mouse",&usemouse, 1},
     {"mouseb_fire",&mousebfire,0},
     {"mouseb_strafe",&mousebstrafe,1},
diff --git a/src/p_floor.c b/src/p_floor.c
index 378f983c..ca877a7a 100644
--- a/src/p_floor.c
+++ b/src/p_floor.c
@@ -1,7 +1,7 @@
 // Emacs style mode select   -*- C++ -*-
 //-----------------------------------------------------------------------------
 //
-// $Id: p_floor.c 8 2005-07-23 16:44:57Z fraggle $
+// $Id: p_floor.c 19 2005-07-23 19:17:11Z fraggle $
 //
 // Copyright(C) 1993-1996 Id Software, Inc.
 // Copyright(C) 2005 Simon Howard
@@ -22,6 +22,9 @@
 // 02111-1307, USA.
 //
 // $Log$
+// Revision 1.3  2005/07/23 19:17:11  fraggle
+// Use ANSI-standard limit constants.  Remove LINUX define.
+//
 // Revision 1.2  2005/07/23 16:44:56  fraggle
 // Update copyright to GNU GPL
 //
@@ -35,7 +38,7 @@
 //-----------------------------------------------------------------------------

 static const char
-rcsid[] = "$Id: p_floor.c 8 2005-07-23 16:44:57Z fraggle $";
+rcsid[] = "$Id: p_floor.c 19 2005-07-23 19:17:11Z fraggle $";


 #include "z_zone.h"
@@ -384,7 +387,7 @@ EV_DoFloor

 	  case raiseToTexture:
 	  {
-	      int	minsize = MAXINT;
+	      int	minsize = INT_MAX;
 	      side_t*	side;

 	      floor->direction = 1;
diff --git a/src/p_local.h b/src/p_local.h
index 9e741e20..62e8a579 100644
--- a/src/p_local.h
+++ b/src/p_local.h
@@ -1,7 +1,7 @@
 // Emacs style mode select   -*- C++ -*-
 //-----------------------------------------------------------------------------
 //
-// $Id: p_local.h 8 2005-07-23 16:44:57Z fraggle $
+// $Id: p_local.h 19 2005-07-23 19:17:11Z fraggle $
 //
 // Copyright(C) 1993-1996 Id Software, Inc.
 // Copyright(C) 2005 Simon Howard
@@ -99,8 +99,8 @@ void	P_PlayerThink (player_t* player);
 //
 // P_MOBJ
 //
-#define ONFLOORZ		MININT
-#define ONCEILINGZ		MAXINT
+#define ONFLOORZ		INT_MIN
+#define ONCEILINGZ		INT_MAX

 // Time interval for item respawning.
 #define ITEMQUESIZE		128
@@ -158,9 +158,9 @@ typedef struct
     }			d;
 } intercept_t;

-#define MAXINTERCEPTS	128
+#define INT_MAXERCEPTS	128

-extern intercept_t	intercepts[MAXINTERCEPTS];
+extern intercept_t	intercepts[INT_MAXERCEPTS];
 extern intercept_t*	intercept_p;

 typedef boolean (*traverser_t) (intercept_t *in);
@@ -290,6 +290,9 @@ P_DamageMobj
 //-----------------------------------------------------------------------------
 //
 // $Log$
+// Revision 1.3  2005/07/23 19:17:11  fraggle
+// Use ANSI-standard limit constants.  Remove LINUX define.
+//
 // Revision 1.2  2005/07/23 16:44:56  fraggle
 // Update copyright to GNU GPL
 //
diff --git a/src/p_maputl.c b/src/p_maputl.c
index c3ea8ded..1566263a 100644
--- a/src/p_maputl.c
+++ b/src/p_maputl.c
@@ -1,7 +1,7 @@
 // Emacs style mode select   -*- C++ -*-
 //-----------------------------------------------------------------------------
 //
-// $Id: p_maputl.c 8 2005-07-23 16:44:57Z fraggle $
+// $Id: p_maputl.c 19 2005-07-23 19:17:11Z fraggle $
 //
 // Copyright(C) 1993-1996 Id Software, Inc.
 // Copyright(C) 2005 Simon Howard
@@ -22,6 +22,9 @@
 // 02111-1307, USA.
 //
 // $Log$
+// Revision 1.3  2005/07/23 19:17:11  fraggle
+// Use ANSI-standard limit constants.  Remove LINUX define.
+//
 // Revision 1.2  2005/07/23 16:44:56  fraggle
 // Update copyright to GNU GPL
 //
@@ -38,7 +41,7 @@
 //-----------------------------------------------------------------------------

 static const char
-rcsid[] = "$Id: p_maputl.c 8 2005-07-23 16:44:57Z fraggle $";
+rcsid[] = "$Id: p_maputl.c 19 2005-07-23 19:17:11Z fraggle $";


 #include <stdlib.h>
@@ -554,7 +557,7 @@ P_BlockThingsIterator
 //
 // INTERCEPT ROUTINES
 //
-intercept_t	intercepts[MAXINTERCEPTS];
+intercept_t	intercepts[INT_MAXERCEPTS];
 intercept_t*	intercept_p;

 divline_t 	trace;
@@ -708,7 +711,7 @@ P_TraverseIntercepts

     while (count--)
     {
-	dist = MAXINT;
+	dist = INT_MAX;
 	for (scan = intercepts ; scan<intercept_p ; scan++)
 	{
 	    if (scan->frac < dist)
@@ -736,7 +739,7 @@ P_TraverseIntercepts
         if ( !func (in) )
 	    return false;	// don't bother going farther

-	in->frac = MAXINT;
+	in->frac = INT_MAX;
     }

     return true;		// everything was traversed
diff --git a/src/p_setup.c b/src/p_setup.c
index 6d81088c..8a00a9c1 100644
--- a/src/p_setup.c
+++ b/src/p_setup.c
@@ -1,7 +1,7 @@
 // Emacs style mode select   -*- C++ -*-
 //-----------------------------------------------------------------------------
 //
-// $Id: p_setup.c 8 2005-07-23 16:44:57Z fraggle $
+// $Id: p_setup.c 19 2005-07-23 19:17:11Z fraggle $
 //
 // Copyright(C) 1993-1996 Id Software, Inc.
 // Copyright(C) 2005 Simon Howard
@@ -22,6 +22,9 @@
 // 02111-1307, USA.
 //
 // $Log$
+// Revision 1.3  2005/07/23 19:17:11  fraggle
+// Use ANSI-standard limit constants.  Remove LINUX define.
+//
 // Revision 1.2  2005/07/23 16:44:56  fraggle
 // Update copyright to GNU GPL
 //
@@ -36,7 +39,7 @@
 //-----------------------------------------------------------------------------

 static const char
-rcsid[] = "$Id: p_setup.c 8 2005-07-23 16:44:57Z fraggle $";
+rcsid[] = "$Id: p_setup.c 19 2005-07-23 19:17:11Z fraggle $";


 #include <math.h>
@@ -623,7 +626,7 @@ P_SetupLevel
 #if 0 // UNUSED
     if (debugfile)
     {
-	Z_FreeTags (PU_LEVEL, MAXINT);
+	Z_FreeTags (PU_LEVEL, INT_MAX);
 	Z_FileDumpHeap (debugfile);
     }
     else
diff --git a/src/p_spec.c b/src/p_spec.c
index 23ef232f..6041559c 100644
--- a/src/p_spec.c
+++ b/src/p_spec.c
@@ -1,7 +1,7 @@
 // Emacs style mode select   -*- C++ -*-
 //-----------------------------------------------------------------------------
 //
-// $Id: p_spec.c 8 2005-07-23 16:44:57Z fraggle $
+// $Id: p_spec.c 19 2005-07-23 19:17:11Z fraggle $
 //
 // Copyright(C) 1993-1996 Id Software, Inc.
 // Copyright(C) 2005 Simon Howard
@@ -22,6 +22,9 @@
 // 02111-1307, USA.
 //
 // $Log$
+// Revision 1.3  2005/07/23 19:17:11  fraggle
+// Use ANSI-standard limit constants.  Remove LINUX define.
+//
 // Revision 1.2  2005/07/23 16:44:56  fraggle
 // Update copyright to GNU GPL
 //
@@ -39,7 +42,7 @@
 //-----------------------------------------------------------------------------

 static const char
-rcsid[] = "$Id: p_spec.c 8 2005-07-23 16:44:57Z fraggle $";
+rcsid[] = "$Id: p_spec.c 19 2005-07-23 19:17:11Z fraggle $";

 #include <stdlib.h>

@@ -397,7 +400,7 @@ P_FindLowestCeilingSurrounding(sector_t* sec)
     int			i;
     line_t*		check;
     sector_t*		other;
-    fixed_t		height = MAXINT;
+    fixed_t		height = INT_MAX;

     for (i=0 ;i < sec->linecount ; i++)
     {
diff --git a/src/r_data.c b/src/r_data.c
index aa890888..ff8e2b4b 100644
--- a/src/r_data.c
+++ b/src/r_data.c
@@ -1,7 +1,7 @@
 // Emacs style mode select   -*- C++ -*-
 //-----------------------------------------------------------------------------
 //
-// $Id: r_data.c 8 2005-07-23 16:44:57Z fraggle $
+// $Id: r_data.c 19 2005-07-23 19:17:11Z fraggle $
 //
 // Copyright(C) 1993-1996 Id Software, Inc.
 // Copyright(C) 2005 Simon Howard
@@ -22,6 +22,9 @@
 // 02111-1307, USA.
 //
 // $Log$
+// Revision 1.3  2005/07/23 19:17:11  fraggle
+// Use ANSI-standard limit constants.  Remove LINUX define.
+//
 // Revision 1.2  2005/07/23 16:44:56  fraggle
 // Update copyright to GNU GPL
 //
@@ -38,7 +41,7 @@


 static const char
-rcsid[] = "$Id: r_data.c 8 2005-07-23 16:44:57Z fraggle $";
+rcsid[] = "$Id: r_data.c 19 2005-07-23 19:17:11Z fraggle $";

 #include "i_system.h"
 #include "z_zone.h"
@@ -54,10 +57,6 @@ rcsid[] = "$Id: r_data.c 8 2005-07-23 16:44:57Z fraggle $";
 #include "doomstat.h"
 #include "r_sky.h"

-#ifdef LINUX
-#include  <alloca.h>
-#endif
-

 #include "r_data.h"

@@ -332,7 +331,7 @@ void R_GenerateLookup (int texnum)
     //  that are covered by more than one patch.
     // Fill in the lump / offset, so columns
     //  with only a single patch are all done.
-    patchcount = (byte *)alloca (texture->width);
+    patchcount = (byte *) malloc(texture->width);
     memset (patchcount, 0, texture->width);
     patch = texture->patches;

@@ -383,7 +382,9 @@ void R_GenerateLookup (int texnum)

 	    texturecompositesize[texnum] += texture->height;
 	}
-    }
+    }
+
+    free(patchcount);
 }


diff --git a/src/r_main.c b/src/r_main.c
index 0919f8f3..22691bb5 100644
--- a/src/r_main.c
+++ b/src/r_main.c
@@ -1,7 +1,7 @@
 // Emacs style mode select   -*- C++ -*-
 //-----------------------------------------------------------------------------
 //
-// $Id: r_main.c 8 2005-07-23 16:44:57Z fraggle $
+// $Id: r_main.c 19 2005-07-23 19:17:11Z fraggle $
 //
 // Copyright(C) 1993-1996 Id Software, Inc.
 // Copyright(C) 2005 Simon Howard
@@ -22,6 +22,9 @@
 // 02111-1307, USA.
 //
 // $Log$
+// Revision 1.3  2005/07/23 19:17:11  fraggle
+// Use ANSI-standard limit constants.  Remove LINUX define.
+//
 // Revision 1.2  2005/07/23 16:44:56  fraggle
 // Update copyright to GNU GPL
 //
@@ -37,7 +40,7 @@
 //-----------------------------------------------------------------------------


-static const char rcsid[] = "$Id: r_main.c 8 2005-07-23 16:44:57Z fraggle $";
+static const char rcsid[] = "$Id: r_main.c 19 2005-07-23 19:17:11Z fraggle $";



@@ -119,7 +122,7 @@ angle_t			xtoviewangle[SCREENWIDTH+1];
 // UNUSED.
 // The finetangentgent[angle+FINEANGLES/4] table
 // holds the fixed_t tangent values for view angles,
-// ranging from MININT to 0 to MAXINT.
+// ranging from INT_MIN to 0 to INT_MAX.
 // fixed_t		finetangent[FINEANGLES/2];

 // fixed_t		finesine[5*FINEANGLES/4];
diff --git a/src/r_segs.c b/src/r_segs.c
index 92caf583..37acec22 100644
--- a/src/r_segs.c
+++ b/src/r_segs.c
@@ -1,7 +1,7 @@
 // Emacs style mode select   -*- C++ -*-
 //-----------------------------------------------------------------------------
 //
-// $Id: r_segs.c 8 2005-07-23 16:44:57Z fraggle $
+// $Id: r_segs.c 19 2005-07-23 19:17:11Z fraggle $
 //
 // Copyright(C) 1993-1996 Id Software, Inc.
 // Copyright(C) 2005 Simon Howard
@@ -22,6 +22,9 @@
 // 02111-1307, USA.
 //
 // $Log$
+// Revision 1.3  2005/07/23 19:17:11  fraggle
+// Use ANSI-standard limit constants.  Remove LINUX define.
+//
 // Revision 1.2  2005/07/23 16:44:56  fraggle
 // Update copyright to GNU GPL
 //
@@ -36,7 +39,7 @@


 static const char
-rcsid[] = "$Id: r_segs.c 8 2005-07-23 16:44:57Z fraggle $";
+rcsid[] = "$Id: r_segs.c 19 2005-07-23 19:17:11Z fraggle $";



@@ -175,7 +178,7 @@ R_RenderMaskedSegRange
     for (dc_x = x1 ; dc_x <= x2 ; dc_x++)
     {
 	// calculate lighting
-	if (maskedtexturecol[dc_x] != MAXSHORT)
+	if (maskedtexturecol[dc_x] != SHRT_MAX)
 	{
 	    if (!fixedcolormap)
 	    {
@@ -195,7 +198,7 @@ R_RenderMaskedSegRange
 		(byte *)R_GetColumn(texnum,maskedtexturecol[dc_x]) -3);

 	    R_DrawMaskedColumn (col);
-	    maskedtexturecol[dc_x] = MAXSHORT;
+	    maskedtexturecol[dc_x] = SHRT_MAX;
 	}
 	spryscale += rw_scalestep;
     }
@@ -489,8 +492,8 @@ R_StoreWallRange
 	ds_p->silhouette = SIL_BOTH;
 	ds_p->sprtopclip = screenheightarray;
 	ds_p->sprbottomclip = negonearray;
-	ds_p->bsilheight = MAXINT;
-	ds_p->tsilheight = MININT;
+	ds_p->bsilheight = INT_MAX;
+	ds_p->tsilheight = INT_MIN;
     }
     else
     {
@@ -506,7 +509,7 @@ R_StoreWallRange
 	else if (backsector->floorheight > viewz)
 	{
 	    ds_p->silhouette = SIL_BOTTOM;
-	    ds_p->bsilheight = MAXINT;
+	    ds_p->bsilheight = INT_MAX;
 	    // ds_p->sprbottomclip = negonearray;
 	}

@@ -518,21 +521,21 @@ R_StoreWallRange
 	else if (backsector->ceilingheight < viewz)
 	{
 	    ds_p->silhouette |= SIL_TOP;
-	    ds_p->tsilheight = MININT;
+	    ds_p->tsilheight = INT_MIN;
 	    // ds_p->sprtopclip = screenheightarray;
 	}

 	if (backsector->ceilingheight <= frontsector->floorheight)
 	{
 	    ds_p->sprbottomclip = negonearray;
-	    ds_p->bsilheight = MAXINT;
+	    ds_p->bsilheight = INT_MAX;
 	    ds_p->silhouette |= SIL_BOTTOM;
 	}

 	if (backsector->floorheight >= frontsector->ceilingheight)
 	{
 	    ds_p->sprtopclip = screenheightarray;
-	    ds_p->tsilheight = MININT;
+	    ds_p->tsilheight = INT_MIN;
 	    ds_p->silhouette |= SIL_TOP;
 	}

@@ -747,12 +750,12 @@ R_StoreWallRange
     if (maskedtexture && !(ds_p->silhouette&SIL_TOP))
     {
 	ds_p->silhouette |= SIL_TOP;
-	ds_p->tsilheight = MININT;
+	ds_p->tsilheight = INT_MIN;
     }
     if (maskedtexture && !(ds_p->silhouette&SIL_BOTTOM))
     {
 	ds_p->silhouette |= SIL_BOTTOM;
-	ds_p->bsilheight = MAXINT;
+	ds_p->bsilheight = INT_MAX;
     }
     ds_p++;
 }
diff --git a/src/r_things.c b/src/r_things.c
index b46b0eb4..aab5ad9e 100644
--- a/src/r_things.c
+++ b/src/r_things.c
@@ -1,7 +1,7 @@
 // Emacs style mode select   -*- C++ -*-
 //-----------------------------------------------------------------------------
 //
-// $Id: r_things.c 8 2005-07-23 16:44:57Z fraggle $
+// $Id: r_things.c 19 2005-07-23 19:17:11Z fraggle $
 //
 // Copyright(C) 1993-1996 Id Software, Inc.
 // Copyright(C) 2005 Simon Howard
@@ -22,6 +22,9 @@
 // 02111-1307, USA.
 //
 // $Log$
+// Revision 1.3  2005/07/23 19:17:11  fraggle
+// Use ANSI-standard limit constants.  Remove LINUX define.
+//
 // Revision 1.2  2005/07/23 16:44:57  fraggle
 // Update copyright to GNU GPL
 //
@@ -36,7 +39,7 @@


 static const char
-rcsid[] = "$Id: r_things.c 8 2005-07-23 16:44:57Z fraggle $";
+rcsid[] = "$Id: r_things.c 19 2005-07-23 19:17:11Z fraggle $";


 #include <stdio.h>
@@ -829,7 +832,7 @@ void R_SortVisSprites (void)
     vsprsortedhead.next = vsprsortedhead.prev = &vsprsortedhead;
     for (i=0 ; i<count ; i++)
     {
-	bestscale = MAXINT;
+	bestscale = INT_MAX;
 	for (ds=unsorted.next ; ds!= &unsorted ; ds=ds->next)
 	{
 	    if (ds->scale < bestscale)
diff --git a/src/tables.h b/src/tables.h
index 0f56f605..23a9e087 100644
--- a/src/tables.h
+++ b/src/tables.h
@@ -1,7 +1,7 @@
 // Emacs style mode select   -*- C++ -*-
 //-----------------------------------------------------------------------------
 //
-// $Id: tables.h 8 2005-07-23 16:44:57Z fraggle $
+// $Id: tables.h 19 2005-07-23 19:17:11Z fraggle $
 //
 // Copyright(C) 1993-1996 Id Software, Inc.
 // Copyright(C) 2005 Simon Howard
@@ -45,13 +45,6 @@



-#ifdef LINUX
-#include <math.h>
-#else
-#define PI				3.141592657
-#endif
-
-
 #include "m_fixed.h"

 #define FINEANGLES		8192
@@ -103,6 +96,9 @@ SlopeDiv
 //-----------------------------------------------------------------------------
 //
 // $Log$
+// Revision 1.3  2005/07/23 19:17:11  fraggle
+// Use ANSI-standard limit constants.  Remove LINUX define.
+//
 // Revision 1.2  2005/07/23 16:44:57  fraggle
 // Update copyright to GNU GPL
 //