Module Name:    src
Committed By:   snj
Date:           Wed Apr  1 21:41:49 UTC 2009

Modified Files:
        src/games/trek [netbsd-5]: help.c kill.c schedule.c setup.c trek.h

Log Message:
Pull up following revision(s) (requested by christos in ticket #637):
        games/trek/help.c: revision 1.9
        games/trek/kill.c: revision 1.8
        games/trek/schedule.c: revision 1.7
        games/trek/setup.c: revision 1.10
        games/trek/trek.h: revision 1.12
Avoid hardcoded "too large" constant that caused FPE on the vax.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.8.10.1 src/games/trek/help.c
cvs rdiff -u -r1.7 -r1.7.38.1 src/games/trek/kill.c
cvs rdiff -u -r1.6 -r1.6.26.1 src/games/trek/schedule.c
cvs rdiff -u -r1.8 -r1.8.38.1 src/games/trek/setup.c
cvs rdiff -u -r1.11 -r1.11.32.1 src/games/trek/trek.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/games/trek/help.c
diff -u src/games/trek/help.c:1.8 src/games/trek/help.c:1.8.10.1
--- src/games/trek/help.c:1.8	Sat Dec 15 19:44:44 2007
+++ src/games/trek/help.c	Wed Apr  1 21:41:49 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: help.c,v 1.8 2007/12/15 19:44:44 perry Exp $	*/
+/*	$NetBSD: help.c,v 1.8.10.1 2009/04/01 21:41:49 snj Exp $	*/
 
 /*
  * Copyright (c) 1980, 1993
@@ -34,13 +34,14 @@
 #if 0
 static char sccsid[] = "@(#)help.c	8.1 (Berkeley) 5/31/93";
 #else
-__RCSID("$NetBSD: help.c,v 1.8 2007/12/15 19:44:44 perry Exp $");
+__RCSID("$NetBSD: help.c,v 1.8.10.1 2009/04/01 21:41:49 snj Exp $");
 #endif
 #endif /* not lint */
 
 #include <stdio.h>
 #include <math.h>
 #include <unistd.h>
+#include <limits.h>
 #include "trek.h"
 
 /*
@@ -96,7 +97,7 @@
 	Game.helps += 1;
 
 	/* find the closest base */
-	dist = 1e50;
+	dist = TOOLARGE;
 	if (Quad[Ship.quadx][Ship.quady].bases <= 0)
 	{
 		/* there isn't one in this quadrant */

Index: src/games/trek/kill.c
diff -u src/games/trek/kill.c:1.7 src/games/trek/kill.c:1.7.38.1
--- src/games/trek/kill.c:1.7	Thu Aug  7 09:37:52 2003
+++ src/games/trek/kill.c	Wed Apr  1 21:41:49 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: kill.c,v 1.7 2003/08/07 09:37:52 agc Exp $	*/
+/*	$NetBSD: kill.c,v 1.7.38.1 2009/04/01 21:41:49 snj Exp $	*/
 
 /*
  * Copyright (c) 1980, 1993
@@ -34,11 +34,12 @@
 #if 0
 static char sccsid[] = "@(#)kill.c	8.1 (Berkeley) 5/31/93";
 #else
-__RCSID("$NetBSD: kill.c,v 1.7 2003/08/07 09:37:52 agc Exp $");
+__RCSID("$NetBSD: kill.c,v 1.7.38.1 2009/04/01 21:41:49 snj Exp $");
 #endif
 #endif /* not lint */
 
 #include <stdio.h>
+#include <limits.h>
 #include "trek.h"
 
 /*
@@ -138,7 +139,7 @@
 			printf("   quadrant %d,%d has been destroyed\n", qx, qy);
 		}
 		else
-			schedule(E_KATSB | E_GHOST, 1e50, qx, qy, 0);
+			schedule(E_KATSB | E_GHOST, TOOLARGE, qx, qy, 0);
 	}
 }
 

Index: src/games/trek/schedule.c
diff -u src/games/trek/schedule.c:1.6 src/games/trek/schedule.c:1.6.26.1
--- src/games/trek/schedule.c:1.6	Sun Mar 19 00:56:12 2006
+++ src/games/trek/schedule.c	Wed Apr  1 21:41:49 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: schedule.c,v 1.6 2006/03/19 00:56:12 christos Exp $	*/
+/*	$NetBSD: schedule.c,v 1.6.26.1 2009/04/01 21:41:49 snj Exp $	*/
 
 /*
  * Copyright (c) 1980, 1993
@@ -34,13 +34,14 @@
 #if 0
 static char sccsid[] = "@(#)schedule.c	8.1 (Berkeley) 5/31/93";
 #else
-__RCSID("$NetBSD: schedule.c,v 1.6 2006/03/19 00:56:12 christos Exp $");
+__RCSID("$NetBSD: schedule.c,v 1.6.26.1 2009/04/01 21:41:49 snj Exp $");
 #endif
 #endif /* not lint */
 
 #include <stdio.h>
 #include <math.h>
 #include <err.h>
+#include <limits.h>
 #include "trek.h"
 
 /*
@@ -135,7 +136,7 @@
 			e->evcode, e->date, e->x, e->y, e->systemname);
 #	endif
 	Now.eventptr[e->evcode & E_EVENT] = 0;
-	e->date = 1e50;
+	e->date = TOOLARGE;
 	e->evcode = 0;
 	return;
 }

Index: src/games/trek/setup.c
diff -u src/games/trek/setup.c:1.8 src/games/trek/setup.c:1.8.38.1
--- src/games/trek/setup.c:1.8	Thu Aug  7 09:37:54 2003
+++ src/games/trek/setup.c	Wed Apr  1 21:41:49 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: setup.c,v 1.8 2003/08/07 09:37:54 agc Exp $	*/
+/*	$NetBSD: setup.c,v 1.8.38.1 2009/04/01 21:41:49 snj Exp $	*/
 
 /*
  * Copyright (c) 1980, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)setup.c	8.1 (Berkeley) 5/31/93";
 #else
-__RCSID("$NetBSD: setup.c,v 1.8 2003/08/07 09:37:54 agc Exp $");
+__RCSID("$NetBSD: setup.c,v 1.8.38.1 2009/04/01 21:41:49 snj Exp $");
 #endif
 #endif /* not lint */
 
@@ -44,6 +44,7 @@
 #include <unistd.h>
 #include <stdlib.h>
 #include <err.h>
+#include <limits.h>
 #include "trek.h"
 #include "getpar.h"
 
@@ -211,7 +212,7 @@
 	for (i = 0; i < MAXEVENTS; i++)
 	{
 		e = &Event[i];
-		e->date = 1e50;
+		e->date = TOOLARGE;
 		e->evcode = 0;
 	}
 	xsched(E_SNOVA, 1, 0, 0, 0);

Index: src/games/trek/trek.h
diff -u src/games/trek/trek.h:1.11 src/games/trek/trek.h:1.11.32.1
--- src/games/trek/trek.h:1.11	Tue Feb 15 12:54:50 2005
+++ src/games/trek/trek.h	Wed Apr  1 21:41:49 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: trek.h,v 1.11 2005/02/15 12:54:50 jsm Exp $	*/
+/*	$NetBSD: trek.h,v 1.11.32.1 2009/04/01 21:41:49 snj Exp $	*/
 
 /*
  * Copyright (c) 1980, 1993
@@ -370,6 +370,8 @@
 # define	xTRACE		1
 extern int	Trace;
 
+# define 	TOOLARGE	(DBL_MAX / 2)	/* < DOUBLE_MAX for everyone */
+
 /* abandon.c */
 void abandon(int);
 

Reply via email to