1 #! /bin/sh /usr/share/dpatch/dpatch-run
2 ## gcc4.dpatch by <Damyan Ivanov <divanov@creditreform.bg>>
4 ## All lines beginning with `## DP:' are a description of the patch.
5 ## DP: Make sources compile with gcc4
8 diff -urNad firebird2-1.5.3.4870~/src/common/classes/alloc.h firebird2-1.5.3.4870/src/common/classes/alloc.h
9 --- firebird2-1.5.3.4870~/src/common/classes/alloc.h 2006-02-01 23:07:02.000000000 +0200
10 +++ firebird2-1.5.3.4870/src/common/classes/alloc.h 2006-02-01 23:07:04.000000000 +0200
13 void operator delete[](void* mem) throw();
16 +#define STATIC_NEW static
21 #ifdef DEBUG_GDS_ALLOC
22 -static inline void* operator new(size_t s, Firebird::MemoryPool& pool, char* file, int line) {
23 +STATIC_NEW inline void* operator new(size_t s, Firebird::MemoryPool& pool, char* file, int line) {
24 return pool.allocate(s, 0, file, line);
25 // return pool.calloc(s, 0, file, line);
27 -static inline void* operator new[](size_t s, Firebird::MemoryPool& pool, char* file, int line) {
28 +STATIC_NEW inline void* operator new[](size_t s, Firebird::MemoryPool& pool, char* file, int line) {
29 return pool.allocate(s, 0, file, line);
30 // return pool.calloc(s, 0, file, line);
32 #define FB_NEW(pool) new(pool,__FILE__,__LINE__)
33 #define FB_NEW_RPT(pool,count) new(pool,count,__FILE__,__LINE__)
35 -static inline void* operator new(size_t s, Firebird::MemoryPool& pool) {
36 +STATIC_NEW inline void* operator new(size_t s, Firebird::MemoryPool& pool) {
37 return pool.allocate(s);
38 // return pool.calloc(s);
40 -static inline void* operator new[](size_t s, Firebird::MemoryPool& pool) {
41 +STATIC_NEW inline void* operator new[](size_t s, Firebird::MemoryPool& pool) {
42 return pool.allocate(s);
43 // return pool.calloc(s);
45 diff -urNad firebird2-1.5.3.4870~/src/common/config/config.cpp firebird2-1.5.3.4870/src/common/config/config.cpp
46 --- firebird2-1.5.3.4870~/src/common/config/config.cpp 2006-02-01 23:07:02.000000000 +0200
47 +++ firebird2-1.5.3.4870/src/common/config/config.cpp 2006-02-01 23:07:04.000000000 +0200
50 int Config::getSortMemBlockSize()
52 - return (int) sysConfig.values[KEY_SORT_MEM_BLOCK_SIZE];
53 + return (int)(IPTR) sysConfig.values[KEY_SORT_MEM_BLOCK_SIZE];
56 int Config::getSortMemUpperLimit()
58 - return (int) sysConfig.values[KEY_SORT_MEM_UPPER_LIMIT];
59 + return (int)(IPTR) sysConfig.values[KEY_SORT_MEM_UPPER_LIMIT];
62 bool Config::getRemoteFileOpenAbility()
65 int Config::getGuardianOption()
67 - return (int) sysConfig.values[KEY_GUARDIAN_OPTION];
68 + return (int)(IPTR) sysConfig.values[KEY_GUARDIAN_OPTION];
71 int Config::getCpuAffinityMask()
73 - return (int) sysConfig.values[KEY_CPU_AFFINITY_MASK];
74 + return (int)(IPTR) sysConfig.values[KEY_CPU_AFFINITY_MASK];
77 bool Config::getOldParameterOrdering()
80 int Config::getTcpRemoteBufferSize()
82 - return (int) sysConfig.values[KEY_TCP_REMOTE_BUFFER_SIZE];
83 + return (int)(IPTR) sysConfig.values[KEY_TCP_REMOTE_BUFFER_SIZE];
86 bool Config::getTcpNoNagle()
89 int Config::getIpcMapSize()
91 - return (int) sysConfig.values[KEY_IPC_MAP_SIZE];
92 + return (int)(IPTR) sysConfig.values[KEY_IPC_MAP_SIZE];
95 int Config::getDefaultDbCachePages()
97 - return (int) sysConfig.values[KEY_DEFAULT_DB_CACHE_PAGES];
98 + return (int)(IPTR) sysConfig.values[KEY_DEFAULT_DB_CACHE_PAGES];
101 int Config::getConnectionTimeout()
103 - return (int) sysConfig.values[KEY_CONNECTION_TIMEOUT];
104 + return (int)(IPTR) sysConfig.values[KEY_CONNECTION_TIMEOUT];
107 int Config::getDummyPacketInterval()
109 - return (int) sysConfig.values[KEY_DUMMY_PACKET_INTERVAL];
110 + return (int)(IPTR) sysConfig.values[KEY_DUMMY_PACKET_INTERVAL];
113 int Config::getLockMemSize()
115 - return (int) sysConfig.values[KEY_LOCK_MEM_SIZE];
116 + return (int)(IPTR) sysConfig.values[KEY_LOCK_MEM_SIZE];
119 int Config::getLockSemCount()
121 - return (int) sysConfig.values[KEY_LOCK_SEM_COUNT];
122 + return (int)(IPTR) sysConfig.values[KEY_LOCK_SEM_COUNT];
125 int Config::getLockSignal()
127 - return (int) sysConfig.values[KEY_LOCK_SIGNAL];
128 + return (int)(IPTR) sysConfig.values[KEY_LOCK_SIGNAL];
131 bool Config::getLockGrantOrder()
132 @@ -341,27 +341,27 @@
134 int Config::getLockHashSlots()
136 - return (int) sysConfig.values[KEY_LOCK_HASH_SLOTS];
137 + return (int)(IPTR) sysConfig.values[KEY_LOCK_HASH_SLOTS];
140 int Config::getLockAcquireSpins()
142 - return (int) sysConfig.values[KEY_LOCK_ACQUIRE_SPINS];
143 + return (int)(IPTR) sysConfig.values[KEY_LOCK_ACQUIRE_SPINS];
146 int Config::getEventMemSize()
148 - return (int) sysConfig.values[KEY_EVENT_MEM_SIZE];
149 + return (int)(IPTR) sysConfig.values[KEY_EVENT_MEM_SIZE];
152 int Config::getDeadlockTimeout()
154 - return (int) sysConfig.values[KEY_DEADLOCK_TIMEOUT];
155 + return (int)(IPTR) sysConfig.values[KEY_DEADLOCK_TIMEOUT];
158 int Config::getSolarisStallValue()
160 - return (int) sysConfig.values[KEY_SOLARIS_STALL_VALUE];
161 + return (int)(IPTR) sysConfig.values[KEY_SOLARIS_STALL_VALUE];
164 bool Config::getTraceMemoryPools()
167 int Config::getPrioritySwitchDelay()
169 - int rc = (int) sysConfig.values[KEY_PRIORITY_SWITCH_DELAY];
170 + int rc = (int)(IPTR) sysConfig.values[KEY_PRIORITY_SWITCH_DELAY];
176 int Config::getDeadThreadsCollection()
178 - int rc = (int) sysConfig.values[KEY_DEAD_THREADS_COLLECTION];
179 + int rc = (int)(IPTR) sysConfig.values[KEY_DEAD_THREADS_COLLECTION];
185 int Config::getPriorityBoost()
187 - int rc = (int) sysConfig.values[KEY_PRIORITY_BOOST];
188 + int rc = (int)(IPTR) sysConfig.values[KEY_PRIORITY_BOOST];
194 int Config::getRemoteServicePort()
196 - return (int) sysConfig.values[KEY_REMOTE_SERVICE_PORT];
197 + return (int)(IPTR) sysConfig.values[KEY_REMOTE_SERVICE_PORT];
200 const char *Config::getRemotePipeName()
201 @@ -417,17 +417,17 @@
203 int Config::getMaxUnflushedWrites()
205 - return (int) sysConfig.values[KEY_MAX_UNFLUSHED_WRITES];
206 + return (int)(IPTR) sysConfig.values[KEY_MAX_UNFLUSHED_WRITES];
209 int Config::getMaxUnflushedWriteTime()
211 - return (int) sysConfig.values[KEY_MAX_UNFLUSHED_WRITE_TIME];
212 + return (int)(IPTR) sysConfig.values[KEY_MAX_UNFLUSHED_WRITE_TIME];
215 int Config::getProcessPriorityLevel()
217 - return (int) sysConfig.values[KEY_PROCESS_PRIORITY_LEVEL];
218 + return (int)(IPTR) sysConfig.values[KEY_PROCESS_PRIORITY_LEVEL];
221 bool Config::getCreateInternalWindow()
223 int Config::getRemoteAuxPort()
226 - return (int) sysConfig.values[KEY_REMOTE_AUX_PORT];
227 + return (int)(IPTR) sysConfig.values[KEY_REMOTE_AUX_PORT];
231 diff -urNad firebird2-1.5.3.4870~/src/gpre/c_cxx.cpp firebird2-1.5.3.4870/src/gpre/c_cxx.cpp
232 --- firebird2-1.5.3.4870~/src/gpre/c_cxx.cpp 2006-02-01 23:07:02.000000000 +0200
233 +++ firebird2-1.5.3.4870/src/gpre/c_cxx.cpp 2006-02-01 23:07:04.000000000 +0200
234 @@ -2184,7 +2184,7 @@
236 args.pat_database = (DBB) init->nod_arg[3];
237 args.pat_vector1 = status_vector(action);
238 - args.pat_long1 = (int) init->nod_arg[2];
239 + args.pat_long1 = (int)(IPTR) init->nod_arg[2];
240 args.pat_value2 = (int) event_list->nod_count;
242 // generate call to dynamically generate event blocks
243 @@ -2255,7 +2255,7 @@
244 event_init = (GPRE_NOD) event_action->act_object;
245 stack_name = (SYM) event_init->nod_arg[0];
246 if (!strcmp(event_name->sym_string, stack_name->sym_string)) {
247 - ident = (int) event_init->nod_arg[2];
248 + ident = (int)(IPTR) event_init->nod_arg[2];
249 database = (DBB) event_init->nod_arg[3];
252 diff -urNad firebird2-1.5.3.4870~/src/gpre/cmd.cpp firebird2-1.5.3.4870/src/gpre/cmd.cpp
253 --- firebird2-1.5.3.4870~/src/gpre/cmd.cpp 2006-02-01 23:07:02.000000000 +0200
254 +++ firebird2-1.5.3.4870/src/gpre/cmd.cpp 2006-02-01 23:07:04.000000000 +0200
257 case ACT_drop_shadow:
258 put_numeric(request, gds_dyn_delete_shadow,
259 - (SSHORT) action->act_object);
260 + (SSHORT)(IPTR) action->act_object);
264 diff -urNad firebird2-1.5.3.4870~/src/gpre/cme.cpp firebird2-1.5.3.4870/src/gpre/cme.cpp
265 --- firebird2-1.5.3.4870~/src/gpre/cme.cpp 2006-02-01 23:07:02.000000000 +0200
266 +++ firebird2-1.5.3.4870/src/gpre/cme.cpp 2006-02-01 23:07:04.000000000 +0200
268 // ** Begin date/time/timestamp support *
271 - switch ((KWWORDS) (int) node->nod_arg[0])
272 + switch ((KWWORDS) (int)(IPTR) node->nod_arg[1])
275 STUFF(blr_extract_year);
277 // ** Begin date/time/timestamp support *
280 - KWWORDS kw_word = (KWWORDS) (int) node->nod_arg[0];
281 + KWWORDS kw_word = (KWWORDS) (int)(IPTR) node->nod_arg[0];
282 CME_get_dtype(node->nod_arg[1], f);
283 switch (f->fld_dtype)
285 diff -urNad firebird2-1.5.3.4870~/src/gpre/cob.cpp firebird2-1.5.3.4870/src/gpre/cob.cpp
286 --- firebird2-1.5.3.4870~/src/gpre/cob.cpp 2006-02-01 23:07:02.000000000 +0200
287 +++ firebird2-1.5.3.4870/src/gpre/cob.cpp 2006-02-01 23:07:04.000000000 +0200
289 static void gen_on_error (ACT);
290 static void gen_procedure (ACT);
291 static void gen_put_segment (ACT);
292 -static void gen_raw (UCHAR *, enum req_t, int, int);
293 +static void gen_raw (UCHAR *, enum req_t, int, IPTR);
294 static void gen_ready (ACT);
295 static void gen_receive (ACT, POR);
296 static void gen_release (ACT);
297 @@ -2656,7 +2656,7 @@
299 args.pat_database = (DBB) init->nod_arg[3];
300 args.pat_vector1 = status_vector(action);
301 - args.pat_value1 = (int) init->nod_arg[2];
302 + args.pat_value1 = (IPTR) init->nod_arg[2];
303 args.pat_value2 = (int) event_list->nod_count;
304 args.pat_string1 = ISC_EVENT_BLOCK;
305 args.pat_string2 = ISC_EVENT_WAIT;
306 @@ -2712,7 +2712,7 @@
314 "CALL \"%S2\" USING %V1, %RF%DH%RE, %VF%S4%N1L%VE, %VF%S4%N1A%VE, %VF%S4%N1B%VE";
315 @@ -2730,7 +2730,7 @@
316 event_init = (GPRE_NOD) event_action->act_object;
317 stack_name = (SYM) event_init->nod_arg[0];
318 if (!strcmp(event_name->sym_string, stack_name->sym_string)) {
319 - ident = (int) event_init->nod_arg[2];
320 + ident = (IPTR) event_init->nod_arg[2];
321 database = (DBB) event_init->nod_arg[3];
324 @@ -3845,7 +3845,7 @@
328 - enum req_t request_type, int request_length, int ident)
329 + enum req_t request_type, int request_length, IPTR ident)
333 @@ -4193,7 +4193,7 @@
334 printa(names[COLUMN_0], FALSE, "01 %s%d.",
335 names[ISC_], blob->blb_bpb_ident);
336 gen_raw(blob->blb_bpb, request->req_type, blob->blb_bpb_length,
339 printa(names[COMMENT], FALSE, " ");
342 @@ -4703,7 +4703,7 @@
343 static void gen_type( ACT action)
346 - printa(names[COLUMN], TRUE, "%ld", action->act_object);
347 + printa(names[COLUMN], TRUE, "%ld", (IPTR) action->act_object);
351 diff -urNad firebird2-1.5.3.4870~/src/gpre/pat.h firebird2-1.5.3.4870/src/gpre/pat.h
352 --- firebird2-1.5.3.4870~/src/gpre/pat.h 2006-02-01 23:07:02.000000000 +0200
353 +++ firebird2-1.5.3.4870/src/gpre/pat.h 2006-02-01 23:07:04.000000000 +0200
363 diff -urNad firebird2-1.5.3.4870~/src/jrd/blb.cpp firebird2-1.5.3.4870/src/jrd/blb.cpp
364 --- firebird2-1.5.3.4870~/src/jrd/blb.cpp 2006-02-01 23:07:02.000000000 +0200
365 +++ firebird2-1.5.3.4870/src/jrd/blb.cpp 2006-02-01 23:07:04.000000000 +0200
367 request = tdbb->tdbb_request;
368 source = (BID) from_desc->dsc_address;
369 destination = (BID) to_desc->dsc_address;
370 - id = (USHORT) field->nod_arg[e_fld_id];
371 - rpb = &request->req_rpb[(int) field->nod_arg[e_fld_stream]];
372 + id = (USHORT)(IPTR) field->nod_arg[e_fld_id];
373 + rpb = &request->req_rpb[(int)(IPTR) field->nod_arg[e_fld_stream]];
374 relation = rpb->rpb_relation;
375 record = rpb->rpb_record;
377 diff -urNad firebird2-1.5.3.4870~/src/jrd/cmp.cpp firebird2-1.5.3.4870/src/jrd/cmp.cpp
378 --- firebird2-1.5.3.4870~/src/jrd/cmp.cpp 2006-02-01 23:07:02.000000000 +0200
379 +++ firebird2-1.5.3.4870/src/jrd/cmp.cpp 2006-02-01 23:07:04.000000000 +0200
384 - id = (USHORT) node->nod_arg[e_fld_id];
385 + id = (USHORT)(IPTR) node->nod_arg[e_fld_id];
387 - CMP_format(tdbb, csb, (USHORT) node->nod_arg[e_fld_stream]);
388 + CMP_format(tdbb, csb, (USHORT)(IPTR) node->nod_arg[e_fld_stream]);
389 if (id >= format->fmt_count) {
390 desc->dsc_dtype = dtype_null;
391 desc->dsc_length = 0;
394 sub = node->nod_arg[e_scl_field];
396 - csb->csb_rpt[(USHORT) sub->
397 + csb->csb_rpt[(USHORT)(IPTR) sub->
398 nod_arg[e_fld_stream]].csb_relation;
399 - id = (USHORT) sub->nod_arg[e_fld_id];
400 + id = (USHORT)(IPTR) sub->nod_arg[e_fld_id];
401 field = MET_get_field(relation, id);
402 if (!field || !(array = field->fld_array))
403 IBERROR(223); /* msg 223 argument of scalar operation must be an array */
404 @@ -1661,7 +1661,7 @@
408 - if ((ULONG) node->nod_arg[e_extract_part] == blr_extract_second) {
409 + if ((ULONG)(IPTR) node->nod_arg[e_extract_part] == blr_extract_second) {
410 /* QUADDATE - SECOND returns a float, or scaled! */
411 desc->dsc_dtype = dtype_long;
412 desc->dsc_length = sizeof(ULONG);
413 @@ -1720,7 +1720,7 @@
415 message = node->nod_arg[e_arg_message];
416 format = (FMT) message->nod_arg[e_msg_format];
417 - *desc = format->fmt_desc[(int) node->nod_arg[e_arg_number]];
418 + *desc = format->fmt_desc[(int)(IPTR) node->nod_arg[e_arg_number]];
422 @@ -2653,8 +2653,8 @@
423 !input->nod_arg[e_fld_id] && !input->nod_arg[e_fld_stream])
426 - field_id = (USHORT) input->nod_arg[e_fld_id];
427 - stream = (USHORT) input->nod_arg[e_fld_stream];
428 + field_id = (USHORT)(IPTR) input->nod_arg[e_fld_id];
429 + stream = (USHORT)(IPTR) input->nod_arg[e_fld_stream];
433 @@ -2662,7 +2662,7 @@
434 relation = (*csb)->csb_rpt[stream].csb_relation;
435 field = MET_get_field(relation, field_id);
436 if (field->fld_source)
437 - field_id = (USHORT) field->fld_source->nod_arg[e_fld_id];
438 + field_id = (USHORT)(IPTR) field->fld_source->nod_arg[e_fld_id];
441 stream = remap[stream];
442 @@ -2773,7 +2773,7 @@
443 node->nod_type = input->nod_type;
446 - stream = (USHORT) input->nod_arg[e_rel_stream];
447 + stream = (USHORT)(IPTR) input->nod_arg[e_rel_stream];
449 Last entry in the remap contains the the original stream number.
450 Get that stream number so that the flags can be copied
451 @@ -2853,7 +2853,7 @@
452 node->nod_arg[e_prc_inputs] =
453 copy(tdbb, csb, input->nod_arg[e_prc_inputs], remap, field_id,
454 node->nod_arg[e_prc_in_msg], remap_fld);
455 - stream = (USHORT) input->nod_arg[e_prc_stream];
456 + stream = (USHORT)(IPTR) input->nod_arg[e_prc_stream];
457 new_stream = (*csb)->csb_n_stream++;
458 node->nod_arg[e_prc_stream] = (JRD_NOD) (SLONG) new_stream;
459 /* TMN: Here we should really have the following assert */
460 @@ -2863,7 +2863,7 @@
461 element = CMP_csb_element(csb, new_stream);
462 // SKIDDER: Maybe we need to check if we really found a procedure ?
463 element->csb_procedure = MET_lookup_procedure_id(tdbb,
464 - (SSHORT)node->nod_arg[e_prc_procedure],FALSE,FALSE,0);
465 + (SSHORT)(IPTR)node->nod_arg[e_prc_procedure],FALSE,FALSE,0);
467 (*csb)->csb_rpt[new_stream].csb_flags |=
468 (*csb)->csb_rpt[stream].csb_flags & csb_no_dbkey;
469 @@ -2876,7 +2876,7 @@
470 node = PAR_make_node(tdbb, e_agg_length);
471 node->nod_type = input->nod_type;
473 - stream = (USHORT) input->nod_arg[e_agg_stream];
474 + stream = (USHORT)(IPTR) input->nod_arg[e_agg_stream];
475 assert(stream <= MAX_STREAMS);
476 new_stream = (*csb)->csb_n_stream++;
477 assert(new_stream <= MAX_STREAMS);
478 @@ -2905,7 +2905,7 @@
479 node = PAR_make_node(tdbb, e_uni_length);
480 node->nod_type = input->nod_type;
482 - stream = (USHORT) input->nod_arg[e_uni_stream];
483 + stream = (USHORT)(IPTR) input->nod_arg[e_uni_stream];
484 new_stream = (*csb)->csb_n_stream++;
485 node->nod_arg[e_uni_stream] = (JRD_NOD) (SLONG) new_stream;
486 /* TMN: Here we should really have the following assert */
487 @@ -3043,7 +3043,7 @@
491 - stream = (USHORT) node->nod_arg[e_rel_stream];
492 + stream = (USHORT)(IPTR) node->nod_arg[e_rel_stream];
493 csb->csb_rpt[stream].csb_flags |= csb_no_dbkey;
494 tail = &csb->csb_rpt[stream];
495 if ( (relation = tail->csb_relation) )
496 @@ -3271,7 +3271,7 @@
498 UCHAR *map, local_map[MAP_LENGTH];
500 - stream = (USHORT) node->nod_arg[e_fld_stream];
501 + stream = (USHORT)(IPTR) node->nod_arg[e_fld_stream];
503 /* Look at all rse's which are lower in scope than the rse which this field
504 is referencing, and mark them as varying -- the rule is that if a field
505 @@ -3292,7 +3292,7 @@
506 if (!(relation = tail->csb_relation) ||
508 MET_get_field(relation,
509 - (USHORT) node->nod_arg[e_fld_id]))) break;
510 + (USHORT)(IPTR) node->nod_arg[e_fld_id]))) break;
512 /* if this is a modify or store, check REFERENCES access to any foreign keys. */
514 @@ -3404,9 +3404,9 @@
516 sub = node->nod_arg[e_asgn_from];
517 if (sub->nod_type == nod_field) {
518 - stream = (USHORT) sub->nod_arg[e_fld_stream];
519 + stream = (USHORT)(IPTR) sub->nod_arg[e_fld_stream];
520 field = MET_get_field((*csb)->csb_rpt[stream].csb_relation,
521 - (USHORT) sub->nod_arg[e_fld_id]);
522 + (USHORT)(IPTR) sub->nod_arg[e_fld_id]);
524 node->nod_arg[e_asgn_missing2] = field->fld_missing_value;
526 @@ -3414,12 +3414,12 @@
527 sub = node->nod_arg[e_asgn_to];
528 if (sub->nod_type != nod_field)
530 - stream = (USHORT) sub->nod_arg[e_fld_stream];
531 + stream = (USHORT)(IPTR) sub->nod_arg[e_fld_stream];
532 tail = &(*csb)->csb_rpt[stream];
535 MET_get_field(tail->csb_relation,
536 - (USHORT) sub->nod_arg[e_fld_id]))) break;
537 + (USHORT)(IPTR) sub->nod_arg[e_fld_id]))) break;
538 if (field->fld_missing_value) {
539 node->nod_arg[e_asgn_missing] = field->fld_missing_value;
541 @@ -3433,7 +3433,7 @@
545 - stream = (USHORT) node->nod_arg[e_mod_new_stream];
546 + stream = (USHORT)(IPTR) node->nod_arg[e_mod_new_stream];
547 tail = &(*csb)->csb_rpt[stream];
548 tail->csb_flags |= csb_modify;
549 pass1_modify(tdbb, csb, node);
550 @@ -3441,13 +3441,13 @@
551 /* assert(node->nod_arg [e_mod_new_stream] <= MAX_USHORT); */
552 if ( (node->nod_arg[e_mod_validate] =
553 make_validation(tdbb, csb,
555 + (USHORT)(IPTR) node->
556 nod_arg[e_mod_new_stream])) ) node->nod_count =
557 MAX(node->nod_count, (USHORT) e_mod_validate + 1);
561 - stream = (USHORT) node->nod_arg[e_erase_stream];
562 + stream = (USHORT)(IPTR) node->nod_arg[e_erase_stream];
563 tail = &(*csb)->csb_rpt[stream];
564 tail->csb_flags |= csb_erase;
565 pass1_erase(tdbb, csb, node);
566 @@ -3463,12 +3463,12 @@
569 sub = node->nod_arg[e_sto_relation];
570 - stream = (USHORT) sub->nod_arg[e_rel_stream];
571 + stream = (USHORT)(IPTR) sub->nod_arg[e_rel_stream];
572 tail = &(*csb)->csb_rpt[stream];
573 tail->csb_flags |= csb_store;
574 sub = pass1_store(tdbb, csb, node);
576 - stream = (USHORT) sub->nod_arg[e_rel_stream];
577 + stream = (USHORT)(IPTR) sub->nod_arg[e_rel_stream];
578 if ((!node->nod_arg[e_sto_sub_store]) &&
579 (node->nod_arg[e_sto_validate] =
580 make_validation(tdbb, csb, stream))) node->nod_count =
581 @@ -3495,7 +3495,7 @@
584 assert((int)node->nod_arg[e_agg_stream] <= MAX_STREAMS);
585 - (*csb)->csb_rpt[(USHORT) node->nod_arg[e_agg_stream]].csb_flags |=
586 + (*csb)->csb_rpt[(USHORT)(IPTR) node->nod_arg[e_agg_stream]].csb_flags |=
588 ignore_dbkey(tdbb, *csb, (RSE) node->nod_arg[e_agg_rse], view);
589 node->nod_arg[e_agg_rse] =
590 @@ -3523,7 +3523,7 @@
593 type = node->nod_type;
594 - stream = (USHORT) node->nod_arg[0];
595 + stream = (USHORT)(IPTR) node->nod_arg[0];
597 if (!(*csb)->csb_rpt[stream].csb_map)
599 @@ -3558,7 +3558,7 @@
602 case nod_cardinality:
603 - stream = (USHORT) node->nod_arg[e_card_stream];
604 + stream = (USHORT)(IPTR) node->nod_arg[e_card_stream];
605 (*csb)->csb_rpt[stream].csb_flags |= csb_compute;
608 @@ -3625,7 +3625,7 @@
609 /* To support views of views, loop until we hit a real relation */
612 - stream = new_stream = (USHORT) node->nod_arg[e_erase_stream];
613 + stream = new_stream = (USHORT)(IPTR) node->nod_arg[e_erase_stream];
614 tail = &(*csb)->csb_rpt[stream];
615 tail->csb_flags |= csb_erase;
616 relation = (*csb)->csb_rpt[stream].csb_relation;
617 @@ -3693,7 +3693,7 @@
620 parent_stream = stream;
621 - new_stream = (USHORT) source->nod_arg[e_rel_stream];
622 + new_stream = (USHORT)(IPTR) source->nod_arg[e_rel_stream];
623 node->nod_arg[e_erase_stream] = (JRD_NOD) (SLONG) map[new_stream];
626 @@ -3740,7 +3740,7 @@
627 field = MET_get_field(relation, id);
628 if (field->fld_source)
630 - (USHORT) (JRD_NOD) (field->fld_source)->nod_arg[e_fld_id];
631 + (USHORT)(IPTR) (JRD_NOD) (field->fld_source)->nod_arg[e_fld_id];
635 @@ -3802,8 +3802,8 @@
636 /* To support views of views, loop until we hit a real relation */
639 - stream = (USHORT) node->nod_arg[e_mod_org_stream];
640 - new_stream = (USHORT) node->nod_arg[e_mod_new_stream];
641 + stream = (USHORT)(IPTR) node->nod_arg[e_mod_org_stream];
642 + new_stream = (USHORT)(IPTR) node->nod_arg[e_mod_new_stream];
643 tail = &(*csb)->csb_rpt[new_stream];
644 tail->csb_flags |= csb_modify;
645 relation = (*csb)->csb_rpt[stream].csb_relation;
646 @@ -3842,7 +3842,7 @@
648 MAX(node->nod_count, (USHORT) e_mod_map_view + 1);
649 map = (*csb)->csb_rpt[stream].csb_map;
650 - stream = (USHORT) source->nod_arg[e_rel_stream];
651 + stream = (USHORT)(IPTR) source->nod_arg[e_rel_stream];
652 stream = map[stream];
653 view_stream = new_stream;
655 @@ -3850,18 +3850,18 @@
659 - (SSHORT) node->nod_arg[e_mod_new_stream]);
660 + (SSHORT)(IPTR) node->nod_arg[e_mod_new_stream]);
661 source = copy(tdbb, csb, source, map, 0, NULL, FALSE);
662 /* TMN: Here we should really have the following assert */
663 /* assert(source->nod_arg [e_rel_stream] <= MAX_UCHAR); */
664 - map[new_stream] = (UCHAR) source->nod_arg[e_rel_stream];
665 + map[new_stream] = (UCHAR)(IPTR) source->nod_arg[e_rel_stream];
666 view_node = copy(tdbb, csb, node, map, 0, NULL, TRUE);
667 view_node->nod_arg[e_mod_org_stream] = (JRD_NOD) (SLONG) stream;
668 view_node->nod_arg[e_mod_new_stream] =
669 source->nod_arg[e_rel_stream];
670 view_node->nod_arg[e_mod_map_view] = NULL;
671 node->nod_arg[e_mod_sub_mod] = view_node;
672 - new_stream = (USHORT) source->nod_arg[e_rel_stream];
673 + new_stream = (USHORT)(IPTR) source->nod_arg[e_rel_stream];
674 view_node->nod_arg[e_mod_statement] =
675 pass1_expand_view(tdbb, *csb, view_stream, new_stream, TRUE);
677 @@ -3874,14 +3874,14 @@
678 /* View passes muster -- do some translation. Start with source stream */
680 map = (*csb)->csb_rpt[stream].csb_map;
681 - stream = (USHORT) source->nod_arg[e_rel_stream];
682 + stream = (USHORT)(IPTR) source->nod_arg[e_rel_stream];
683 node->nod_arg[e_mod_org_stream] = (JRD_NOD) (SLONG) map[stream];
685 /* Next, do update stream */
689 - (SSHORT) node->nod_arg[e_mod_new_stream]);
690 + (SSHORT)(IPTR) node->nod_arg[e_mod_new_stream]);
691 source = copy(tdbb, csb, source, map, 0, NULL, FALSE);
692 node->nod_arg[e_mod_new_stream] = source->nod_arg[e_rel_stream];
694 @@ -4128,7 +4128,7 @@
696 pass1(tdbb, csb, source, parent_view, view_stream, FALSE);
697 procedure = MET_lookup_procedure_id(tdbb,
698 - (SSHORT)source->nod_arg[e_prc_procedure], FALSE, FALSE, 0);
699 + (SSHORT)(IPTR)source->nod_arg[e_prc_procedure], FALSE, FALSE, 0);
700 post_procedure_access(tdbb, *csb, procedure);
701 CMP_post_resource(&(*csb)->csb_resources, (BLK) procedure,
702 Resource::rsc_procedure, procedure->prc_id);
703 @@ -4160,7 +4160,7 @@
705 source->nod_arg[e_rel_view] = (JRD_NOD) parent_view;
707 - stream = (USHORT) source->nod_arg[e_rel_stream];
708 + stream = (USHORT)(IPTR) source->nod_arg[e_rel_stream];
709 element = CMP_csb_element(csb, stream);
710 element->csb_view = parent_view;
711 /* TMN: Here we should really have the following assert */
712 @@ -4175,7 +4175,7 @@
713 for (vcx_ptr = &parent_view->rel_view_contexts; *vcx_ptr;
714 vcx_ptr = &(*vcx_ptr)->vcx_next)
715 if ((*vcx_ptr)->vcx_context ==
716 - (USHORT) source->nod_arg[e_rel_context]) {
717 + (USHORT)(IPTR) source->nod_arg[e_rel_context]) {
718 element->csb_alias = (*vcx_ptr)->vcx_context_name;
721 @@ -4319,7 +4319,7 @@
724 original = node->nod_arg[e_sto_relation];
725 - stream = (USHORT) original->nod_arg[e_rel_stream];
726 + stream = (USHORT)(IPTR) original->nod_arg[e_rel_stream];
727 tail = &(*csb)->csb_rpt[stream];
728 tail->csb_flags |= csb_store;
729 relation = (*csb)->csb_rpt[stream].csb_relation;
730 @@ -4373,7 +4373,7 @@
731 node->nod_arg[e_sto_relation] =
732 copy(tdbb, csb, source, map, 0, NULL, FALSE);
734 - (USHORT) node->nod_arg[e_sto_relation]->nod_arg[e_rel_stream];
735 + (USHORT)(IPTR) node->nod_arg[e_sto_relation]->nod_arg[e_rel_stream];
736 node->nod_arg[e_sto_statement] =
737 pass1_expand_view(tdbb, *csb, stream, new_stream, TRUE);
738 node->nod_arg[e_sto_statement] =
739 @@ -4721,9 +4721,9 @@
740 /* AB: Mark the streams involved with an UPDATE statement
741 active. So that the optimizer can use indices for
742 eventually used sub-selects. */
743 - stream = (USHORT) node->nod_arg[e_mod_org_stream];
744 + stream = (USHORT)(IPTR) node->nod_arg[e_mod_org_stream];
745 csb->csb_rpt[stream].csb_flags |= csb_active;
746 - stream = (USHORT) node->nod_arg[e_mod_new_stream];
747 + stream = (USHORT)(IPTR) node->nod_arg[e_mod_new_stream];
748 csb->csb_rpt[stream].csb_flags |= csb_active;
751 @@ -4735,9 +4735,9 @@
753 if (node->nod_type == nod_modify) {
754 /* AB: Remove the previous flags */
755 - stream = (USHORT) node->nod_arg[e_mod_org_stream];
756 + stream = (USHORT)(IPTR) node->nod_arg[e_mod_org_stream];
757 csb->csb_rpt[stream].csb_flags &= ~csb_active;
758 - stream = (USHORT) node->nod_arg[e_mod_new_stream];
759 + stream = (USHORT)(IPTR) node->nod_arg[e_mod_new_stream];
760 csb->csb_rpt[stream].csb_flags &= ~csb_active;
763 @@ -4836,7 +4836,7 @@
765 fmt::fmt_desc_iterator desc;
767 - stream = (USHORT) node->nod_arg[e_mod_org_stream];
768 + stream = (USHORT)(IPTR) node->nod_arg[e_mod_org_stream];
769 csb->csb_rpt[stream].csb_flags |= csb_update;
770 format = CMP_format(tdbb, csb, stream);
771 desc = format->fmt_desc.begin();
772 @@ -4861,13 +4861,13 @@
776 - stream = (USHORT) node->nod_arg[e_erase_stream];
777 + stream = (USHORT)(IPTR) node->nod_arg[e_erase_stream];
778 csb->csb_rpt[stream].csb_flags |= csb_update;
782 - stream = (USHORT) node->nod_arg[e_fld_stream];
783 - id = (USHORT) node->nod_arg[e_fld_id];
784 + stream = (USHORT)(IPTR) node->nod_arg[e_fld_stream];
785 + id = (USHORT)(IPTR) node->nod_arg[e_fld_id];
786 SBM_set(tdbb, &csb->csb_rpt[stream].csb_fields, id);
787 if (node->nod_flags & nod_value) {
788 csb->csb_impure += sizeof(struct vlux);
789 @@ -4941,7 +4941,7 @@
790 pass2_rse(tdbb, csb, (RSE) node->nod_arg[e_agg_rse]);
791 pass2(tdbb, csb, node->nod_arg[e_agg_map], node);
792 pass2(tdbb, csb, node->nod_arg[e_agg_group], node);
793 - stream = (USHORT) node->nod_arg[e_agg_stream];
794 + stream = (USHORT)(IPTR) node->nod_arg[e_agg_stream];
795 assert(stream <= MAX_STREAMS);
796 process_map(tdbb, csb, node->nod_arg[e_agg_map],
797 &csb->csb_rpt[stream].csb_format);
798 @@ -5050,7 +5050,7 @@
801 if (node->nod_type == nod_relation) {
802 - USHORT stream = (USHORT) node->nod_arg[e_rel_stream];
803 + USHORT stream = (USHORT)(IPTR) node->nod_arg[e_rel_stream];
804 csb->csb_rpt[stream].csb_flags |= csb_active;
805 pass2(tdbb, csb, node, (JRD_NOD) rse);
807 @@ -5058,12 +5058,12 @@
808 pass2_rse(tdbb, csb, (RSE) node);
810 else if (node->nod_type == nod_procedure) {
811 - USHORT stream = (USHORT) node->nod_arg[e_prc_stream];
812 + USHORT stream = (USHORT)(IPTR) node->nod_arg[e_prc_stream];
813 csb->csb_rpt[stream].csb_flags |= csb_active;
814 pass2(tdbb, csb, node, (JRD_NOD) rse);
816 else if (node->nod_type == nod_aggregate) {
817 - USHORT stream = (USHORT) node->nod_arg[e_agg_stream];
818 + USHORT stream = (USHORT)(IPTR) node->nod_arg[e_agg_stream];
819 assert(stream <= MAX_STREAMS);
820 csb->csb_rpt[stream].csb_flags |= csb_active;
821 pass2(tdbb, csb, node, (JRD_NOD) rse);
822 @@ -5118,7 +5118,7 @@
823 /* Make up a format block sufficiently large to hold instantiated record */
825 clauses = node->nod_arg[e_uni_clauses];
826 - id = (USHORT) node->nod_arg[e_uni_stream];
827 + id = (USHORT)(IPTR) node->nod_arg[e_uni_stream];
828 format = &csb->csb_rpt[id].csb_format;
830 /* Process alternating rse and map blocks */
831 @@ -5160,7 +5160,7 @@
833 for (ptr = rse->rse_relation, end = ptr + rse->rse_count; ptr < end;
834 ptr++) if ((*ptr)->nod_type == nod_relation) {
835 - stream = (USHORT) (*ptr)->nod_arg[e_rel_stream];
836 + stream = (USHORT)(IPTR) (*ptr)->nod_arg[e_rel_stream];
837 if (!(csb->csb_rpt[stream].csb_plan))
838 ERR_post(gds_no_stream_plan, gds_arg_string,
839 csb->csb_rpt[stream].csb_relation->rel_name, 0);
840 @@ -5213,7 +5213,7 @@
842 /* find the tail for the relation specified in the rse */
844 - stream = (USHORT) plan_relation_node->nod_arg[e_rel_stream];
845 + stream = (USHORT)(IPTR) plan_relation_node->nod_arg[e_rel_stream];
846 tail = &csb->csb_rpt[stream];
848 /* if the plan references a view, find the real base relation
849 @@ -5449,15 +5449,15 @@
852 if (node->nod_type == nod_relation) {
853 - USHORT stream = (USHORT) node->nod_arg[e_rel_stream];
854 + USHORT stream = (USHORT)(IPTR) node->nod_arg[e_rel_stream];
855 csb->csb_rpt[stream].csb_flags &= ~csb_active;
857 else if (node->nod_type == nod_procedure) {
858 - USHORT stream = (USHORT) node->nod_arg[e_prc_stream];
859 + USHORT stream = (USHORT)(IPTR) node->nod_arg[e_prc_stream];
860 csb->csb_rpt[stream].csb_flags &= ~csb_active;
862 else if (node->nod_type == nod_aggregate) {
863 - USHORT stream = (USHORT) node->nod_arg[e_agg_stream];
864 + USHORT stream = (USHORT)(IPTR) node->nod_arg[e_agg_stream];
865 assert(stream <= MAX_STREAMS);
866 csb->csb_rpt[stream].csb_flags &= ~csb_active;
868 @@ -5553,7 +5553,7 @@
869 for (end = ptr + map->nod_count; ptr < end; ptr++) {
871 field = assignment->nod_arg[e_asgn_to];
872 - id = (USHORT) field->nod_arg[e_fld_id];
873 + id = (USHORT)(IPTR) field->nod_arg[e_fld_id];
874 if (id >= format->fmt_count) {
875 format->fmt_desc.resize(id + 1);
877 @@ -5689,13 +5689,13 @@
878 /* for aggregates, check current rse, if not found then check
880 if (sub->nod_type == nod_aggregate) {
881 - if ((stream == (USHORT) sub->nod_arg[e_rel_stream]) ||
882 + if ((stream == (USHORT)(IPTR) sub->nod_arg[e_rel_stream]) ||
883 (stream_in_rse(stream, (RSE) sub->nod_arg[e_agg_rse])))
884 return TRUE; /* do not mark as variant */
887 if ((sub->nod_type == nod_relation) &&
888 - (stream == (USHORT) sub->nod_arg[e_rel_stream]))
889 + (stream == (USHORT)(IPTR) sub->nod_arg[e_rel_stream]))
890 return TRUE; /* do not mark as variant */
893 diff -urNad firebird2-1.5.3.4870~/src/jrd/common.h firebird2-1.5.3.4870/src/jrd/common.h
894 --- firebird2-1.5.3.4870~/src/jrd/common.h 2006-02-01 23:07:02.000000000 +0200
895 +++ firebird2-1.5.3.4870/src/jrd/common.h 2006-02-01 23:07:04.000000000 +0200
898 #define JRD_BUGCHK 15 /* facility code for bugcheck messages */
900 -#define OFFSET(struct,fld) ((int) &((struct) 0)->fld)
901 -#define OFFSETA(struct,fld) ((int) ((struct) 0)->fld)
902 +#define OFFSET(struct,fld) ((int)(IPTR) &((struct) 0)->fld)
903 +#define OFFSETA(struct,fld) ((int)(IPTR) ((struct) 0)->fld)
906 #ifndef ODS_ALIGNMENT
907 diff -urNad firebird2-1.5.3.4870~/src/jrd/dpm.epp firebird2-1.5.3.4870/src/jrd/dpm.epp
908 --- firebird2-1.5.3.4870~/src/jrd/dpm.epp 2006-02-01 23:07:02.000000000 +0200
909 +++ firebird2-1.5.3.4870/src/jrd/dpm.epp 2006-02-01 23:07:04.000000000 +0200
910 @@ -2119,7 +2119,7 @@
914 - CCH_precedence(tdbb, &rpb->rpb_window, (SLONG) LLS_POP(stack));
915 + CCH_precedence(tdbb, &rpb->rpb_window, (SLONG)(IPTR) LLS_POP(stack));
917 CCH_precedence(tdbb, &rpb->rpb_window, -rpb->rpb_transaction);
918 CCH_MARK(tdbb, &rpb->rpb_window);
919 @@ -2736,7 +2736,7 @@
920 If the page need to be compressed, compress it. */
923 - CCH_precedence(tdbb, &rpb->rpb_window, (SLONG) LLS_POP(stack));
924 + CCH_precedence(tdbb, &rpb->rpb_window, (SLONG)(IPTR) LLS_POP(stack));
925 CCH_MARK(tdbb, &rpb->rpb_window);
926 i = page->dpg_count + ((slot) ? 0 : 1);
928 diff -urNad firebird2-1.5.3.4870~/src/jrd/evl.cpp firebird2-1.5.3.4870/src/jrd/evl.cpp
929 --- firebird2-1.5.3.4870~/src/jrd/evl.cpp 2006-02-01 23:07:02.000000000 +0200
930 +++ firebird2-1.5.3.4870/src/jrd/evl.cpp 2006-02-01 23:07:04.000000000 +0200
932 arg_number = (int)(IPTR)node->nod_arg[e_arg_number];
933 desc = &format->fmt_desc[arg_number];
934 impure->vlu_desc.dsc_address =
935 - (UCHAR *) request + message->nod_impure + (int) desc->dsc_address;
936 + (UCHAR *) request + message->nod_impure + (int)(IPTR) desc->dsc_address;
937 impure->vlu_desc.dsc_dtype = desc->dsc_dtype;
938 impure->vlu_desc.dsc_length = desc->dsc_length;
939 impure->vlu_desc.dsc_scale = desc->dsc_scale;
941 // may happen. I checked triggers and insert/update statements.
942 // All seem to work fine.
944 - request->req_rpb[(int) node->nod_arg[e_fld_stream]].rpb_record;
945 - EVL_field(0, record, (USHORT) node->nod_arg[e_fld_id],
946 + request->req_rpb[(int)(IPTR) node->nod_arg[e_fld_stream]].rpb_record;
947 + EVL_field(0, record, (USHORT)(IPTR) node->nod_arg[e_fld_id],
949 if (!impure->vlu_desc.dsc_address)
950 ERR_post(gds_read_only_field, 0);
952 impure = (INV) ((SCHAR *) tdbb->tdbb_request + node->nod_impure);
953 SBM_reset(&impure->inv_bitmap);
954 desc = EVL_expr(tdbb, node->nod_arg[0]);
955 - id = 1 + 2 * (USHORT) node->nod_arg[1];
956 + id = 1 + 2 * (USHORT)(IPTR) node->nod_arg[1];
957 numbers = desc->dsc_address;
958 numbers += id * sizeof(SLONG);
959 MOVE_FAST(numbers, &rel_dbkey, sizeof(SLONG));
960 @@ -828,10 +828,10 @@
962 message = node->nod_arg[e_arg_message];
963 format = (FMT) message->nod_arg[e_msg_format];
964 - desc = &format->fmt_desc[(int) node->nod_arg[e_arg_number]];
965 + desc = &format->fmt_desc[(int)(IPTR) node->nod_arg[e_arg_number]];
967 impure->vlu_desc.dsc_address = (UCHAR *) request +
968 - message->nod_impure + (int) desc->dsc_address;
969 + message->nod_impure + (int)(IPTR) desc->dsc_address;
970 impure->vlu_desc.dsc_dtype = desc->dsc_dtype;
971 impure->vlu_desc.dsc_length = desc->dsc_length;
972 impure->vlu_desc.dsc_scale = desc->dsc_scale;
973 @@ -851,14 +851,14 @@
977 - request->req_rpb[(int)node->nod_arg[e_fld_stream]].rpb_record;
978 + request->req_rpb[(int)(IPTR)node->nod_arg[e_fld_stream]].rpb_record;
979 /* In order to "map a null to a default" value (in EVL_field()),
980 * the relation block is referenced.
981 * Reference: Bug 10116, 10424
983 - if (!EVL_field(request->req_rpb[(USHORT) node->nod_arg[e_fld_stream]].rpb_relation,
984 + if (!EVL_field(request->req_rpb[(USHORT)(IPTR) node->nod_arg[e_fld_stream]].rpb_relation,
986 - (USHORT) node->nod_arg[e_fld_id],
987 + (USHORT)(IPTR) node->nod_arg[e_fld_id],
990 request->req_flags |= req_null;
994 impure = (VLU) ((SCHAR *) request + node->nod_impure);
995 - extract_part = (ULONG) node->nod_arg[e_extract_part];
996 + extract_part = (ULONG)(IPTR) node->nod_arg[e_extract_part];
997 value = EVL_expr(tdbb, node->nod_arg[e_extract_value]);
999 impure->vlu_desc.dsc_dtype = dtype_short;
1000 @@ -1173,8 +1173,8 @@
1002 switch (node->nod_type) {
1003 case nod_gen_id: /* return a 32-bit generator value */
1004 - impure->vlu_misc.vlu_long = (SLONG) DPM_gen_id(tdbb,
1006 + impure->vlu_misc.vlu_long = (SLONG)(IPTR) DPM_gen_id(tdbb,
1011 @@ -1189,7 +1189,7 @@
1014 impure->vlu_misc.vlu_int64 = DPM_gen_id(tdbb,
1017 node->nod_arg[e_gen_id],
1019 MOV_get_int64(values[0],
1020 @@ -1383,7 +1383,7 @@
1024 - desc->dsc_address = record->rec_data + (int) desc->dsc_address;
1025 + desc->dsc_address = record->rec_data + (int)(IPTR) desc->dsc_address;
1027 if (TEST_NULL(record, id)) {
1028 desc->dsc_flags |= DSC_null;
1029 @@ -1725,9 +1725,9 @@
1031 from = (*ptr)->nod_arg[e_asgn_from];
1032 field = (*ptr)->nod_arg[e_asgn_to];
1033 - id = (USHORT) field->nod_arg[e_fld_id];
1034 + id = (USHORT)(IPTR) field->nod_arg[e_fld_id];
1036 - request->req_rpb[(int) field->nod_arg[e_fld_stream]].rpb_record;
1037 + request->req_rpb[(int)(IPTR) field->nod_arg[e_fld_stream]].rpb_record;
1038 impure = (VLUX) ((SCHAR *) request + from->nod_impure);
1039 switch (from->nod_type)
1041 @@ -3395,7 +3395,7 @@
1043 request = tdbb->tdbb_request;
1044 impure = (VLU) ((SCHAR *) request + node->nod_impure);
1045 - rpb = &request->req_rpb[(int) node->nod_arg[0]];
1046 + rpb = &request->req_rpb[(int)(IPTR) node->nod_arg[0]];
1047 relation = rpb->rpb_relation;
1049 /* Format dbkey as vector of relation id, record number */
1050 @@ -4500,7 +4500,7 @@
1052 request = tdbb->tdbb_request;
1053 impure = (VLU) ((SCHAR *) request + node->nod_impure);
1054 - rpb = &request->req_rpb[(int) node->nod_arg[0]];
1055 + rpb = &request->req_rpb[(int)(IPTR) node->nod_arg[0]];
1057 /* If the current transaction has updated the record, the record version
1058 * coming in from DSQL will have the original transaction # (or current
1059 diff -urNad firebird2-1.5.3.4870~/src/jrd/exe.cpp firebird2-1.5.3.4870/src/jrd/exe.cpp
1060 --- firebird2-1.5.3.4870~/src/jrd/exe.cpp 2006-02-01 23:07:02.000000000 +0200
1061 +++ firebird2-1.5.3.4870/src/jrd/exe.cpp 2006-02-01 23:07:04.000000000 +0200
1064 if (to->nod_type == nod_field)
1066 - SSHORT id = (USHORT) to->nod_arg[e_fld_id];
1067 - REC record = request->req_rpb[(int) to->nod_arg[e_fld_stream]].rpb_record;
1068 + SSHORT id = (USHORT)(IPTR) to->nod_arg[e_fld_id];
1069 + REC record = request->req_rpb[(int)(IPTR) to->nod_arg[e_fld_stream]].rpb_record;
1071 SET_NULL(record, id);
1074 message = request->req_message;
1075 format = (FMT) message->nod_arg[e_msg_format];
1077 - if (msg != (USHORT) message->nod_arg[e_msg_number])
1078 + if (msg != (USHORT)(IPTR) message->nod_arg[e_msg_number])
1079 ERR_post(gds_req_sync, 0);
1081 if (length != format->fmt_length)
1083 for (ptr = node->nod_arg, end = ptr + node->nod_count; ptr < end;
1085 message = (*ptr)->nod_arg[e_send_message];
1086 - if ((USHORT) message->nod_arg[e_msg_number] == msg) {
1087 + if ((USHORT)(IPTR) message->nod_arg[e_msg_number] == msg) {
1088 request->req_next = *ptr;
1093 format = (FMT) message->nod_arg[e_msg_format];
1095 - if (msg != (USHORT) message->nod_arg[e_msg_number])
1096 + if (msg != (USHORT)(IPTR) message->nod_arg[e_msg_number])
1097 ERR_post(gds_req_sync, 0);
1099 if (length != format->fmt_length)
1100 @@ -1049,7 +1049,7 @@
1101 desc = &format->fmt_desc[n];
1102 if (!desc->dsc_address)
1104 - p = record->rec_data + (SLONG) desc->dsc_address;
1105 + p = record->rec_data + (SLONG)(IPTR) desc->dsc_address;
1106 if (TEST_NULL(record, n))
1108 if (length = desc->dsc_length)
1109 @@ -1134,7 +1134,7 @@
1111 request = tdbb->tdbb_request;
1112 transaction = request->req_transaction;
1113 - rpb = &request->req_rpb[(int) node->nod_arg[e_erase_stream]];
1114 + rpb = &request->req_rpb[(int)(IPTR) node->nod_arg[e_erase_stream]];
1115 relation = rpb->rpb_relation;
1118 @@ -2015,7 +2015,7 @@
1119 case jrd_req::req_evaluate:
1120 if (transaction != dbb->dbb_sys_trans) {
1122 - UCHAR operation = (UCHAR) node->nod_arg[e_sav_operation];
1123 + UCHAR operation = (UCHAR)(IPTR) node->nod_arg[e_sav_operation];
1124 TEXT * node_savepoint_name = (TEXT*) node->nod_arg[e_sav_name];
1126 // Skip the savepoint created by EXE_start
1127 @@ -2328,7 +2328,7 @@
1130 case jrd_req::req_unwind:
1131 - if ((request->req_label == (USHORT) node->nod_arg[e_lbl_label]) &&
1132 + if ((request->req_label == (USHORT)(IPTR) node->nod_arg[e_lbl_label]) &&
1133 (request->req_flags & (req_leave | req_error_handler))) {
1134 request->req_flags &= ~req_leave;
1135 request->req_operation = jrd_req::req_return;
1136 @@ -2342,7 +2342,7 @@
1138 request->req_flags |= req_leave;
1139 request->req_operation = jrd_req::req_unwind;
1140 - request->req_label = (USHORT) node->nod_arg[0];
1141 + request->req_label = (USHORT)(IPTR) node->nod_arg[0];
1142 node = node->nod_parent;
1145 @@ -2652,7 +2652,7 @@
1148 desc = EVL_expr(tdbb, node->nod_arg[e_gen_value]);
1149 - (void) DPM_gen_id(tdbb, (SLONG) node->nod_arg[e_gen_id], 1,
1150 + (void) DPM_gen_id(tdbb, (SLONG)(IPTR) node->nod_arg[e_gen_id], 1,
1151 MOV_get_int64(desc, 0));
1152 request->req_operation = jrd_req::req_return;
1154 @@ -2664,7 +2664,7 @@
1157 desc = EVL_expr(tdbb, node->nod_arg[e_gen_value]);
1158 - (void) DPM_gen_id(tdbb, (SLONG) node->nod_arg[e_gen_id], 1,
1159 + (void) DPM_gen_id(tdbb, (SLONG)(IPTR) node->nod_arg[e_gen_id], 1,
1160 MOV_get_int64(desc, 0));
1161 request->req_operation = jrd_req::req_return;
1163 @@ -2794,11 +2794,11 @@
1164 transaction = request->req_transaction;
1165 impure = (STA) ((SCHAR *) request + node->nod_impure);
1167 - org_stream = (USHORT) node->nod_arg[e_mod_org_stream];
1168 + org_stream = (USHORT)(IPTR) node->nod_arg[e_mod_org_stream];
1169 org_rpb = &request->req_rpb[org_stream];
1170 relation = org_rpb->rpb_relation;
1172 - new_stream = (USHORT) node->nod_arg[e_mod_new_stream];
1173 + new_stream = (USHORT)(IPTR) node->nod_arg[e_mod_new_stream];
1174 new_rpb = &request->req_rpb[new_stream];
1177 @@ -3795,7 +3795,7 @@
1178 JRD_REQ request = tdbb->tdbb_request;
1179 JRD_TRA transaction = request->req_transaction;
1180 STA impure = (STA) ((SCHAR *) request + node->nod_impure);
1181 - SSHORT stream = (USHORT) node->nod_arg[e_sto_relation]->nod_arg[e_rel_stream];
1182 + SSHORT stream = (USHORT)(IPTR) node->nod_arg[e_sto_relation]->nod_arg[e_rel_stream];
1183 RPB* rpb = &request->req_rpb[stream];
1184 JRD_REL relation = rpb->rpb_relation;
1186 @@ -4201,8 +4201,8 @@
1188 if (node->nod_type == nod_field)
1190 - stream = (USHORT) node->nod_arg[e_fld_stream];
1191 - id = (USHORT) node->nod_arg[e_fld_id];
1192 + stream = (USHORT)(IPTR) node->nod_arg[e_fld_stream];
1193 + id = (USHORT)(IPTR) node->nod_arg[e_fld_id];
1194 relation = request->req_rpb[stream].rpb_relation;
1196 if ((vector = relation->rel_fields) &&
1197 diff -urNad firebird2-1.5.3.4870~/src/jrd/ext.cpp firebird2-1.5.3.4870/src/jrd/ext.cpp
1198 --- firebird2-1.5.3.4870~/src/jrd/ext.cpp 2006-02-01 23:07:02.000000000 +0200
1199 +++ firebird2-1.5.3.4870/src/jrd/ext.cpp 2006-02-01 23:07:04.000000000 +0200
1201 record = rpb->rpb_record;
1202 format = record->rec_format;
1204 - offset = (SSHORT) format->fmt_desc[0].dsc_address;
1205 + offset = (SSHORT)(IPTR) format->fmt_desc[0].dsc_address;
1206 p = record->rec_data + offset;
1207 l = record->rec_length - offset;
1211 if ( (literal = (LIT) field->fld_missing_value) ) {
1213 - desc.dsc_address = record->rec_data + (int) desc.dsc_address;
1214 + desc.dsc_address = record->rec_data + (int)(IPTR) desc.dsc_address;
1215 if (!MOV_compare(&literal->lit_desc, &desc))
1219 desc_ptr->dsc_length &&
1220 TEST_NULL(record, i))
1222 - p = record->rec_data + (int) desc_ptr->dsc_address;
1223 + p = record->rec_data + (int)(IPTR) desc_ptr->dsc_address;
1224 if ( (literal = (LIT) field->fld_missing_value) ) {
1226 desc.dsc_address = p;
1231 - offset = (USHORT) format->fmt_desc[0].dsc_address;
1232 + offset = (USHORT)(IPTR) format->fmt_desc[0].dsc_address;
1233 p = record->rec_data + offset;
1234 l = record->rec_length - offset;
1236 diff -urNad firebird2-1.5.3.4870~/src/jrd/gds.cpp firebird2-1.5.3.4870/src/jrd/gds.cpp
1237 --- firebird2-1.5.3.4870~/src/jrd/gds.cpp 2006-02-01 23:07:03.000000000 +0200
1238 +++ firebird2-1.5.3.4870/src/jrd/gds.cpp 2006-02-01 23:07:04.000000000 +0200
1239 @@ -2287,7 +2287,7 @@
1243 - if (!(result = ib_fdopen((int) result, "w+")))
1244 + if (!(result = ib_fdopen((int)(IPTR) result, "w+")))
1247 if (expanded_string)
1248 diff -urNad firebird2-1.5.3.4870~/src/jrd/idx.cpp firebird2-1.5.3.4870/src/jrd/idx.cpp
1249 --- firebird2-1.5.3.4870~/src/jrd/idx.cpp 2006-02-01 23:07:02.000000000 +0200
1250 +++ firebird2-1.5.3.4870/src/jrd/idx.cpp 2006-02-01 23:07:04.000000000 +0200
1251 @@ -1055,12 +1055,12 @@
1252 index_number < idx->idx_foreign_primaries->count();
1255 - (UCHAR) (*idx->idx_foreign_primaries)[index_number]) continue;
1256 + (UCHAR)(IPTR) (*idx->idx_foreign_primaries)[index_number]) continue;
1259 - (int) (*idx->idx_foreign_relations)[index_number]);
1260 + (int)(IPTR) (*idx->idx_foreign_relations)[index_number]);
1262 - (USHORT) (*idx->idx_foreign_indexes)[index_number];
1263 + (USHORT)(IPTR) (*idx->idx_foreign_indexes)[index_number];
1265 check_partner_index(tdbb, relation, record, transaction, idx,
1266 partner_relation, index_id)) )
1267 diff -urNad firebird2-1.5.3.4870~/src/jrd/inf.cpp firebird2-1.5.3.4870/src/jrd/inf.cpp
1268 --- firebird2-1.5.3.4870~/src/jrd/inf.cpp 2003-06-08 16:13:23.000000000 +0300
1269 +++ firebird2-1.5.3.4870/src/jrd/inf.cpp 2006-02-01 23:07:23.000000000 +0200
1271 node = request->req_message;
1272 if (item == gds_info_message_number)
1274 - INF_convert((SLONG) node->nod_arg[e_msg_number],
1275 + INF_convert((SLONG)(IPTR) node->nod_arg[e_msg_number],
1278 format = (FMT) node->nod_arg[e_msg_format];
1279 diff -urNad firebird2-1.5.3.4870~/src/jrd/met.epp firebird2-1.5.3.4870/src/jrd/met.epp
1280 --- firebird2-1.5.3.4870~/src/jrd/met.epp 2006-02-01 23:07:02.000000000 +0200
1281 +++ firebird2-1.5.3.4870/src/jrd/met.epp 2006-02-01 23:07:04.000000000 +0200
1283 if (desc->dsc_address)
1285 format->fmt_length =
1286 - (ULONG) desc->dsc_address + desc->dsc_length;
1287 + (ULONG)(IPTR) desc->dsc_address + desc->dsc_length;
1291 @@ -2133,13 +2133,13 @@
1292 index_number < references->frgn_reference_ids->count();
1295 - if (idx->idx_id == (UCHAR) (*references->frgn_reference_ids)
1296 + if (idx->idx_id == (UCHAR)(IPTR) (*references->frgn_reference_ids)
1299 idx->idx_primary_relation =
1300 - (USHORT) (*references->frgn_relations)[index_number];
1301 + (USHORT)(IPTR) (*references->frgn_relations)[index_number];
1302 idx->idx_primary_index =
1303 - (UCHAR) (*references->frgn_indexes)[index_number];
1304 + (UCHAR)(IPTR) (*references->frgn_indexes)[index_number];
1308 @@ -2155,7 +2155,7 @@
1309 index_number < dependencies->prim_reference_ids->count();
1312 - if (idx->idx_id == (UCHAR) (*dependencies->prim_reference_ids)
1313 + if (idx->idx_id == (UCHAR)(IPTR) (*dependencies->prim_reference_ids)
1316 idx->idx_foreign_primaries =
1317 @@ -3001,10 +3001,10 @@
1319 if ( (node = csb_->csb_rpt[i].csb_message) )
1321 - if ((int) node->nod_arg[e_msg_number] == 0)
1322 + if ((int)(IPTR) node->nod_arg[e_msg_number] == 0)
1324 procedure->prc_input_msg = node;
1325 - } else if ((int) node->nod_arg[e_msg_number] == 1)
1326 + } else if ((int)(IPTR) node->nod_arg[e_msg_number] == 1)
1328 procedure->prc_output_msg = node;
1330 @@ -4580,7 +4580,7 @@
1331 node = (JRD_NOD) LLS_POP(&csb->csb_dependencies);
1332 if (!node->nod_arg[e_dep_object])
1334 - dpdo_type = (SSHORT) node->nod_arg[e_dep_object_type];
1335 + dpdo_type = (SSHORT)(IPTR) node->nod_arg[e_dep_object_type];
1338 switch (dpdo_type) {
1339 @@ -4593,13 +4593,13 @@
1340 dpdo_name = (TEXT*) procedure->prc_name->str_data;
1343 - number = (SLONG) node->nod_arg [e_dep_object];
1344 + number = (SLONG)(IPTR) node->nod_arg [e_dep_object];
1345 MET_lookup_exception (tdbb, number, name, NULL);
1348 /* CVC: Here I'm going to track those pesky things named generators and UDFs. */
1350 - number = (SLONG) node->nod_arg [e_dep_object];
1351 + number = (SLONG)(IPTR) node->nod_arg [e_dep_object];
1352 MET_lookup_generator_id (tdbb, number, name);
1355 @@ -4617,7 +4617,7 @@
1357 if (field_node->nod_type == nod_field)
1359 - fld_id = (SSHORT) field_node->nod_arg[0];
1360 + fld_id = (SSHORT)(IPTR) field_node->nod_arg[0];
1363 if ( (field = MET_get_field(relation, fld_id)) )
1364 diff -urNad firebird2-1.5.3.4870~/src/jrd/sdl.cpp firebird2-1.5.3.4870/src/jrd/sdl.cpp
1365 --- firebird2-1.5.3.4870~/src/jrd/sdl.cpp 2006-02-01 23:07:03.000000000 +0200
1366 +++ firebird2-1.5.3.4870/src/jrd/sdl.cpp 2006-02-01 23:07:04.000000000 +0200
1369 element_desc = array_desc->ads_rpt[value].ads_desc;
1370 element_desc.dsc_address = (BLOB_PTR *) arg->sdl_arg_array +
1371 - (SLONG) element_desc.dsc_address +
1372 + (SLONG)(IPTR) element_desc.dsc_address +
1373 (array_desc->ads_element_length * subscript);
1375 /* Is this element within the array bounds? */
1377 --- Firebird.org/src/jrd/jrd.cpp~ 2004-11-17 12:41:16.000000000 +0100
1378 +++ Firebird/src/jrd/jrd.cpp 2006-03-28 18:47:32.722559750 +0200
1379 @@ -3877,9 +3877,9 @@
1381 if ( (node = csb->csb_rpt[i].csb_message) )
1383 - if ((int) node->nod_arg[e_msg_number] == 0) {
1384 + if ((int)(IPTR) node->nod_arg[e_msg_number] == 0) {
1386 - } else if ((int) node->nod_arg[e_msg_number] == 1) {
1387 + } else if ((int)(IPTR) node->nod_arg[e_msg_number] == 1) {
1391 --- Firebird.org/src/jrd/jrn.cpp.org 2006-03-28 18:52:47.582237250 +0200
1392 +++ Firebird/src/jrd/jrn.cpp 2006-03-28 18:54:06.667179750 +0200
1394 for (loop = 0; loop < 20; loop++) {
1396 journal->jrn_channel = (int *) socket(AF_INET, SOCK_STREAM, 0);
1397 - if ((int) journal->jrn_channel != -1)
1398 + if ((int)(IPTR) journal->jrn_channel != -1)
1400 if (!SYSCALL_INTERRUPTED(errno)) {
1401 error(status_vector, journal, errno, "socket");
1402 @@ -859,18 +859,18 @@
1406 - if (!connect((int) journal->jrn_channel, (sockaddr*)&address, sizeof(address)))
1407 + if (!connect((int)(IPTR) journal->jrn_channel, (sockaddr*)&address, sizeof(address)))
1413 - close((int) journal->jrn_channel);
1414 + close((int)(IPTR) journal->jrn_channel);
1417 if (!SYSCALL_INTERRUPTED(errno)) {
1419 - close((int) journal->jrn_channel);
1420 + close((int)(IPTR) journal->jrn_channel);
1422 *ret_jrn = (JRN) NULL;
1428 - close((int) journal->jrn_channel);
1429 + close((int)(IPTR) journal->jrn_channel);
1437 - close((int) journal->jrn_channel);
1438 + close((int)(IPTR) journal->jrn_channel);
1442 @@ -1056,7 +1056,7 @@
1443 with us, so keep trying until successful. */
1446 - l = recv((int) journal->jrn_channel, (char *) reply, sizeof(struct jrnr), 0);
1447 + l = recv((int)(IPTR) journal->jrn_channel, (char *) reply, sizeof(struct jrnr), 0);
1448 } while (l < 0 && SYSCALL_INTERRUPTED(errno));
1451 @@ -1095,7 +1095,7 @@
1452 **************************************/
1455 - if (close((int) journal->jrn_channel) < 0) {
1456 + if (close((int)(IPTR) journal->jrn_channel) < 0) {
1457 error(status_vector, journal, errno, "close");
1460 @@ -1166,7 +1166,7 @@
1461 with us, so keep trying until successful. */
1464 - l = send((int) journal->jrn_channel, (char *) buffer, (int) length, 0);
1465 + l = send((int)(IPTR) journal->jrn_channel, (char *) buffer, (int) length, 0);
1466 } while (l < 0 && SYSCALL_INTERRUPTED(errno));
1469 --- Firebird.org/src/jrd/nav.cpp.org 2006-03-28 19:04:53.447601000 +0200
1470 +++ Firebird/src/jrd/nav.cpp 2006-03-28 19:08:20.452538000 +0200
1475 - (IDX *) ((SCHAR *) impure + (SLONG) rsb->rsb_arg[RSB_NAV_idx_offset]);
1476 + (IDX *) ((SCHAR *) impure + (SLONG)(IPTR) rsb->rsb_arg[RSB_NAV_idx_offset]);
1478 /* The bitmap is only valid when we are continuing on in one
1479 direction. It is of no help when we change direction,
1480 @@ -521,12 +521,12 @@
1481 #ifdef SCROLLABLE_CURSORS
1483 (impure->irsb_nav_data +
1484 - (2 * (SLONG) rsb->rsb_arg[RSB_NAV_key_length])),
1485 + (2 * (SLONG)(IPTR) rsb->rsb_arg[RSB_NAV_key_length])),
1486 upper.key_data, upper.key_length);
1489 (impure->irsb_nav_data +
1490 - (SLONG) rsb->rsb_arg[RSB_NAV_key_length]), upper.key_data,
1491 + (SLONG)(IPTR) rsb->rsb_arg[RSB_NAV_key_length]), upper.key_data,
1496 lower.key_length = impure->irsb_nav_lower_length;
1498 (impure->irsb_nav_data +
1499 - (SLONG) rsb->rsb_arg[RSB_NAV_key_length]), lower.key_data,
1500 + (SLONG)(IPTR) rsb->rsb_arg[RSB_NAV_key_length]), lower.key_data,
1504 @@ -1404,7 +1404,7 @@
1505 tdbb = GET_THREAD_DATA;
1508 - (IDX *) ((SCHAR *) impure + (SLONG) rsb->rsb_arg[RSB_NAV_idx_offset]);
1509 + (IDX *) ((SCHAR *) impure + (SLONG)(IPTR) rsb->rsb_arg[RSB_NAV_idx_offset]);
1510 page = (BTR) CCH_FETCH(tdbb, window, LCK_read, pag_index);
1512 /* the outer loop goes through all the sibling pages
1513 @@ -1619,7 +1619,7 @@
1514 tdbb = GET_THREAD_DATA;
1515 request = tdbb->tdbb_request;
1517 - (IDX *) ((SCHAR *) impure + (SLONG) rsb->rsb_arg[RSB_NAV_idx_offset]);
1518 + (IDX *) ((SCHAR *) impure + (SLONG)(IPTR) rsb->rsb_arg[RSB_NAV_idx_offset]);
1522 @@ -1656,7 +1656,7 @@
1525 struct idx *>((SCHAR *) impure +
1526 - (SLONG) rsb->rsb_arg[RSB_NAV_idx_offset]),
1527 + (SLONG)(IPTR) rsb->rsb_arg[RSB_NAV_idx_offset]),
1530 if (compare_keys(idx, key->key_data, key->key_length, &value, FALSE)) {
1531 @@ -1757,7 +1757,7 @@
1532 retrieval_node = (JRD_NOD) rsb->rsb_arg[RSB_NAV_index];
1533 retrieval = (IRB) retrieval_node->nod_arg[e_idx_retrieval];
1535 - (IDX *) ((SCHAR *) impure + (SLONG) rsb->rsb_arg[RSB_NAV_idx_offset]);
1536 + (IDX *) ((SCHAR *) impure + (SLONG)(IPTR) rsb->rsb_arg[RSB_NAV_idx_offset]);
1538 BTR_find_page(tdbb, retrieval, window, idx, &lower, &upper,
1539 (direction == RSE_get_backward));
1540 @@ -1770,7 +1770,7 @@
1541 impure->irsb_nav_lower_length = lower.key_length;
1542 MOVE_FAST(lower.key_data,
1543 (impure->irsb_nav_data +
1544 - (SLONG) rsb->rsb_arg[RSB_NAV_key_length]),
1545 + (SLONG)(IPTR) rsb->rsb_arg[RSB_NAV_key_length]),
1549 @@ -1778,7 +1778,7 @@
1550 impure->irsb_nav_upper_length = upper.key_length;
1551 MOVE_FAST(upper.key_data,
1552 (impure->irsb_nav_data +
1553 - (2 * (SLONG) rsb->rsb_arg[RSB_NAV_key_length])),
1554 + (2 * (SLONG)(IPTR) rsb->rsb_arg[RSB_NAV_key_length])),
1558 @@ -1802,7 +1802,7 @@
1559 impure->irsb_nav_upper_length = upper.key_length;
1560 MOVE_FAST(upper.key_data,
1561 (impure->irsb_nav_data +
1562 - (SLONG) rsb->rsb_arg[RSB_NAV_key_length]),
1563 + (SLONG)(IPTR) rsb->rsb_arg[RSB_NAV_key_length]),
1566 if (retrieval->irb_lower_count)
1567 @@ -1813,7 +1813,7 @@
1568 impure->irsb_nav_lower_length = lower.key_length;
1569 MOVE_FAST(lower.key_data,
1570 (impure->irsb_nav_data +
1571 - (SLONG) rsb->rsb_arg[RSB_NAV_key_length]),
1572 + (SLONG)(IPTR) rsb->rsb_arg[RSB_NAV_key_length]),
1575 if (retrieval->irb_upper_count)
1576 --- Firebird.org/src/jrd/opt.cpp.org 2006-03-28 19:12:44.949068000 +0200
1577 +++ Firebird/src/jrd/opt.cpp 2006-03-28 19:21:54.587418250 +0200
1580 if (node->nod_type != nod_rse)
1582 - stream = (USHORT) node->nod_arg[STREAM_INDEX(node)];
1583 + stream = (USHORT)(IPTR) node->nod_arg[STREAM_INDEX(node)];
1584 assert(stream <= MAX_UCHAR);
1585 assert(beds[0] < MAX_STREAMS && beds[0] < MAX_UCHAR);
1586 beds[++beds[0]] = (UCHAR) stream;
1588 (USHORT) (key_streams[0] - i));
1589 assert(local_streams[0] < MAX_STREAMS && local_streams[0] < MAX_UCHAR);
1590 local_streams[++local_streams[0]] =
1591 - (UCHAR) node->nod_arg[e_uni_stream];
1592 + (UCHAR)(IPTR) node->nod_arg[e_uni_stream];
1594 else if (node->nod_type == nod_aggregate) {
1595 assert((int)node->nod_arg[e_agg_stream] <= MAX_STREAMS);
1596 @@ -408,13 +408,13 @@
1597 rsb = gen_aggregate(tdbb, opt_, node);
1598 assert(local_streams[0] < MAX_STREAMS && local_streams[0] < MAX_UCHAR);
1599 local_streams[++local_streams[0]] =
1600 - (UCHAR) node->nod_arg[e_agg_stream];
1601 + (UCHAR)(IPTR) node->nod_arg[e_agg_stream];
1603 else if (node->nod_type == nod_procedure) {
1604 rsb = gen_procedure(tdbb, opt_, node);
1605 assert(local_streams[0] < MAX_STREAMS && local_streams[0] < MAX_UCHAR);
1606 local_streams[++local_streams[0]] =
1607 - (UCHAR) node->nod_arg[e_prc_stream];
1608 + (UCHAR)(IPTR) node->nod_arg[e_prc_stream];
1610 else if (node->nod_type == nod_rse) {
1611 compute_rse_streams(csb, (RSE) node, beds);
1614 /* Make sure we have the correct stream */
1616 - if ((USHORT) dbkey->nod_arg[0] != stream)
1617 + if ((USHORT)(IPTR) dbkey->nod_arg[0] != stream)
1620 /* If this is a dbkey for the appropriate stream, it's invertable */
1621 @@ -1769,7 +1769,7 @@
1622 switch (node->nod_type) {
1625 - n = (USHORT) node->nod_arg[e_fld_stream];
1626 + n = (USHORT)(IPTR) node->nod_arg[e_fld_stream];
1628 if (allowOnlyCurrentStream) {
1630 @@ -1795,7 +1795,7 @@
1634 - n = (USHORT) node->nod_arg[0];
1635 + n = (USHORT)(IPTR) node->nod_arg[0];
1637 if (allowOnlyCurrentStream) {
1639 @@ -1866,7 +1866,7 @@
1641 for (ptr = rse->rse_relation, end = ptr + rse->rse_count; ptr < end; ptr++) {
1642 if ((*ptr)->nod_type != nod_rse) {
1643 - n = (USHORT) (*ptr)->nod_arg[STREAM_INDEX((*ptr))];
1644 + n = (USHORT)(IPTR) (*ptr)->nod_arg[STREAM_INDEX((*ptr))];
1645 csb->csb_rpt[n].csb_flags |= csb_active;
1648 @@ -1903,7 +1903,7 @@
1650 if ((*ptr)->nod_type != nod_rse)
1652 - n = (USHORT) (*ptr)->nod_arg[STREAM_INDEX((*ptr))];
1653 + n = (USHORT)(IPTR) (*ptr)->nod_arg[STREAM_INDEX((*ptr))];
1654 csb->csb_rpt[n].csb_flags &= ~csb_active;
1657 @@ -1944,12 +1944,12 @@
1659 switch (node->nod_type) {
1661 - n = (USHORT) node->nod_arg[e_fld_stream];
1662 + n = (USHORT)(IPTR) node->nod_arg[e_fld_stream];
1663 SET_DEP_BIT(dependencies, n);
1667 - n = (USHORT) node->nod_arg[0];
1668 + n = (USHORT)(IPTR) node->nod_arg[0];
1669 SET_DEP_BIT(dependencies, n);
1672 @@ -2005,7 +2005,7 @@
1674 for (ptr = rse->rse_relation, end = ptr + rse->rse_count; ptr < end; ptr++) {
1675 if ((*ptr)->nod_type != nod_rse) {
1676 - n = (USHORT) (*ptr)->nod_arg[STREAM_INDEX((*ptr))];
1677 + n = (USHORT)(IPTR) (*ptr)->nod_arg[STREAM_INDEX((*ptr))];
1678 CLEAR_DEP_BIT(dependencies, n);
1681 @@ -2033,7 +2033,7 @@
1683 if (node->nod_type == nod_relation) {
1684 assert(streams[0] < MAX_STREAMS && streams[0] < MAX_UCHAR);
1685 - streams[++streams[0]] = (UCHAR) node->nod_arg[e_rel_stream];
1686 + streams[++streams[0]] = (UCHAR)(IPTR) node->nod_arg[e_rel_stream];
1688 else if (node->nod_type == nod_union) {
1689 clauses = node->nod_arg[e_uni_clauses];
1690 @@ -2073,7 +2073,7 @@
1692 if (node->nod_type != nod_rse) {
1693 assert(streams[0] < MAX_STREAMS && streams[0] < MAX_UCHAR);
1694 - streams[++streams[0]] = (UCHAR) node->nod_arg[STREAM_INDEX(node)];
1695 + streams[++streams[0]] = (UCHAR)(IPTR) node->nod_arg[STREAM_INDEX(node)];
1698 compute_rse_streams(csb, (RSE) node, streams);
1699 @@ -3371,7 +3371,7 @@
1700 JRD_NOD dbkey_temp, *ptr, *end;
1701 DEV_BLKCHK(dbkey, type_nod);
1702 if (dbkey->nod_type == nod_dbkey) {
1703 - if ((USHORT) dbkey->nod_arg[0] == stream)
1704 + if ((USHORT)(IPTR) dbkey->nod_arg[0] == stream)
1707 *position = *position + 1;
1708 @@ -3632,7 +3632,7 @@
1711 relation_node = plan_node->nod_arg[e_retrieve_relation];
1712 - temp[temp[0]] = (UCHAR) relation_node->nod_arg[e_rel_stream];
1713 + temp[temp[0]] = (UCHAR)(IPTR) relation_node->nod_arg[e_rel_stream];
1716 // just because the user specified a join does not mean that
1717 @@ -3806,7 +3806,7 @@
1718 rsb->rsb_type = rsb_aggregate;
1719 assert((int)node->nod_arg[e_agg_stream] <= MAX_STREAMS);
1720 assert((int)node->nod_arg[e_agg_stream] <= MAX_UCHAR);
1721 - rsb->rsb_stream = (UCHAR) node->nod_arg[e_agg_stream];
1722 + rsb->rsb_stream = (UCHAR)(IPTR) node->nod_arg[e_agg_stream];
1723 rsb->rsb_format = csb->csb_rpt[rsb->rsb_stream].csb_format;
1724 rsb->rsb_next = OPT_compile(tdbb, csb, rse, NULL);
1725 rsb->rsb_arg[0] = (RSB) node;
1726 @@ -4170,8 +4170,8 @@
1727 idx->idx_rpt; ptr < end; ptr++, idx_tail++) {
1729 if (node->nod_type != nod_field
1730 - || (USHORT) node->nod_arg[e_fld_stream] != stream
1731 - || (USHORT) node->nod_arg[e_fld_id] != idx_tail->idx_field
1732 + || (USHORT)(IPTR) node->nod_arg[e_fld_stream] != stream
1733 + || (USHORT)(IPTR) node->nod_arg[e_fld_id] != idx_tail->idx_field
1734 || ptr[2*sort->nod_count] /* do not use index if NULLS FIRST is used */
1735 #ifdef SCROLLABLE_CURSORS
1737 @@ -4331,7 +4331,7 @@
1739 stream_ptr[i]->stream_rsb = NULL;
1740 stream_ptr[i]->stream_num =
1741 - (USHORT) node->nod_arg[STREAM_INDEX(node)];
1742 + (USHORT)(IPTR) node->nod_arg[STREAM_INDEX(node)];
1746 @@ -4409,10 +4409,10 @@
1749 procedure = MET_lookup_procedure_id(tdbb,
1750 - (SSHORT)node->nod_arg[e_prc_procedure], FALSE, FALSE, 0);
1751 + (SSHORT)(IPTR)node->nod_arg[e_prc_procedure], FALSE, FALSE, 0);
1752 rsb = FB_NEW_RPT(*tdbb->tdbb_default, RSB_PRC_count) Rsb();
1753 rsb->rsb_type = rsb_procedure;
1754 - rsb->rsb_stream = (UCHAR) node->nod_arg[e_prc_stream];
1755 + rsb->rsb_stream = (UCHAR)(IPTR) node->nod_arg[e_prc_stream];
1756 rsb->rsb_procedure = procedure;
1757 rsb->rsb_format = procedure->prc_format;
1758 rsb->rsb_impure = CMP_impure(csb, sizeof(struct irsb_procedure));
1759 @@ -5025,8 +5025,8 @@
1760 for (node_ptr = sort->nod_arg; node_ptr < end_node; node_ptr++) {
1762 if (node->nod_type == nod_field
1763 - && (USHORT) node->nod_arg[e_fld_stream] == *ptr
1764 - && (USHORT) node->nod_arg[e_fld_id] == id) {
1765 + && (USHORT)(IPTR) node->nod_arg[e_fld_stream] == *ptr
1766 + && (USHORT)(IPTR) node->nod_arg[e_fld_id] == id) {
1768 CMP_get_desc(tdbb, csb, node, desc);
1769 /* International type text has a computed key */
1770 @@ -5123,8 +5123,8 @@
1771 map_item->smb_desc.dsc_address = (UCHAR *) map_length;
1772 map_length += desc->dsc_length;
1773 if (node->nod_type == nod_field) {
1774 - map_item->smb_stream = (USHORT) node->nod_arg[e_fld_stream];
1775 - map_item->smb_field_id = (USHORT) node->nod_arg[e_fld_id];
1776 + map_item->smb_stream = (USHORT)(IPTR) node->nod_arg[e_fld_stream];
1777 + map_item->smb_field_id = (USHORT)(IPTR) node->nod_arg[e_fld_id];
1781 @@ -5136,8 +5136,8 @@
1782 field has already been mentioned as a sort key, don't bother to repeat
1784 while (stream_stack) {
1785 - id = (USHORT) LLS_POP(&id_stack);
1786 - stream = (USHORT) LLS_POP(&stream_stack);
1787 + id = (USHORT)(IPTR) LLS_POP(&id_stack);
1788 + stream = (USHORT)(IPTR) LLS_POP(&stream_stack);
1789 format = CMP_format(tdbb, csb, stream);
1790 desc = &format->fmt_desc[id];
1791 if (id >= format->fmt_count || desc->dsc_length == 0)
1792 @@ -5466,7 +5466,7 @@
1793 rsb = FB_NEW_RPT(*tdbb->tdbb_default, count + nstreams + 1) Rsb();
1794 rsb->rsb_type = rsb_union;
1795 rsb->rsb_count = count;
1796 - rsb->rsb_stream = (UCHAR) union_node->nod_arg[e_uni_stream];
1797 + rsb->rsb_stream = (UCHAR)(IPTR) union_node->nod_arg[e_uni_stream];
1798 rsb->rsb_format = csb->csb_rpt[rsb->rsb_stream].csb_format;
1799 rsb->rsb_impure = CMP_impure(csb, sizeof(struct irsb));
1800 rsb_ptr = rsb->rsb_arg;
1801 @@ -6008,8 +6008,8 @@
1802 field = boolean->nod_arg[0];
1803 if (field->nod_type != nod_field)
1805 - if ((USHORT) field->nod_arg[e_fld_stream] != stream ||
1806 - (USHORT) field->nod_arg[e_fld_id] != idx->idx_rpt[0].idx_field)
1807 + if ((USHORT)(IPTR) field->nod_arg[e_fld_stream] != stream ||
1808 + (USHORT)(IPTR) field->nod_arg[e_fld_id] != idx->idx_rpt[0].idx_field)
1810 node = make_index_node(tdbb, relation, opt->opt_csb, idx);
1811 retrieval = (IRB) node->nod_arg[e_idx_retrieval];
1812 @@ -6077,8 +6077,8 @@
1816 - if ((USHORT) field->nod_arg[e_fld_stream] != stream ||
1817 - (USHORT) field->nod_arg[e_fld_id] != idx->idx_rpt[0].idx_field
1818 + if ((USHORT)(IPTR) field->nod_arg[e_fld_stream] != stream ||
1819 + (USHORT)(IPTR) field->nod_arg[e_fld_id] != idx->idx_rpt[0].idx_field
1820 || !(idx->idx_rpt[0].idx_itype == idx_string
1821 || idx->idx_rpt[0].idx_itype == idx_byte_array
1822 || idx->idx_rpt[0].idx_itype == idx_metadata
1823 @@ -6176,10 +6176,10 @@
1825 for (arg = access_type->nod_arg, end = arg + plan_count;
1826 arg < end; arg += 3) {
1827 - if (relation_id != (SSHORT) * arg)
1828 + if (relation_id != (SSHORT)(IPTR) * arg)
1829 /* index %s cannot be used in the specified plan */
1830 ERR_post(gds_index_unused, gds_arg_string, *(arg + 2), 0);
1831 - if (idx->idx_id == (USHORT) * (arg + 1))
1832 + if (idx->idx_id == (USHORT)(IPTR) * (arg + 1))
1833 if (access_type->nod_type == nod_navigational)
1834 idx->idx_runtime_flags |= idx_plan_navigate;
1835 else /* nod_indices */
1836 @@ -6251,13 +6251,13 @@
1837 If left side is still not a field, give up */
1839 if (match->nod_type != nod_field ||
1840 - (USHORT) match->nod_arg[e_fld_stream] != stream ||
1841 + (USHORT)(IPTR) match->nod_arg[e_fld_stream] != stream ||
1842 !computable(opt->opt_csb, value, stream, true, false))
1845 value = boolean->nod_arg[0];
1846 if (match->nod_type != nod_field ||
1847 - (USHORT) match->nod_arg[e_fld_stream] != stream ||
1848 + (USHORT)(IPTR) match->nod_arg[e_fld_stream] != stream ||
1849 !computable(opt->opt_csb, value, stream, true, false))
1852 @@ -6276,7 +6276,7 @@
1853 #ifdef EXPRESSION_INDICES
1854 (idx->idx_expression ||
1856 - ((USHORT) match->nod_arg[e_fld_id] == idx->idx_rpt[i].idx_field)
1857 + ((USHORT)(IPTR) match->nod_arg[e_fld_id] == idx->idx_rpt[i].idx_field)
1858 #ifdef EXPRESSION_INDICES
1861 @@ -6664,7 +6664,7 @@
1863 for (streams = river->riv_streams, end =
1864 streams + river->riv_count; streams < end; streams++)
1865 - if ((USHORT) node->nod_arg[e_fld_stream] == *streams)
1866 + if ((USHORT)(IPTR) node->nod_arg[e_fld_stream] == *streams)
1870 @@ -6861,7 +6861,7 @@
1873 if (node->nod_type != nod_rse) {
1874 - stream = (USHORT) node->nod_arg[STREAM_INDEX(node)];
1875 + stream = (USHORT)(IPTR) node->nod_arg[STREAM_INDEX(node)];
1876 csb->csb_rpt[stream].csb_flags &= ~csb_active;
1879 --- Firebird.org/src/jrd/par.cpp.org 2006-03-28 19:40:36.909559000 +0200
1880 +++ Firebird/src/jrd/par.cpp 2006-03-28 19:40:47.922247250 +0200
1881 @@ -2518,7 +2518,7 @@
1882 node->nod_arg[e_agg_rse] = parse(tdbb, csb, TYPE_RSE);
1883 node->nod_arg[e_agg_group] = parse(tdbb, csb, OTHER);
1884 node->nod_arg[e_agg_map] =
1885 - par_map(tdbb, csb, (USHORT) node->nod_arg[e_agg_stream]);
1886 + par_map(tdbb, csb, (USHORT)(IPTR) node->nod_arg[e_agg_stream]);
1890 --- Firebird.org/src/jrd/rse.cpp.org 2006-03-28 19:44:31.600226250 +0200
1891 +++ Firebird/src/jrd/rse.cpp 2006-03-28 19:46:40.508282500 +0200
1893 /* Initialize the record number of each stream in the union */
1895 ptr = &rsb->rsb_arg[rsb->rsb_count];
1896 - for (end = ptr + (USHORT) * ptr; ++ptr <= end;)
1897 - request->req_rpb[(USHORT) * ptr].rpb_number = -1;
1898 + for (end = ptr + (USHORT)(IPTR) * ptr; ++ptr <= end;)
1899 + request->req_rpb[(USHORT)(IPTR) * ptr].rpb_number = -1;
1901 rsb = rsb->rsb_arg[0];
1903 @@ -2151,7 +2151,7 @@
1906 desc = msg_format->fmt_desc[msg_format->fmt_count - 1];
1907 - desc.dsc_address = (UCHAR *) (om + (int) desc.dsc_address);
1908 + desc.dsc_address = (UCHAR *) (om + (int)(IPTR) desc.dsc_address);
1909 eos_desc.dsc_dtype = dtype_short;
1910 eos_desc.dsc_scale = 0;
1911 eos_desc.dsc_length = sizeof(SSHORT);
1912 @@ -2914,7 +2914,7 @@
1913 request = tdbb->tdbb_request;
1914 stack = (LLS) rsb->rsb_arg[streams];
1915 for (; stack; stack = stack->lls_next) {
1916 - rpb = &request->req_rpb[(USHORT) stack->lls_object];
1917 + rpb = &request->req_rpb[(USHORT)(IPTR) stack->lls_object];
1919 /* Make sure a record block has been allocated. If there isn't
1920 one, first find the format, then allocate the record block */
1921 @@ -2959,7 +2959,7 @@
1922 for (item = map->smb_rpt; item < end_item; item++) {
1923 flag = *(data + item->smb_flag_offset);
1924 from = item->smb_desc;
1925 - from.dsc_address = data + (ULONG) from.dsc_address;
1926 + from.dsc_address = data + (ULONG)(IPTR) from.dsc_address;
1927 if ((node = item->smb_node) && node->nod_type != nod_field)
1930 @@ -2972,7 +2972,7 @@
1931 list that contains the data to send back
1933 if (IS_INTL_DATA(&item->smb_desc) &&
1934 - (USHORT) item->smb_desc.dsc_address <
1935 + (USHORT)(IPTR) item->smb_desc.dsc_address <
1936 map->smb_key_length * sizeof(ULONG)) continue;
1938 rpb = &request->req_rpb[item->smb_stream];
1939 @@ -3211,7 +3211,7 @@
1940 end_item = map->smb_rpt + map->smb_count;
1941 for (item = map->smb_rpt; item < end_item; item++) {
1942 to = item->smb_desc;
1943 - to.dsc_address = data + (ULONG) to.dsc_address;
1944 + to.dsc_address = data + (ULONG)(IPTR) to.dsc_address;
1946 if (item->smb_node) {
1947 from = EVL_expr(tdbb, item->smb_node);
1948 @@ -3238,7 +3238,7 @@
1949 the sort record, then want to sort by language dependent order */
1951 if (IS_INTL_DATA(&item->smb_desc) &&
1952 - (USHORT) item->smb_desc.dsc_address <
1953 + (USHORT)(IPTR) item->smb_desc.dsc_address <
1954 map->smb_key_length * sizeof(ULONG)) {
1955 INTL_string_to_key(tdbb, INTL_INDEX_TYPE(&item->smb_desc),
1957 @@ -3301,12 +3301,12 @@
1958 desc2.dsc_flags = 0;
1959 desc2.dsc_address = (UCHAR *) & indicator;
1961 - desc1.dsc_address = msg + (int) flag_desc->dsc_address;
1962 + desc1.dsc_address = msg + (int)(IPTR) flag_desc->dsc_address;
1963 MOV_move(&desc1, &desc2);
1965 SET_NULL(record, to_id);
1966 l = to_desc->dsc_length;
1967 - p = record->rec_data + (int) to_desc->dsc_address;
1968 + p = record->rec_data + (int)(IPTR) to_desc->dsc_address;
1969 switch (to_desc->dsc_dtype) {
1971 /* YYY - not necessarily the right thing to do */
1972 @@ -3336,9 +3336,9 @@
1974 CLEAR_NULL(record, to_id);
1976 - desc1.dsc_address = msg + (int) desc1.dsc_address;
1977 + desc1.dsc_address = msg + (int)(IPTR) desc1.dsc_address;
1979 - desc2.dsc_address = record->rec_data + (int) desc2.dsc_address;
1980 + desc2.dsc_address = record->rec_data + (int)(IPTR) desc2.dsc_address;
1981 if (!DSC_EQUIV((&desc1), (&desc2)))
1982 MOV_move(&desc1, &desc2);
1984 @@ -3817,7 +3817,7 @@
1985 if (!sfb_->sfb_file_name) {
1986 TEXT file_name[128];
1988 - sfb_->sfb_file = (int) gds__temp_file(FALSE, SCRATCH, file_name);
1989 + sfb_->sfb_file = (int)(IPTR) gds__temp_file(FALSE, SCRATCH, file_name);
1990 if (sfb_->sfb_file == -1)
1991 SORT_error(tdbb->tdbb_status_vector, sfb_, "open", isc_io_error,
1993 --- Firebird.org/src/jrd/sort.cpp~ 2003-12-24 14:02:01.000000000 +0100
1994 +++ Firebird/src/jrd/sort.cpp 2006-03-28 19:57:36.897304250 +0200
1995 @@ -1788,7 +1788,7 @@
1996 /* Create a scratch file */
1999 - (int) gds__temp_file(FALSE, SCRATCH, file_name,
2000 + (int)(IPTR) gds__temp_file(FALSE, SCRATCH, file_name,
2001 sfb->sfb_dls->dls_directory, TRUE);
2003 /* allocate the file name even if the file is not open,