summaryrefslogtreecommitdiff
blob: 7f6b84216e5a2871ef87bcd20c9102acf88835ee (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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
diff -Naur yadex-1.7.0/GNUmakefile yadex-1.7.0.new/GNUmakefile
--- yadex-1.7.0/GNUmakefile	2006-03-16 20:33:36.000000000 -0800
+++ yadex-1.7.0.new/GNUmakefile	2006-03-16 18:37:50.000000000 -0800
@@ -53,6 +53,7 @@
 
 # Which OS ?
 OS := $(shell uname -s | tr A-Z a-z)
+ARCH := $(shell uname -i | tr A-Z a-z)
 
 # Where your X11 libraries and headers reside.
 # Current rule:
@@ -67,7 +68,11 @@
     X11LIBDIR     = /usr/openwin/lib
     X11INCLUDEDIR = /usr/openwin/include
   else
-    X11LIBDIR     = /usr/X11R6/lib
+    ifeq ($(findstring $(ARCH), x86_64), $(ARCH))
+        X11LIBDIR     = /usr/X11R6/lib64
+    else
+        X11LIBDIR     = /usr/X11R6/lib
+    endif
     X11INCLUDEDIR = /usr/X11R6/include
   endif
 endif
diff -Naur yadex-1.7.0/src/levels.cc yadex-1.7.0.new/src/levels.cc
--- yadex-1.7.0/src/levels.cc	2003-03-28 04:37:32.000000000 -0800
+++ yadex-1.7.0.new/src/levels.cc	2006-03-16 20:38:01.000000000 -0800
@@ -1387,7 +1387,7 @@
       }
    NumWTexture = (int) val + 1;
    /* read in the offsets for texture1 names */
-   offsets = (i32 *) GetMemory ((long) NumWTexture * 4);
+   offsets = (i32 *) GetMemory ((long) NumWTexture * (sizeof(i32)));
    wf->read_i32 (offsets + 1, NumWTexture - 1);
    if (wf->error ())
       {
@@ -1445,7 +1445,7 @@
       }
       NumWTexture = (int) val + 1;
       /* read in the offsets for texture1 names */
-      offsets = (i32 *) GetMemory ((long) NumWTexture * 4);
+      offsets = (i32 *) GetMemory ((long) NumWTexture * sizeof(i32));
       wf->read_i32 (offsets + 1, NumWTexture - 1);
       {
 	// FIXME
@@ -1489,7 +1489,7 @@
 	// FIXME
       }
       /* read in the offsets for texture2 names */
