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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
|
--- common/threads.cpp.orig 2016-04-01 13:18:21 UTC
+++ common/threads.cpp
@@ -180,7 +180,7 @@ q_threadfunction workfunction;
#pragma warning(push)
#pragma warning(disable: 4100) // unreferenced formal parameter
#endif
-static void ThreadWorkerFunction(int unused)
+static void ThreadWorkerFunction(intptr_t unused)
{
int work;
@@ -499,7 +499,7 @@ q_threadfunction q_entry;
static void* CDECL ThreadEntryStub(void* pParam)
{
- q_entry((int)pParam);
+ q_entry((intptr_t)pParam);
return NULL;
}
--- common/threads.h.orig 2016-04-01 13:18:21 UTC
+++ common/threads.h
@@ -15,7 +15,7 @@ typedef enum
}
q_threadpriority;
-typedef void (*q_threadfunction) (int);
+typedef void (*q_threadfunction) (intptr_t);
#ifdef SYSTEM_WIN32
#define DEFAULT_NUMTHREADS -1
--- hlbsp/qbsp.cpp.orig 2016-04-01 13:18:21 UTC
+++ hlbsp/qbsp.cpp
@@ -833,7 +833,7 @@ static surfchain_t* ReadSurfs(FILE* file
// ProcessModelThreaded
// time to compl
// =====================================================================================
-void ProcessModel(int modelnum)
+void ProcessModel(intptr_t modelnum)
{
surfchain_t* surfs;
node_t* nodes;
--- hlcsg/brush.cpp.orig 2016-04-01 13:18:21 UTC
+++ hlcsg/brush.cpp
@@ -1075,7 +1075,7 @@ contents_t CheckBrushContents(const
// CreateBrush
// makes a brush!
// =====================================================================================
-void CreateBrush(const int brushnum)
+void CreateBrush(const intptr_t brushnum)
{
brush_t* b;
int contents;
--- hlcsg/brushunion.cpp.orig 2016-04-01 13:18:21 UTC
+++ hlcsg/brushunion.cpp
@@ -252,7 +252,7 @@ static bool isInvalidHull(const brus
return false;
}
-void CalculateBrushUnions(const int brushnum)
+void CalculateBrushUnions(const intptr_t brushnum)
{
int bn, hull;
brush_t* b1;
--- hlcsg/csg.h.orig 2016-04-01 13:18:21 UTC
+++ hlcsg/csg.h
@@ -190,7 +190,7 @@ extern int TexinfoForBrushTexture(c
extern brush_t* Brush_LoadEntity(entity_t* ent, int hullnum);
extern contents_t CheckBrushContents(const brush_t* const b);
-extern void CreateBrush(int brushnum);
+extern void CreateBrush(intptr_t brushnum);
//=============================================================================
// csg.c
@@ -253,7 +253,7 @@ extern void HandleWadinclude();
//=============================================================================
// brushunion.c
-void CalculateBrushUnions(int brushnum);
+void CalculateBrushUnions(intptr_t brushnum);
//============================================================================
// hullfile.cpp
--- hlcsg/qcsg.cpp.orig 2016-04-01 13:18:21 UTC
+++ hlcsg/qcsg.cpp
@@ -546,7 +546,7 @@ static bface_t* CopyFacesToOutside(brush
// =====================================================================================
// CSGBrush
// =====================================================================================
-static void CSGBrush(int brushnum)
+static void CSGBrush(intptr_t brushnum)
{
int hull;
brush_t* b1;
@@ -1078,7 +1078,7 @@ static void ProcessModels()
// =====================================================================================
// SetModelCenters
// =====================================================================================
-static void SetModelCenters(int entitynum)
+static void SetModelCenters(intptr_t entitynum)
{
int i;
int last;
--- hlrad/lightmap.cpp.orig 2016-04-01 13:18:21 UTC
+++ hlrad/lightmap.cpp
@@ -1786,7 +1786,7 @@ const vec3_t s_circuscolors[] = {
// =====================================================================================
// BuildFacelights
// =====================================================================================
-void BuildFacelights(const int facenum)
+void BuildFacelights(const intptr_t facenum)
{
dface_t* f;
vec3_t sampled[MAXLIGHTMAPS];
@@ -2206,7 +2206,7 @@ void PrecompLightmapOffsets()
// FinalLightFace
// Add the indirect lighting on top of the direct lighting and save into final map format
// =====================================================================================
-void FinalLightFace(const int facenum)
+void FinalLightFace(const intptr_t facenum)
{
int i, j, k;
vec3_t lb, v;
--- hlrad/qrad.cpp.orig 2016-04-01 13:18:21 UTC
+++ hlrad/qrad.cpp
@@ -1506,7 +1506,7 @@ static void CollectLight()
#pragma warning(push)
#pragma warning(disable: 4100) // unreferenced formal parameter
#endif
-static void GatherLight(int threadnum)
+static void GatherLight(intptr_t threadnum)
{
int j;
patch_t* patch;
@@ -1628,7 +1628,7 @@ static void GatherLight(int threadnu
// RGB Transfer version
#ifdef HLRAD_HULLU
-static void GatherRGBLight(int threadnum)
+static void GatherRGBLight(intptr_t threadnum)
{
int j;
patch_t* patch;
--- hlrad/qrad.h.orig 2016-04-01 13:18:21 UTC
+++ hlrad/qrad.h
@@ -432,9 +432,9 @@ extern float g_softlight_hack_distance;
extern void MakeTnodes(dmodel_t* bm);
extern void PairEdges();
-extern void BuildFacelights(int facenum);
+extern void BuildFacelights(intptr_t facenum);
extern void PrecompLightmapOffsets();
-extern void FinalLightFace(int facenum);
+extern void FinalLightFace(intptr_t facenum);
extern int TestLine(const vec3_t start, const vec3_t stop);
extern int TestLine_r(int node, const vec3_t start, const vec3_t stop);
extern void CreateDirectLights();
@@ -468,12 +468,12 @@ extern bool readtransfers(const char
extern void writetransfers(const char* const transferfile, long total_patches);
// vismatrixutil.c (shared between vismatrix.c and sparse.c)
-extern void SwapTransfers(int patchnum);
-extern void MakeScales(int threadnum);
+extern void SwapTransfers(intptr_t patchnum);
+extern void MakeScales(intptr_t threadnum);
extern void DumpTransfersMemoryUsage();
#ifdef HLRAD_HULLU
-extern void SwapRGBTransfers(int patchnum);
-extern void MakeRGBScales(int threadnum);
+extern void SwapRGBTransfers(intptr_t patchnum);
+extern void MakeRGBScales(intptr_t threadnum);
// transparency.c (transparency array functions - shared between vismatrix.c and sparse.c)
extern void GetTransparency(const unsigned p1, const unsigned p2, vec3_t &trans, unsigned int &next_index);
--- hlrad/sparse.cpp.orig 2016-04-01 13:18:21 UTC
+++ hlrad/sparse.cpp
@@ -339,7 +339,7 @@ static void BuildVisRow(const int pa
#pragma warning(push)
#pragma warning(disable: 4100) // unreferenced formal parameter
#endif
-static void BuildVisLeafs(int threadnum)
+static void BuildVisLeafs(intptr_t threadnum)
{
int i;
int lface, facenum, facenum2;
--- hlrad/vismatrix.cpp.orig 2016-04-01 13:18:21 UTC
+++ hlrad/vismatrix.cpp
@@ -151,7 +151,7 @@ static void BuildVisRow(const int pa
#pragma warning(push)
#pragma warning(disable: 4100) // unreferenced formal parameter
#endif
-static void BuildVisLeafs(int threadnum)
+static void BuildVisLeafs(intptr_t threadnum)
{
int i;
int lface, facenum, facenum2;
--- hlrad/vismatrixutil.cpp.orig 2016-04-01 13:18:21 UTC
+++ hlrad/vismatrixutil.cpp
@@ -190,7 +190,7 @@ static transfer_index_t* CompressTransfe
#pragma warning(push)
#pragma warning(disable: 4100) // unreferenced formal parameter
#endif
-void MakeScales(const int threadnum)
+void MakeScales(const intptr_t threadnum)
{
int i;
unsigned j;
@@ -391,7 +391,7 @@ void MakeScales(const int thr
* they will actually be rather different.
* =============
*/
-void SwapTransfers(const int patchnum)
+void SwapTransfers(const intptr_t patchnum)
{
patch_t* patch = &g_patches[patchnum];
transfer_index_t* tIndex = patch->tIndex;
@@ -456,7 +456,7 @@ void SwapTransfers(const int
#pragma warning(push)
#pragma warning(disable: 4100) // unreferenced formal parameter
#endif
-void MakeRGBScales(const int threadnum)
+void MakeRGBScales(const intptr_t threadnum)
{
int i;
unsigned j;
@@ -678,7 +678,7 @@ void MakeRGBScales(const int
* they will actually be rather different.
* =============
*/
-void SwapRGBTransfers(const int patchnum)
+void SwapRGBTransfers(const intptr_t patchnum)
{
patch_t* patch = &g_patches[patchnum];
transfer_index_t* tIndex = patch->tIndex;
--- hlvis/flow.cpp.orig 2016-04-01 13:18:21 UTC
+++ hlvis/flow.cpp
@@ -678,7 +678,7 @@ static void SimpleFlood(byte* const
// =====================================================================================
// BlockVis
// =====================================================================================
-void BlockVis(int unused)
+void BlockVis(intptr_t unused)
{
int i, j, k, l, m;
portal_t *p;
@@ -1156,7 +1156,7 @@ static float CalcSplitsAndDotProducts(p
// =====================================================================================
// BasePortalVis
// =====================================================================================
-void BasePortalVis(int unused)
+void BasePortalVis(intptr_t unused)
{
int i, j, k;
portal_t* tp;
@@ -1242,7 +1242,7 @@ void BasePortalVis(int unused
// =====================================================================================
// MaxDistVis
// =====================================================================================
-void MaxDistVis(int unused)
+void MaxDistVis(intptr_t unused)
{
int i, j, k, m;
int a, b, c, d;
--- hlvis/vis.cpp.orig 2016-04-01 13:18:21 UTC
+++ hlvis/vis.cpp
@@ -213,14 +213,14 @@ static void PlaneFromWinding(winding
static winding_t* NewWinding(const int points)
{
winding_t* w;
- int size;
+ intptr_t size;
if (points > MAX_POINTS_ON_WINDING)
{
Error("NewWinding: %i points > MAX_POINTS_ON_WINDING", points);
}
- size = (int)((winding_t*)0)->points[points];
+ size = (intptr_t)((winding_t*)0)->points[points];
w = (winding_t*)calloc(1, size);
return w;
@@ -463,7 +463,7 @@ void CompressAll(void)
#endif
#ifndef ZHLT_NETVIS
-static void LeafThread(int unused)
+static void LeafThread(intptr_t unused)
{
portal_t* p;
@@ -483,7 +483,7 @@ static void LeafThread(int unused)
#ifdef ZHLT_NETVIS
-static void LeafThread(int unused)
+static void LeafThread(intptr_t unused)
{
if (g_vismode == VIS_MODE_CLIENT)
{
--- hlvis/vis.h.orig 2016-04-01 13:18:21 UTC
+++ hlvis/vis.h
@@ -184,14 +184,14 @@ extern volatile int g_vislocalpercent;
extern Zones* g_Zones;
-extern void BasePortalVis(int threadnum);
+extern void BasePortalVis(intptr_t threadnum);
#ifdef HLVIS_MAXDIST // AJM: MVD
extern visblocker_t *GetVisBlock(char *name);
-extern void BlockVis(int unused);
-extern void MaxDistVis(int threadnum);
-//extern void PostMaxDistVis(int threadnum);
+extern void BlockVis(intptr_t unused);
+extern void MaxDistVis(intptr_t threadnum);
+//extern void PostMaxDistVis(intptr_t threadnum);
#endif
extern void PortalFlow(portal_t* p);
|