Skip to content

Commit

Permalink
Make this compile when using gcc 3. Patches provided by
Browse files Browse the repository at this point in the history
Chris Tribo in PR pkg/24886.
  • Loading branch information
kristerw committed Mar 26, 2004
1 parent 74d8d71 commit dc88829
Show file tree
Hide file tree
Showing 6 changed files with 135 additions and 13 deletions.
9 changes: 6 additions & 3 deletions games/xevil/distinfo
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
$NetBSD: distinfo,v 1.2 2001/04/21 02:08:39 wiz Exp $
$NetBSD: distinfo,v 1.3 2004/03/26 01:34:08 kristerw Exp $

SHA1 (xevil1.5.1e.tar.Z) = a4b1fc0264ddd9c73e60d28442f5328c1a1bc060
Size (xevil1.5.1e.tar.Z) = 475173 bytes
SHA1 (patch-aa) = 310dbab8e8921d4cef9e336052e8bbd0a32f704a
SHA1 (patch-ab) = 1a733a118dee1aebc56b441df929315df328de20
SHA1 (patch-ac) = 3562033cb5827af191e8c6fa2d42b380610651b6
SHA1 (patch-ab) = e366f13447a1756c3328afaa56ae8ae383a904e7
SHA1 (patch-ac) = 3287d782b176e4500f4499da8f0487a4ebefe560
SHA1 (patch-ad) = 1c227ab65c6318a170020fb9f3aa4e8e50119532
SHA1 (patch-ae) = 561ecff4dbdba9fa579558ea29eb2e3e58c2f2f1
SHA1 (patch-af) = fc095d1b89d340a1325e5142d48dae5041925754
30 changes: 26 additions & 4 deletions games/xevil/patches/patch-ab
Original file line number Diff line number Diff line change
@@ -1,9 +1,31 @@
$NetBSD: patch-ab,v 1.2 1998/08/07 10:40:44 agc Exp $
$NetBSD: patch-ab,v 1.3 2004/03/26 01:34:08 kristerw Exp $

--- actual.C.orig Thu Jul 30 05:18:48 1998
+++ actual.C Thu Jul 30 05:19:19 1998
@@ -687,3 +687,3 @@
--- actual.C.orig Tue Sep 24 00:18:08 1996
+++ actual.C Fri Mar 26 02:17:46 2004
@@ -23,6 +23,7 @@
hardts@alum.mit.edu
http://graphics.lcs.mit.edu/~hardts/xevil.html
*/
+using namespace std;

#ifndef NO_PRAGMAS
#pragma implementation "actual.h"
@@ -30,7 +31,8 @@


// Include Files
-#include <strstream.h>
+#include <strstream>
+using std::ostrstream;

#include "utils.h"
#include "coord.h"
@@ -685,7 +687,7 @@
// More general and easy to extend.
PhysicalP Transmogifier::new_physical(const Pos &middle)
{
- PhysicalContext *list[A_CLASSES_NUM];
+ const PhysicalContext *list[A_CLASSES_NUM];
int size;
LocatorP l = get_locator();
WorldP w = get_world();
37 changes: 31 additions & 6 deletions games/xevil/patches/patch-ac
Original file line number Diff line number Diff line change
@@ -1,19 +1,44 @@
$NetBSD: patch-ac,v 1.2 1998/08/07 10:40:44 agc Exp $
$NetBSD: patch-ac,v 1.3 2004/03/26 01:34:08 kristerw Exp $

--- game.C.orig Thu Jul 30 05:20:22 1998
+++ game.C Thu Jul 30 05:21:16 1998
@@ -388,3 +388,3 @@
--- game.C.orig Tue Sep 24 02:27:18 1996
+++ game.C Fri Mar 26 02:19:24 2004
@@ -22,6 +22,7 @@
hardts@alum.mit.edu
http://graphics.lcs.mit.edu/~hardts/xevil.html
*/
+using namespace std;

#ifndef NO_PRAGMAS
#pragma implementation "game.h"
@@ -34,7 +35,7 @@
#include <stdio.h>
}