-      offsets = (i32 *) GetMemory ((long) val * 4);
+      offsets = (i32 *) GetMemory ((long) val * sizeof(i32));
       wf->read_i32 (offsets, val);
       if (wf->error ())
       {
diff -Naur yadex-1.7.0/src/pic2img.cc yadex-1.7.0.new/src/pic2img.cc
--- yadex-1.7.0/src/pic2img.cc	2003-03-28 04:37:32.000000000 -0800
+++ yadex-1.7.0.new/src/pic2img.cc	2006-03-16 20:30:40.000000000 -0800
@@ -192,7 +192,7 @@
 
 ColumnData    = (u8 *) GetMemory (TEX_COLUMNBUFFERSIZE);
 /* FIXME DOS and pic_width_ > 16000 */
-NeededOffsets = (i32 *) GetMemory ((long) pic_width_ * 4);
+NeededOffsets = (i32 *) GetMemory ((long) pic_width_ * (sizeof(i32)));
 
 if (long_offsets)
    dir->wadfile->read_i32 (NeededOffsets, pic_width_);
diff -Naur yadex-1.7.0/src/r_images.cc yadex-1.7.0.new/src/r_images.cc
--- yadex-1.7.0/src/r_images.cc	2006-03-16 20:33:12.000000000 -0800
+++ yadex-1.7.0.new/src/r_images.cc	2006-03-16 20:39:17.000000000 -0800
@@ -182,7 +182,7 @@
       dir->wadfile->seek (dir->dir.start);
       dir->wadfile->read_i32 (&numtex);
       /* read in the offsets for texture1 names and info. */
-      offsets = (i32 *) GetMemory ((long) numtex * 4);
+      offsets = (i32 *) GetMemory ((long) numtex * sizeof(i32));
       dir->wadfile->read_i32 (offsets, numtex);
       for (n = 0; n < numtex && !texofs; n++)
          {
@@ -205,7 +205,7 @@
       dir->wadfile->seek (dir->dir.start);
       dir->wadfile->read_i32 (&numtex);
       /* read in the offsets for texture1 names and info. */
-      offsets = (i32 *) GetMemory ((long) numtex * 4);
+      offsets = (i32 *) GetMemory ((long) numtex * sizeof(i32));
       dir->wadfile->read_i32 (offsets, numtex);
       for (n = 0; n < numtex && !texofs; n++)
          {
@@ -225,7 +225,7 @@
          dir->wadfile->seek (dir->dir.start);
          dir->wadfile->read_i32 (&numtex);
          /* read in the offsets for texture2 names */
-         offsets = (i32 *) GetMemory ((long) numtex * 4);
+         offsets = (i32 *) GetMemory ((long) numtex * sizeof(i32));
          dir->wadfile->read_i32 (offsets, numtex);
          for (n = 0; n < numtex && !texofs; n++)
             {
diff -Naur yadex-1.7.0/src/textures.cc yadex-1.7.0.new/src/textures.cc
--- yadex-1.7.0/src/textures.cc	2003-04-24 13:50:36.000000000 -0700
+++ yadex-1.7.0.new/src/textures.cc	2006-03-16 20:38:44.000000000 -0800
@@ -177,7 +177,7 @@
 	 goto textures_done;
 	 }
       // Read in the offsets for texture1 names and info
-      offsets = (i32 *) GetMemory ((long) numtex * 4);
+      offsets = (i32 *) GetMemory ((long) numtex * sizeof(i32));
       wf->read_i32 (offsets, numtex);
       if (wf->error ())
 	 {
@@ -233,7 +233,7 @@
 	 goto texture1_done;
 	 }
       // Read in the offsets for texture1 names and info
-      offsets = (i32 *) GetMemory ((long) numtex * 4);
+      offsets = (i32 *) GetMemory ((long) numtex * sizeof(i32));
       wf->read_i32 (offsets, numtex);
       if (wf->error ())
 	 {
@@ -286,7 +286,7 @@
 	    goto texture2_done;
 	    }
 	 // Read in the offsets for TEXTURE2 names
-	 offsets = (i32 *) GetMemory ((long) numtex * 4);
+	 offsets = (i32 *) GetMemory ((long) numtex * sizeof(i32));
 	 wf->read_i32 (offsets, numtex);
 	 if (wf->error ())
 	    {
@@ -514,7 +514,7 @@
       dir->wadfile->seek (dir->dir.start);
       dir->wadfile->read_i32 (&numtex);
       // Read in the offsets for texture1 names and info
-      offsets = (i32 *) GetMemory ((long) numtex * 4);
+      offsets = (i32 *) GetMemory ((long) numtex * sizeof(i32));
       dir->wadfile->read_i32 (offsets, numtex);
       for (n = 0; n < numtex && !texofs; n++)
 	 {
@@ -534,7 +534,7 @@
 	 dir->wadfile->seek (dir->dir.start);
 	 dir->wadfile->read_i32 (&numtex);
 	 // Read in the offsets for texture2 names
-	 offsets = (i32 *) GetMemory ((long) numtex * 4);
+	 offsets = (i32 *) GetMemory ((long) numtex * sizeof(i32));
 	 dir->wadfile->read_i32 (offsets);
 	 for (n = 0; n < numtex && !texofs; n++)
 	    {
diff -Naur yadex-1.7.0/src/yadex.h yadex-1.7.0.new/src/yadex.h
--- yadex-1.7.0/src/yadex.h	2006-03-16 20:33:12.000000000 -0800
+++ yadex-1.7.0.new/src/yadex.h	2006-03-16 20:29:15.000000000 -0800
@@ -98,11 +98,11 @@
 #define F_I16_D "hd"
 #define F_I16_H "hX"
 
-typedef unsigned long  u32;
+typedef unsigned int  u32;
 #define F_U32_D "lu"
 #define F_U32_H "lX"
 
-typedef signed   long  i32;
+typedef signed   int  i32;
 #define F_I32_D "ld"
 #define F_I32_H "lX"