summaryrefslogtreecommitdiff
path: root/games/xevil/patches/patch-ag
blob: 2d945275e30cc31c540d9787a0936ddfc35ed936 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
$NetBSD: patch-ag,v 1.3 2008/08/17 23:50:06 dholland Exp $

--- cmn/utils.cpp.orig	2007-11-07 14:55:38.000000000 +0100
+++ cmn/utils.cpp	2007-11-07 14:57:57.000000000 +0100
@@ -30,18 +30,20 @@
 
 // Include Files
 #include "stdafx.h"
-#include <iostream.h>
-#include <limits.h>
-#include <string.h>
-#include <ctype.h>
-#include <fstream.h>
+#include <iostream>
+#include <climits>
+#include <cstring>
+#include <cctype>
+#include <fstream>
 #if WIN32
 #include <strstrea.h>
 #endif
 #if X11
-#include <strstream.h>
+#include <strstream>
 #endif
 
+using namespace std;
+
 #ifdef WIN32
 // For file manipulation routines.
 #include <direct.h>
@@ -483,11 +483,7 @@
 #endif
 
 
-#ifdef UNAME_USR_BIN
-#define UNAME_PATH "/usr/bin/uname"
-#else
-#define UNAME_PATH "/bin/uname"
-#endif
+#define UNAME_PATH "@UNAME@"
 
 #ifdef X11
   FILE* fp = popen(UNAME_PATH " -a","r");
@@ -596,7 +598,7 @@
 }
 
 
-
+#if 0 /* unused and broken */
 void PtrList::write(OutStreamP out) const{
   // Not tested.
   out->write_int(len);
@@ -604,6 +606,7 @@
     out->write_int((int)data[n]);
   }
 }
+#endif
 
 
 
@@ -757,7 +759,7 @@ public:
 
 
 private:
-  Bucket* HashTable::_get(int &index,void* key);
+  Bucket* _get(int &index,void* key);
   /* MODIFIES: index */
   /* EFFECTS: Internal helper function.  Return the Bucket containing key
      or NULL if not found.  Set index to the bucket list for key whether
@@ -942,7 +942,7 @@
 // Pretty crappy hash function, I know.
 // Careful if bucketsNum is a power of 2.
 int HashTable::defaultHash(void* key,int bucketsNum) {
-  return ((unsigned int)key) % bucketsNum;
+  return ((unsigned long)key) % bucketsNum;
 }