-#include <strstream.h>
+#include <strstream>
#include <iomanip.h>

#include "utils.h"
@@ -386,11 +387,11 @@

// Get arrays of potential weapons and potential otherItems.
int weaponsNum;
- PhysicalContext *weapons[A_CLASSES_NUM];
+ const PhysicalContext *weapons[A_CLASSES_NUM];
weaponsNum = locator->filter_contexts(weapons,NULL,
@@ -392,3 +392,3 @@
potential_weapon_filter);
int oItemsNum;
- PhysicalContext *oItems[A_CLASSES_NUM];
+ const PhysicalContext *oItems[A_CLASSES_NUM];
oItemsNum = locator->filter_contexts(oItems,NULL,
@@ -1383,3 +1383,3 @@
potential_other_item_filter);

@@ -1381,7 +1382,7 @@
// Choose class randomly.

// Get list of all classes that are potential Human classes.
- PhysicalContext *list[A_CLASSES_NUM];
+ const PhysicalContext *list[A_CLASSES_NUM];
int size = locator.filter_contexts(list,NULL,potential_human_filter);
assert(size);
theContext = list[Utils::choose(size)];
21 changes: 21 additions & 0 deletions games/xevil/patches/patch-ad
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
$NetBSD: patch-ad,v 1.1 2004/03/26 01:34:08 kristerw Exp $

--- locator.C.orig Fri Mar 26 02:20:24 2004
+++ locator.C Fri Mar 26 02:21:09 2004
@@ -22,6 +22,7 @@
hardts@alum.mit.edu
http://graphics.lcs.mit.edu/~hardts/xevil.html
*/
+using namespace std;

#ifndef NO_PRAGMAS
#pragma implementation "locator.h"
@@ -210,7 +211,7 @@
void Locator::get_nearby(PhysicalP nearby[OL_NEARBY_MAX],int &nitems,
PhysicalP p,int radius)
{
- int glocRadius = (int)ceil(radius / OL_GRID_SIZE_MAX);
+ int glocRadius = (int)ceil((float)(radius / OL_GRID_SIZE_MAX));
int radius_2 = radius * radius;
nitems = 0;

29 changes: 29 additions & 0 deletions games/xevil/patches/patch-ae
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
$NetBSD: patch-ae,v 1.1 2004/03/26 01:34:08 kristerw Exp $

--- physical.C.orig Fri Mar 26 02:15:18 2004
+++ physical.C Fri Mar 26 02:16:06 2004
@@ -22,6 +22,7 @@
hardts@alum.mit.edu
http://graphics.lcs.mit.edu/~hardts/xevil.html
*/
+using namespace std;

#ifndef NO_PRAGMAS
#pragma implementation "physical.h"
@@ -29,13 +30,14 @@


// Include Files
-#include <iostream.h>
+#include <iostream>

extern "C" {
#include <string.h>
}

-#include <strstream.h>
+#include <strstream>
+using std::ostrstream;

#include "utils.h"
#include "coord.h"
22 changes: 22 additions & 0 deletions games/xevil/patches/patch-af
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
$NetBSD: patch-af,v 1.1 2004/03/26 01:34:08 kristerw Exp $

--- ui.C.orig Fri Mar 26 02:21:44 2004
+++ ui.C Fri Mar 26 02:22:21 2004
@@ -23,6 +23,7 @@
hardts@alum.mit.edu
http://graphics.lcs.mit.edu/~hardts/xevil.html
*/
+using namespace std;

#ifndef NO_PRAGMAS
#pragma implementation "ui.h"
@@ -42,7 +43,8 @@
}

#include <iostream.h>
-#include <strstream.h>
+#include <strstream>
+using std::ostrstream;

#include "coord.h"
#include "ui.h"

0 comments on commit dc88829

Please sign in to comment.