1 diff -ur firebird-1.5.3.4870-orig/src/burp/burp.cpp firebird-1.5.3.4870/src/burp/burp.cpp
2 --- firebird-1.5.3.4870-orig/src/burp/burp.cpp 2006-03-17 01:39:04.000000000 -0500
3 +++ firebird-1.5.3.4870/src/burp/burp.cpp 2006-03-17 01:32:16.000000000 -0500
6 signal(SIGPIPE, SIG_IGN);
8 - fil->fil_fd = reinterpret_cast<DESC>(GBAK_STDOUT_DESC);
9 + fil->fil_fd = GBAK_STDOUT_DESC();
15 tdgbl->action->act_action = ACT_restore;
16 if (!strcmp(fil->fil_name, "stdin")) {
17 - fil->fil_fd = reinterpret_cast<DESC>(GBAK_STDIN_DESC);
18 + fil->fil_fd = GBAK_STDIN_DESC();
19 tdgbl->file_desc = fil->fil_fd;
20 tdgbl->gbl_sw_files = fil->fil_next;
22 diff -ur firebird-1.5.3.4870-orig/src/burp/std_desc.h firebird-1.5.3.4870/src/burp/std_desc.h
23 --- firebird-1.5.3.4870-orig/src/burp/std_desc.h 2006-03-17 01:39:04.000000000 -0500
24 +++ firebird-1.5.3.4870/src/burp/std_desc.h 2006-03-17 01:41:38.000000000 -0500
31 -#define GBAK_STDIN_DESC GetStdHandle(STD_INPUT_HANDLE) /* standart input file descriptor */
32 -#define GBAK_STDOUT_DESC GetStdHandle(STD_OUTPUT_HANDLE) /* standart output file descriptor */
36 +static inline DESC GBAK_STDIN_DESC(void)
38 + return GetStdHandle(STD_INPUT_HANDLE); // standard input file descriptor
40 +static inline DESC GBAK_STDOUT_DESC(void)
42 + return GetStdHandle(STD_OUTPUT_HANDLE); // standard output file descriptor
46 -#define GBAK_STDIN_DESC (int)0 /* standart input file descriptor */
47 -#define GBAK_STDOUT_DESC (int)1 /* standart output file descriptor */
51 +static inline DESC GBAK_STDIN_DESC(void)
53 + return 0; // standard input file descriptor
55 +static inline DESC GBAK_STDOUT_DESC(void)
57 + return 1; // standard output file descriptor
62 #endif //GBAK_STD_DESC_H
63 diff -ur firebird-1.5.3.4870-orig/src/common/classes/alloc.h firebird-1.5.3.4870/src/common/classes/alloc.h
64 --- firebird-1.5.3.4870-orig/src/common/classes/alloc.h 2006-03-17 01:39:04.000000000 -0500
65 +++ firebird-1.5.3.4870/src/common/classes/alloc.h 2006-03-17 01:32:16.000000000 -0500
68 void operator delete[](void* mem) throw();
71 +#define STATIC_NEW static
76 #ifdef DEBUG_GDS_ALLOC
77 -static inline void* operator new(size_t s, Firebird::MemoryPool& pool, char* file, int line) {
78 +STATIC_NEW inline void* operator new(size_t s, Firebird::MemoryPool& pool, char* file, int line) {
79 return pool.allocate(s, 0, file, line);
80 // return pool.calloc(s, 0, file, line);
82 -static inline void* operator new[](size_t s, Firebird::MemoryPool& pool, char* file, int line) {
83 +STATIC_NEW inline void* operator new[](size_t s, Firebird::MemoryPool& pool, char* file, int line) {
84 return pool.allocate(s, 0, file, line);
85 // return pool.calloc(s, 0, file, line);
87 #define FB_NEW(pool) new(pool,__FILE__,__LINE__)
88 #define FB_NEW_RPT(pool,count) new(pool,count,__FILE__,__LINE__)
90 -static inline void* operator new(size_t s, Firebird::MemoryPool& pool) {
91 +STATIC_NEW inline void* operator new(size_t s, Firebird::MemoryPool& pool) {
92 return pool.allocate(s);
93 // return pool.calloc(s);
95 -static inline void* operator new[](size_t s, Firebird::MemoryPool& pool) {
96 +STATIC_NEW inline void* operator new[](size_t s, Firebird::MemoryPool& pool) {
97 return pool.allocate(s);
98 // return pool.calloc(s);
100 diff -ur firebird-1.5.3.4870-orig/src/common/config/config.cpp firebird-1.5.3.4870/src/common/config/config.cpp
101 --- firebird-1.5.3.4870-orig/src/common/config/config.cpp 2006-03-17 01:39:04.000000000 -0500
102 +++ firebird-1.5.3.4870/src/common/config/config.cpp 2006-03-17 01:32:16.000000000 -0500
103 @@ -261,12 +261,12 @@
105 int Config::getSortMemBlockSize()
107 - return (int) sysConfig.values[KEY_SORT_MEM_BLOCK_SIZE];
108 + return (int)(IPTR) sysConfig.values[KEY_SORT_MEM_BLOCK_SIZE];
111 int Config::getSortMemUpperLimit()
113 - return (int) sysConfig.values[KEY_SORT_MEM_UPPER_LIMIT];
114 + return (int)(IPTR) sysConfig.values[KEY_SORT_MEM_UPPER_LIMIT];
117 bool Config::getRemoteFileOpenAbility()
118 @@ -276,12 +276,12 @@
120 int Config::getGuardianOption()
122 - return (int) sysConfig.values[KEY_GUARDIAN_OPTION];
123 + return (int)(IPTR) sysConfig.values[KEY_GUARDIAN_OPTION];
126 int Config::getCpuAffinityMask()
128 - return (int) sysConfig.values[KEY_CPU_AFFINITY_MASK];
129 + return (int)(IPTR) sysConfig.values[KEY_CPU_AFFINITY_MASK];
132 bool Config::getOldParameterOrdering()
135 int Config::getTcpRemoteBufferSize()
137 - return (int) sysConfig.values[KEY_TCP_REMOTE_BUFFER_SIZE];
138 + return (int)(IPTR) sysConfig.values[KEY_TCP_REMOTE_BUFFER_SIZE];
141 bool Config::getTcpNoNagle()
142 @@ -301,37 +301,37 @@
144 int Config::getIpcMapSize()
146 - return (int) sysConfig.values[KEY_IPC_MAP_SIZE];
147 + return (int)(IPTR) sysConfig.values[KEY_IPC_MAP_SIZE];
150 int Config::getDefaultDbCachePages()
152 - return (int) sysConfig.values[KEY_DEFAULT_DB_CACHE_PAGES];
153 + return (int)(IPTR) sysConfig.values[KEY_DEFAULT_DB_CACHE_PAGES];
156 int Config::getConnectionTimeout()
158 - return (int) sysConfig.values[KEY_CONNECTION_TIMEOUT];
159 + return (int)(IPTR) sysConfig.values[KEY_CONNECTION_TIMEOUT];
162 int Config::getDummyPacketInterval()
164 - return (int) sysConfig.values[KEY_DUMMY_PACKET_INTERVAL];
165 + return (int)(IPTR) sysConfig.values[KEY_DUMMY_PACKET_INTERVAL];
168 int Config::getLockMemSize()
170 - return (int) sysConfig.values[KEY_LOCK_MEM_SIZE];
171 + return (int)(IPTR) sysConfig.values[KEY_LOCK_MEM_SIZE];
174 int Config::getLockSemCount()
176 - return (int) sysConfig.values[KEY_LOCK_SEM_COUNT];
177 + return (int)(IPTR) sysConfig.values[KEY_LOCK_SEM_COUNT];
180 int Config::getLockSignal()
182 - return (int) sysConfig.values[KEY_LOCK_SIGNAL];
183 + return (int)(IPTR) sysConfig.values[KEY_LOCK_SIGNAL];
186 bool Config::getLockGrantOrder()
187 @@ -341,27 +341,27 @@
189 int Config::getLockHashSlots()
191 - return (int) sysConfig.values[KEY_LOCK_HASH_SLOTS];
192 + return (int)(IPTR) sysConfig.values[KEY_LOCK_HASH_SLOTS];
195 int Config::getLockAcquireSpins()
197 - return (int) sysConfig.values[KEY_LOCK_ACQUIRE_SPINS];
198 + return (int)(IPTR) sysConfig.values[KEY_LOCK_ACQUIRE_SPINS];
201 int Config::getEventMemSize()
203 - return (int) sysConfig.values[KEY_EVENT_MEM_SIZE];
204 + return (int)(IPTR) sysConfig.values[KEY_EVENT_MEM_SIZE];
207 int Config::getDeadlockTimeout()
209 - return (int) sysConfig.values[KEY_DEADLOCK_TIMEOUT];
210 + return (int)(IPTR) sysConfig.values[KEY_DEADLOCK_TIMEOUT];
213 int Config::getSolarisStallValue()
215 - return (int) sysConfig.values[KEY_SOLARIS_STALL_VALUE];
216 + return (int)(IPTR) sysConfig.values[KEY_SOLARIS_STALL_VALUE];
219 bool Config::getTraceMemoryPools()
222 int Config::getPrioritySwitchDelay()
224 - int rc = (int) sysConfig.values[KEY_PRIORITY_SWITCH_DELAY];
225 + int rc = (int)(IPTR) sysConfig.values[KEY_PRIORITY_SWITCH_DELAY];
231 int Config::getDeadThreadsCollection()
233 - int rc = (int) sysConfig.values[KEY_DEAD_THREADS_COLLECTION];
234 + int rc = (int)(IPTR) sysConfig.values[KEY_DEAD_THREADS_COLLECTION];
240 int Config::getPriorityBoost()
242 - int rc = (int) sysConfig.values[KEY_PRIORITY_BOOST];
243 + int rc = (int)(IPTR) sysConfig.values[KEY_PRIORITY_BOOST];
249 int Config::getRemoteServicePort()
251 - return (int) sysConfig.values[KEY_REMOTE_SERVICE_PORT];
252 + return (int)(IPTR) sysConfig.values[KEY_REMOTE_SERVICE_PORT];
255 const char *Config::getRemotePipeName()
256 @@ -417,17 +417,17 @@
258 int Config::getMaxUnflushedWrites()
260 - return (int) sysConfig.values[KEY_MAX_UNFLUSHED_WRITES];
261 + return (int)(IPTR) sysConfig.values[KEY_MAX_UNFLUSHED_WRITES];
264 int Config::getMaxUnflushedWriteTime()
266 - return (int) sysConfig.values[KEY_MAX_UNFLUSHED_WRITE_TIME];
267 + return (int)(IPTR) sysConfig.values[KEY_MAX_UNFLUSHED_WRITE_TIME];
270 int Config::getProcessPriorityLevel()
272 - return (int) sysConfig.values[KEY_PROCESS_PRIORITY_LEVEL];
273 + return (int)(IPTR) sysConfig.values[KEY_PROCESS_PRIORITY_LEVEL];
276 bool Config::getCreateInternalWindow()
278 int Config::getRemoteAuxPort()
281 - return (int) sysConfig.values[KEY_REMOTE_AUX_PORT];
282 + return (int)(IPTR) sysConfig.values[KEY_REMOTE_AUX_PORT];
286 diff -ur firebird-1.5.3.4870-orig/src/dsql/parse.cpp firebird-1.5.3.4870/src/dsql/parse.cpp
287 --- firebird-1.5.3.4870-orig/src/dsql/parse.cpp 2006-03-17 01:39:04.000000000 -0500
288 +++ firebird-1.5.3.4870/src/dsql/parse.cpp 2006-03-17 01:32:17.000000000 -0500
289 @@ -6421,7 +6421,7 @@
292 lex.g_field->fld_dtype = dtype_cstring;
293 - lex.g_field->fld_character_length = (USHORT) yyvsp[-2]; }
294 + lex.g_field->fld_character_length = (USHORT)(IPTR) yyvsp[-2]; }
297 { yyval = (DSQL_NOD) NULL; }
298 @@ -7541,27 +7541,27 @@
301 lex.g_field->fld_dtype = dtype_blob;
302 - lex.g_field->fld_seg_length = (USHORT) yyvsp[-1];
303 + lex.g_field->fld_seg_length = (USHORT)(IPTR) yyvsp[-1];
304 lex.g_field->fld_sub_type = 0;
309 lex.g_field->fld_dtype = dtype_blob;
310 - lex.g_field->fld_seg_length = (USHORT) yyvsp[-3];
311 - lex.g_field->fld_sub_type = (USHORT) yyvsp[-1];
312 + lex.g_field->fld_seg_length = (USHORT)(IPTR) yyvsp[-3];
313 + lex.g_field->fld_sub_type = (USHORT)(IPTR) yyvsp[-1];
318 lex.g_field->fld_dtype = dtype_blob;
319 lex.g_field->fld_seg_length = 80;
320 - lex.g_field->fld_sub_type = (USHORT) yyvsp[-1];
321 + lex.g_field->fld_sub_type = (USHORT)(IPTR) yyvsp[-1];
326 - lex.g_field->fld_seg_length = (USHORT) yyvsp[0];
327 + lex.g_field->fld_seg_length = (USHORT)(IPTR) yyvsp[0];
331 @@ -7571,7 +7571,7 @@
335 - lex.g_field->fld_sub_type = (USHORT) yyvsp[0];
336 + lex.g_field->fld_sub_type = (USHORT)(IPTR) yyvsp[0];
340 @@ -7592,7 +7592,7 @@
343 lex.g_field->fld_dtype = dtype_text;
344 - lex.g_field->fld_character_length = (USHORT) yyvsp[-1];
345 + lex.g_field->fld_character_length = (USHORT)(IPTR) yyvsp[-1];
346 lex.g_field->fld_flags |= FLD_national;
349 @@ -7606,14 +7606,14 @@
352 lex.g_field->fld_dtype = dtype_varying;
353 - lex.g_field->fld_character_length = (USHORT) yyvsp[-1];
354 + lex.g_field->fld_character_length = (USHORT)(IPTR) yyvsp[-1];
355 lex.g_field->fld_flags |= FLD_national;
360 lex.g_field->fld_dtype = dtype_text;
361 - lex.g_field->fld_character_length = (USHORT) yyvsp[-1];
362 + lex.g_field->fld_character_length = (USHORT)(IPTR) yyvsp[-1];
366 @@ -7625,7 +7625,7 @@
369 lex.g_field->fld_dtype = dtype_varying;
370 - lex.g_field->fld_character_length = (USHORT) yyvsp[-1];
371 + lex.g_field->fld_character_length = (USHORT)(IPTR) yyvsp[-1];
375 @@ -7705,7 +7705,7 @@
376 lex.g_field->fld_dtype = dtype_long;
377 lex.g_field->fld_length = sizeof (SLONG);
379 - lex.g_field->fld_precision = (USHORT) yyvsp[-1];
380 + lex.g_field->fld_precision = (USHORT)(IPTR) yyvsp[-1];
384 @@ -7765,8 +7765,8 @@
385 lex.g_field->fld_length = sizeof (SLONG);
388 - lex.g_field->fld_precision = (USHORT) yyvsp[-3];
389 - lex.g_field->fld_scale = - (SSHORT) yyvsp[-1];
390 + lex.g_field->fld_precision = (USHORT)(IPTR) yyvsp[-3];
391 + lex.g_field->fld_scale = - (SSHORT)(IPTR) yyvsp[-1];
395 @@ -7932,7 +7932,7 @@
396 { yyval = make_node (nod_table_lock, (int) 2, make_list (yyvsp[-1]), yyvsp[0]); }
399 -{ yyval = make_flag_node (nod_lock_mode, (SSHORT) ((SSHORT) yyvsp[-1] | (SSHORT) yyvsp[0]), (SSHORT) 0, NULL); }
400 +{ yyval = make_flag_node (nod_lock_mode, (SSHORT) ((SSHORT)(IPTR) yyvsp[-1] | (SSHORT)(IPTR) yyvsp[0]), (SSHORT) 0, NULL); }
404 diff -ur firebird-1.5.3.4870-orig/src/gpre/c_cxx.cpp firebird-1.5.3.4870/src/gpre/c_cxx.cpp
405 --- firebird-1.5.3.4870-orig/src/gpre/c_cxx.cpp 2006-03-17 01:39:04.000000000 -0500
406 +++ firebird-1.5.3.4870/src/gpre/c_cxx.cpp 2006-03-17 01:32:18.000000000 -0500
407 @@ -2184,7 +2184,7 @@
409 args.pat_database = (DBB) init->nod_arg[3];
410 args.pat_vector1 = status_vector(action);
411 - args.pat_long1 = (int) init->nod_arg[2];
412 + args.pat_long1 = (int)(IPTR) init->nod_arg[2];
413 args.pat_value2 = (int) event_list->nod_count;
415 // generate call to dynamically generate event blocks
416 @@ -2255,7 +2255,7 @@
417 event_init = (GPRE_NOD) event_action->act_object;
418 stack_name = (SYM) event_init->nod_arg[0];
419 if (!strcmp(event_name->sym_string, stack_name->sym_string)) {
420 - ident = (int) event_init->nod_arg[2];
421 + ident = (int)(IPTR) event_init->nod_arg[2];
422 database = (DBB) event_init->nod_arg[3];
425 diff -ur firebird-1.5.3.4870-orig/src/gpre/cmd.cpp firebird-1.5.3.4870/src/gpre/cmd.cpp
426 --- firebird-1.5.3.4870-orig/src/gpre/cmd.cpp 2006-03-17 01:39:04.000000000 -0500
427 +++ firebird-1.5.3.4870/src/gpre/cmd.cpp 2006-03-17 01:32:18.000000000 -0500
430 case ACT_drop_shadow:
431 put_numeric(request, gds_dyn_delete_shadow,
432 - (SSHORT) action->act_object);
433 + (SSHORT)(IPTR) action->act_object);
437 diff -ur firebird-1.5.3.4870-orig/src/gpre/cme.cpp firebird-1.5.3.4870/src/gpre/cme.cpp
438 --- firebird-1.5.3.4870-orig/src/gpre/cme.cpp 2006-03-17 01:39:04.000000000 -0500
439 +++ firebird-1.5.3.4870/src/gpre/cme.cpp 2006-03-17 01:32:18.000000000 -0500
441 // ** Begin date/time/timestamp support *
444 - switch ((KWWORDS) (int) node->nod_arg[0])
445 + switch ((KWWORDS) (int)(IPTR) node->nod_arg[1])
448 STUFF(blr_extract_year);
450 // ** Begin date/time/timestamp support *
453 - KWWORDS kw_word = (KWWORDS) (int) node->nod_arg[0];
454 + KWWORDS kw_word = (KWWORDS) (int)(IPTR) node->nod_arg[0];
455 CME_get_dtype(node->nod_arg[1], f);
456 switch (f->fld_dtype)
458 diff -ur firebird-1.5.3.4870-orig/src/gpre/cob.cpp firebird-1.5.3.4870/src/gpre/cob.cpp
459 --- firebird-1.5.3.4870-orig/src/gpre/cob.cpp 2006-03-17 01:39:04.000000000 -0500
460 +++ firebird-1.5.3.4870/src/gpre/cob.cpp 2006-03-17 01:32:18.000000000 -0500
462 static void gen_on_error (ACT);
463 static void gen_procedure (ACT);
464 static void gen_put_segment (ACT);
465 -static void gen_raw (UCHAR *, enum req_t, int, int);
466 +static void gen_raw (UCHAR *, enum req_t, int, IPTR);
467 static void gen_ready (ACT);
468 static void gen_receive (ACT, POR);
469 static void gen_release (ACT);
470 @@ -2656,7 +2656,7 @@
472 args.pat_database = (DBB) init->nod_arg[3];
473 args.pat_vector1 = status_vector(action);
474 - args.pat_value1 = (int) init->nod_arg[2];
475 + args.pat_value1 = (IPTR) init->nod_arg[2];
476 args.pat_value2 = (int) event_list->nod_count;
477 args.pat_string1 = ISC_EVENT_BLOCK;
478 args.pat_string2 = ISC_EVENT_WAIT;
479 @@ -2712,7 +2712,7 @@
487 "CALL \"%S2\" USING %V1, %RF%DH%RE, %VF%S4%N1L%VE, %VF%S4%N1A%VE, %VF%S4%N1B%VE";
488 @@ -2730,7 +2730,7 @@
489 event_init = (GPRE_NOD) event_action->act_object;
490 stack_name = (SYM) event_init->nod_arg[0];
491 if (!strcmp(event_name->sym_string, stack_name->sym_string)) {
492 - ident = (int) event_init->nod_arg[2];
493 + ident = (IPTR) event_init->nod_arg[2];
494 database = (DBB) event_init->nod_arg[3];
497 @@ -3845,7 +3845,7 @@
501 - enum req_t request_type, int request_length, int ident)
502 + enum req_t request_type, int request_length, IPTR ident)
506 @@ -4193,7 +4193,7 @@
507 printa(names[COLUMN_0], FALSE, "01 %s%d.",
508 names[ISC_], blob->blb_bpb_ident);
509 gen_raw(blob->blb_bpb, request->req_type, blob->blb_bpb_length,
512 printa(names[COMMENT], FALSE, " ");
515 @@ -4703,7 +4703,7 @@
516 static void gen_type( ACT action)
519 - printa(names[COLUMN], TRUE, "%ld", action->act_object);
520 + printa(names[COLUMN], TRUE, "%ld", (IPTR) action->act_object);
524 diff -ur firebird-1.5.3.4870-orig/src/gpre/pat.h firebird-1.5.3.4870/src/gpre/pat.h
525 --- firebird-1.5.3.4870-orig/src/gpre/pat.h 2006-03-17 01:39:04.000000000 -0500
526 +++ firebird-1.5.3.4870/src/gpre/pat.h 2006-03-17 01:32:18.000000000 -0500
536 diff -ur firebird-1.5.3.4870-orig/src/jrd/blb.cpp firebird-1.5.3.4870/src/jrd/blb.cpp
537 --- firebird-1.5.3.4870-orig/src/jrd/blb.cpp 2006-03-17 01:39:04.000000000 -0500
538 +++ firebird-1.5.3.4870/src/jrd/blb.cpp 2006-03-17 01:32:28.000000000 -0500
540 request = tdbb->tdbb_request;
541 source = (BID) from_desc->dsc_address;
542 destination = (BID) to_desc->dsc_address;
543 - id = (USHORT) field->nod_arg[e_fld_id];
544 - rpb = &request->req_rpb[(int) field->nod_arg[e_fld_stream]];
545 + id = (USHORT)(IPTR) field->nod_arg[e_fld_id];
546 + rpb = &request->req_rpb[(int)(IPTR) field->nod_arg[e_fld_stream]];
547 relation = rpb->rpb_relation;
548 record = rpb->rpb_record;
550 diff -ur firebird-1.5.3.4870-orig/src/jrd/cmp.cpp firebird-1.5.3.4870/src/jrd/cmp.cpp
551 --- firebird-1.5.3.4870-orig/src/jrd/cmp.cpp 2006-03-17 01:39:04.000000000 -0500
552 +++ firebird-1.5.3.4870/src/jrd/cmp.cpp 2006-03-17 01:32:29.000000000 -0500
557 - id = (USHORT) node->nod_arg[e_fld_id];
558 + id = (USHORT)(IPTR) node->nod_arg[e_fld_id];
560 - CMP_format(tdbb, csb, (USHORT) node->nod_arg[e_fld_stream]);
561 + CMP_format(tdbb, csb, (USHORT)(IPTR) node->nod_arg[e_fld_stream]);
562 if (id >= format->fmt_count) {
563 desc->dsc_dtype = dtype_null;
564 desc->dsc_length = 0;
567 sub = node->nod_arg[e_scl_field];
569 - csb->csb_rpt[(USHORT) sub->
570 + csb->csb_rpt[(USHORT)(IPTR) sub->
571 nod_arg[e_fld_stream]].csb_relation;
572 - id = (USHORT) sub->nod_arg[e_fld_id];
573 + id = (USHORT)(IPTR) sub->nod_arg[e_fld_id];
574 field = MET_get_field(relation, id);
575 if (!field || !(array = field->fld_array))
576 IBERROR(223); /* msg 223 argument of scalar operation must be an array */
577 @@ -1661,7 +1661,7 @@
581 - if ((ULONG) node->nod_arg[e_extract_part] == blr_extract_second) {
582 + if ((ULONG)(IPTR) node->nod_arg[e_extract_part] == blr_extract_second) {
583 /* QUADDATE - SECOND returns a float, or scaled! */
584 desc->dsc_dtype = dtype_long;
585 desc->dsc_length = sizeof(ULONG);
586 @@ -1720,7 +1720,7 @@
588 message = node->nod_arg[e_arg_message];
589 format = (FMT) message->nod_arg[e_msg_format];
590 - *desc = format->fmt_desc[(int) node->nod_arg[e_arg_number]];
591 + *desc = format->fmt_desc[(int)(IPTR) node->nod_arg[e_arg_number]];
595 @@ -2653,8 +2653,8 @@
596 !input->nod_arg[e_fld_id] && !input->nod_arg[e_fld_stream])
599 - field_id = (USHORT) input->nod_arg[e_fld_id];
600 - stream = (USHORT) input->nod_arg[e_fld_stream];
601 + field_id = (USHORT)(IPTR) input->nod_arg[e_fld_id];
602 + stream = (USHORT)(IPTR) input->nod_arg[e_fld_stream];
606 @@ -2662,7 +2662,7 @@
607 relation = (*csb)->csb_rpt[stream].csb_relation;
608 field = MET_get_field(relation, field_id);
609 if (field->fld_source)
610 - field_id = (USHORT) field->fld_source->nod_arg[e_fld_id];
611 + field_id = (USHORT)(IPTR) field->fld_source->nod_arg[e_fld_id];
614 stream = remap[stream];
615 @@ -2773,7 +2773,7 @@
616 node->nod_type = input->nod_type;
619 - stream = (USHORT) input->nod_arg[e_rel_stream];
620 + stream = (USHORT)(IPTR) input->nod_arg[e_rel_stream];
622 Last entry in the remap contains the the original stream number.
623 Get that stream number so that the flags can be copied
624 @@ -2853,7 +2853,7 @@
625 node->nod_arg[e_prc_inputs] =
626 copy(tdbb, csb, input->nod_arg[e_prc_inputs], remap, field_id,
627 node->nod_arg[e_prc_in_msg], remap_fld);
628 - stream = (USHORT) input->nod_arg[e_prc_stream];
629 + stream = (USHORT)(IPTR) input->nod_arg[e_prc_stream];
630 new_stream = (*csb)->csb_n_stream++;
631 node->nod_arg[e_prc_stream] = (JRD_NOD) (SLONG) new_stream;
632 /* TMN: Here we should really have the following assert */
633 @@ -2863,7 +2863,7 @@
634 element = CMP_csb_element(csb, new_stream);
635 // SKIDDER: Maybe we need to check if we really found a procedure ?
636 element->csb_procedure = MET_lookup_procedure_id(tdbb,
637 - (SSHORT)node->nod_arg[e_prc_procedure],FALSE,FALSE,0);
638 + (SSHORT)(IPTR)node->nod_arg[e_prc_procedure],FALSE,FALSE,0);
640 (*csb)->csb_rpt[new_stream].csb_flags |=
641 (*csb)->csb_rpt[stream].csb_flags & csb_no_dbkey;
642 @@ -2876,7 +2876,7 @@
643 node = PAR_make_node(tdbb, e_agg_length);
644 node->nod_type = input->nod_type;
646 - stream = (USHORT) input->nod_arg[e_agg_stream];
647 + stream = (USHORT)(IPTR) input->nod_arg[e_agg_stream];
648 assert(stream <= MAX_STREAMS);
649 new_stream = (*csb)->csb_n_stream++;
650 assert(new_stream <= MAX_STREAMS);
651 @@ -2905,7 +2905,7 @@
652 node = PAR_make_node(tdbb, e_uni_length);
653 node->nod_type = input->nod_type;
655 - stream = (USHORT) input->nod_arg[e_uni_stream];
656 + stream = (USHORT)(IPTR) input->nod_arg[e_uni_stream];
657 new_stream = (*csb)->csb_n_stream++;
658 node->nod_arg[e_uni_stream] = (JRD_NOD) (SLONG) new_stream;
659 /* TMN: Here we should really have the following assert */
660 @@ -3043,7 +3043,7 @@
664 - stream = (USHORT) node->nod_arg[e_rel_stream];
665 + stream = (USHORT)(IPTR) node->nod_arg[e_rel_stream];
666 csb->csb_rpt[stream].csb_flags |= csb_no_dbkey;
667 tail = &csb->csb_rpt[stream];
668 if ( (relation = tail->csb_relation) )
669 @@ -3271,7 +3271,7 @@
671 UCHAR *map, local_map[MAP_LENGTH];
673 - stream = (USHORT) node->nod_arg[e_fld_stream];
674 + stream = (USHORT)(IPTR) node->nod_arg[e_fld_stream];
676 /* Look at all rse's which are lower in scope than the rse which this field
677 is referencing, and mark them as varying -- the rule is that if a field
678 @@ -3292,7 +3292,7 @@
679 if (!(relation = tail->csb_relation) ||
681 MET_get_field(relation,
682 - (USHORT) node->nod_arg[e_fld_id]))) break;
683 + (USHORT)(IPTR) node->nod_arg[e_fld_id]))) break;
685 /* if this is a modify or store, check REFERENCES access to any foreign keys. */
687 @@ -3404,9 +3404,9 @@
689 sub = node->nod_arg[e_asgn_from];
690 if (sub->nod_type == nod_field) {
691 - stream = (USHORT) sub->nod_arg[e_fld_stream];
692 + stream = (USHORT)(IPTR) sub->nod_arg[e_fld_stream];
693 field = MET_get_field((*csb)->csb_rpt[stream].csb_relation,
694 - (USHORT) sub->nod_arg[e_fld_id]);
695 + (USHORT)(IPTR) sub->nod_arg[e_fld_id]);
697 node->nod_arg[e_asgn_missing2] = field->fld_missing_value;
699 @@ -3414,12 +3414,12 @@
700 sub = node->nod_arg[e_asgn_to];
701 if (sub->nod_type != nod_field)
703 - stream = (USHORT) sub->nod_arg[e_fld_stream];
704 + stream = (USHORT)(IPTR) sub->nod_arg[e_fld_stream];
705 tail = &(*csb)->csb_rpt[stream];
708 MET_get_field(tail->csb_relation,
709 - (USHORT) sub->nod_arg[e_fld_id]))) break;
710 + (USHORT)(IPTR) sub->nod_arg[e_fld_id]))) break;
711 if (field->fld_missing_value) {
712 node->nod_arg[e_asgn_missing] = field->fld_missing_value;
714 @@ -3433,7 +3433,7 @@
718 - stream = (USHORT) node->nod_arg[e_mod_new_stream];
719 + stream = (USHORT)(IPTR) node->nod_arg[e_mod_new_stream];
720 tail = &(*csb)->csb_rpt[stream];
721 tail->csb_flags |= csb_modify;
722 pass1_modify(tdbb, csb, node);
723 @@ -3441,13 +3441,13 @@
724 /* assert(node->nod_arg [e_mod_new_stream] <= MAX_USHORT); */
725 if ( (node->nod_arg[e_mod_validate] =
726 make_validation(tdbb, csb,
728 + (USHORT)(IPTR) node->
729 nod_arg[e_mod_new_stream])) ) node->nod_count =
730 MAX(node->nod_count, (USHORT) e_mod_validate + 1);
734 - stream = (USHORT) node->nod_arg[e_erase_stream];
735 + stream = (USHORT)(IPTR) node->nod_arg[e_erase_stream];
736 tail = &(*csb)->csb_rpt[stream];
737 tail->csb_flags |= csb_erase;
738 pass1_erase(tdbb, csb, node);
739 @@ -3463,12 +3463,12 @@
742 sub = node->nod_arg[e_sto_relation];
743 - stream = (USHORT) sub->nod_arg[e_rel_stream];
744 + stream = (USHORT)(IPTR) sub->nod_arg[e_rel_stream];
745 tail = &(*csb)->csb_rpt[stream];
746 tail->csb_flags |= csb_store;
747 sub = pass1_store(tdbb, csb, node);
749 - stream = (USHORT) sub->nod_arg[e_rel_stream];
750 + stream = (USHORT)(IPTR) sub->nod_arg[e_rel_stream];
751 if ((!node->nod_arg[e_sto_sub_store]) &&
752 (node->nod_arg[e_sto_validate] =
753 make_validation(tdbb, csb, stream))) node->nod_count =
754 @@ -3495,7 +3495,7 @@
757 assert((int)node->nod_arg[e_agg_stream] <= MAX_STREAMS);
758 - (*csb)->csb_rpt[(USHORT) node->nod_arg[e_agg_stream]].csb_flags |=
759 + (*csb)->csb_rpt[(USHORT)(IPTR) node->nod_arg[e_agg_stream]].csb_flags |=
761 ignore_dbkey(tdbb, *csb, (RSE) node->nod_arg[e_agg_rse], view);
762 node->nod_arg[e_agg_rse] =
763 @@ -3523,7 +3523,7 @@
766 type = node->nod_type;
767 - stream = (USHORT) node->nod_arg[0];
768 + stream = (USHORT)(IPTR) node->nod_arg[0];
770 if (!(*csb)->csb_rpt[stream].csb_map)
772 @@ -3558,7 +3558,7 @@
775 case nod_cardinality:
776 - stream = (USHORT) node->nod_arg[e_card_stream];
777 + stream = (USHORT)(IPTR) node->nod_arg[e_card_stream];
778 (*csb)->csb_rpt[stream].csb_flags |= csb_compute;
781 @@ -3625,7 +3625,7 @@
782 /* To support views of views, loop until we hit a real relation */
785 - stream = new_stream = (USHORT) node->nod_arg[e_erase_stream];
786 + stream = new_stream = (USHORT)(IPTR) node->nod_arg[e_erase_stream];
787 tail = &(*csb)->csb_rpt[stream];
788 tail->csb_flags |= csb_erase;
789 relation = (*csb)->csb_rpt[stream].csb_relation;
790 @@ -3693,7 +3693,7 @@
793 parent_stream = stream;
794 - new_stream = (USHORT) source->nod_arg[e_rel_stream];
795 + new_stream = (USHORT)(IPTR) source->nod_arg[e_rel_stream];
796 node->nod_arg[e_erase_stream] = (JRD_NOD) (SLONG) map[new_stream];
799 @@ -3740,7 +3740,7 @@
800 field = MET_get_field(relation, id);
801 if (field->fld_source)
803 - (USHORT) (JRD_NOD) (field->fld_source)->nod_arg[e_fld_id];
804 + (USHORT)(IPTR) (JRD_NOD) (field->fld_source)->nod_arg[e_fld_id];
808 @@ -3802,8 +3802,8 @@
809 /* To support views of views, loop until we hit a real relation */
812 - stream = (USHORT) node->nod_arg[e_mod_org_stream];
813 - new_stream = (USHORT) node->nod_arg[e_mod_new_stream];
814 + stream = (USHORT)(IPTR) node->nod_arg[e_mod_org_stream];
815 + new_stream = (USHORT)(IPTR) node->nod_arg[e_mod_new_stream];
816 tail = &(*csb)->csb_rpt[new_stream];
817 tail->csb_flags |= csb_modify;
818 relation = (*csb)->csb_rpt[stream].csb_relation;
819 @@ -3842,7 +3842,7 @@
821 MAX(node->nod_count, (USHORT) e_mod_map_view + 1);
822 map = (*csb)->csb_rpt[stream].csb_map;
823 - stream = (USHORT) source->nod_arg[e_rel_stream];
824 + stream = (USHORT)(IPTR) source->nod_arg[e_rel_stream];
825 stream = map[stream];
826 view_stream = new_stream;
828 @@ -3850,18 +3850,18 @@
832 - (SSHORT) node->nod_arg[e_mod_new_stream]);
833 + (SSHORT)(IPTR) node->nod_arg[e_mod_new_stream]);
834 source = copy(tdbb, csb, source, map, 0, NULL, FALSE);
835 /* TMN: Here we should really have the following assert */
836 /* assert(source->nod_arg [e_rel_stream] <= MAX_UCHAR); */
837 - map[new_stream] = (UCHAR) source->nod_arg[e_rel_stream];
838 + map[new_stream] = (UCHAR)(IPTR) source->nod_arg[e_rel_stream];
839 view_node = copy(tdbb, csb, node, map, 0, NULL, TRUE);
840 view_node->nod_arg[e_mod_org_stream] = (JRD_NOD) (SLONG) stream;
841 view_node->nod_arg[e_mod_new_stream] =
842 source->nod_arg[e_rel_stream];
843 view_node->nod_arg[e_mod_map_view] = NULL;
844 node->nod_arg[e_mod_sub_mod] = view_node;
845 - new_stream = (USHORT) source->nod_arg[e_rel_stream];
846 + new_stream = (USHORT)(IPTR) source->nod_arg[e_rel_stream];
847 view_node->nod_arg[e_mod_statement] =
848 pass1_expand_view(tdbb, *csb, view_stream, new_stream, TRUE);
850 @@ -3874,14 +3874,14 @@
851 /* View passes muster -- do some translation. Start with source stream */
853 map = (*csb)->csb_rpt[stream].csb_map;
854 - stream = (USHORT) source->nod_arg[e_rel_stream];
855 + stream = (USHORT)(IPTR) source->nod_arg[e_rel_stream];
856 node->nod_arg[e_mod_org_stream] = (JRD_NOD) (SLONG) map[stream];
858 /* Next, do update stream */
862 - (SSHORT) node->nod_arg[e_mod_new_stream]);
863 + (SSHORT)(IPTR) node->nod_arg[e_mod_new_stream]);
864 source = copy(tdbb, csb, source, map, 0, NULL, FALSE);
865 node->nod_arg[e_mod_new_stream] = source->nod_arg[e_rel_stream];
867 @@ -4128,7 +4128,7 @@
869 pass1(tdbb, csb, source, parent_view, view_stream, FALSE);
870 procedure = MET_lookup_procedure_id(tdbb,
871 - (SSHORT)source->nod_arg[e_prc_procedure], FALSE, FALSE, 0);
872 + (SSHORT)(IPTR)source->nod_arg[e_prc_procedure], FALSE, FALSE, 0);
873 post_procedure_access(tdbb, *csb, procedure);
874 CMP_post_resource(&(*csb)->csb_resources, (BLK) procedure,
875 Resource::rsc_procedure, procedure->prc_id);
876 @@ -4160,7 +4160,7 @@
878 source->nod_arg[e_rel_view] = (JRD_NOD) parent_view;
880 - stream = (USHORT) source->nod_arg[e_rel_stream];
881 + stream = (USHORT)(IPTR) source->nod_arg[e_rel_stream];
882 element = CMP_csb_element(csb, stream);
883 element->csb_view = parent_view;
884 /* TMN: Here we should really have the following assert */
885 @@ -4175,7 +4175,7 @@
886 for (vcx_ptr = &parent_view->rel_view_contexts; *vcx_ptr;
887 vcx_ptr = &(*vcx_ptr)->vcx_next)
888 if ((*vcx_ptr)->vcx_context ==
889 - (USHORT) source->nod_arg[e_rel_context]) {
890 + (USHORT)(IPTR) source->nod_arg[e_rel_context]) {
891 element->csb_alias = (*vcx_ptr)->vcx_context_name;
894 @@ -4319,7 +4319,7 @@
897 original = node->nod_arg[e_sto_relation];
898 - stream = (USHORT) original->nod_arg[e_rel_stream];
899 + stream = (USHORT)(IPTR) original->nod_arg[e_rel_stream];
900 tail = &(*csb)->csb_rpt[stream];
901 tail->csb_flags |= csb_store;
902 relation = (*csb)->csb_rpt[stream].csb_relation;
903 @@ -4373,7 +4373,7 @@
904 node->nod_arg[e_sto_relation] =
905 copy(tdbb, csb, source, map, 0, NULL, FALSE);
907 - (USHORT) node->nod_arg[e_sto_relation]->nod_arg[e_rel_stream];
908 + (USHORT)(IPTR) node->nod_arg[e_sto_relation]->nod_arg[e_rel_stream];
909 node->nod_arg[e_sto_statement] =
910 pass1_expand_view(tdbb, *csb, stream, new_stream, TRUE);
911 node->nod_arg[e_sto_statement] =
912 @@ -4721,9 +4721,9 @@
913 /* AB: Mark the streams involved with an UPDATE statement
914 active. So that the optimizer can use indices for
915 eventually used sub-selects. */
916 - stream = (USHORT) node->nod_arg[e_mod_org_stream];
917 + stream = (USHORT)(IPTR) node->nod_arg[e_mod_org_stream];
918 csb->csb_rpt[stream].csb_flags |= csb_active;
919 - stream = (USHORT) node->nod_arg[e_mod_new_stream];
920 + stream = (USHORT)(IPTR) node->nod_arg[e_mod_new_stream];
921 csb->csb_rpt[stream].csb_flags |= csb_active;
924 @@ -4735,9 +4735,9 @@
926 if (node->nod_type == nod_modify) {
927 /* AB: Remove the previous flags */
928 - stream = (USHORT) node->nod_arg[e_mod_org_stream];
929 + stream = (USHORT)(IPTR) node->nod_arg[e_mod_org_stream];
930 csb->csb_rpt[stream].csb_flags &= ~csb_active;
931 - stream = (USHORT) node->nod_arg[e_mod_new_stream];
932 + stream = (USHORT)(IPTR) node->nod_arg[e_mod_new_stream];
933 csb->csb_rpt[stream].csb_flags &= ~csb_active;
936 @@ -4836,7 +4836,7 @@
938 fmt::fmt_desc_iterator desc;
940 - stream = (USHORT) node->nod_arg[e_mod_org_stream];
941 + stream = (USHORT)(IPTR) node->nod_arg[e_mod_org_stream];
942 csb->csb_rpt[stream].csb_flags |= csb_update;
943 format = CMP_format(tdbb, csb, stream);
944 desc = format->fmt_desc.begin();
945 @@ -4861,13 +4861,13 @@
949 - stream = (USHORT) node->nod_arg[e_erase_stream];
950 + stream = (USHORT)(IPTR) node->nod_arg[e_erase_stream];
951 csb->csb_rpt[stream].csb_flags |= csb_update;
955 - stream = (USHORT) node->nod_arg[e_fld_stream];
956 - id = (USHORT) node->nod_arg[e_fld_id];
957 + stream = (USHORT)(IPTR) node->nod_arg[e_fld_stream];
958 + id = (USHORT)(IPTR) node->nod_arg[e_fld_id];
959 SBM_set(tdbb, &csb->csb_rpt[stream].csb_fields, id);
960 if (node->nod_flags & nod_value) {
961 csb->csb_impure += sizeof(struct vlux);
962 @@ -4941,7 +4941,7 @@
963 pass2_rse(tdbb, csb, (RSE) node->nod_arg[e_agg_rse]);
964 pass2(tdbb, csb, node->nod_arg[e_agg_map], node);
965 pass2(tdbb, csb, node->nod_arg[e_agg_group], node);
966 - stream = (USHORT) node->nod_arg[e_agg_stream];
967 + stream = (USHORT)(IPTR) node->nod_arg[e_agg_stream];
968 assert(stream <= MAX_STREAMS);
969 process_map(tdbb, csb, node->nod_arg[e_agg_map],
970 &csb->csb_rpt[stream].csb_format);
971 @@ -5050,7 +5050,7 @@
974 if (node->nod_type == nod_relation) {
975 - USHORT stream = (USHORT) node->nod_arg[e_rel_stream];
976 + USHORT stream = (USHORT)(IPTR) node->nod_arg[e_rel_stream];
977 csb->csb_rpt[stream].csb_flags |= csb_active;
978 pass2(tdbb, csb, node, (JRD_NOD) rse);
980 @@ -5058,12 +5058,12 @@
981 pass2_rse(tdbb, csb, (RSE) node);
983 else if (node->nod_type == nod_procedure) {
984 - USHORT stream = (USHORT) node->nod_arg[e_prc_stream];
985 + USHORT stream = (USHORT)(IPTR) node->nod_arg[e_prc_stream];
986 csb->csb_rpt[stream].csb_flags |= csb_active;
987 pass2(tdbb, csb, node, (JRD_NOD) rse);
989 else if (node->nod_type == nod_aggregate) {
990 - USHORT stream = (USHORT) node->nod_arg[e_agg_stream];
991 + USHORT stream = (USHORT)(IPTR) node->nod_arg[e_agg_stream];
992 assert(stream <= MAX_STREAMS);
993 csb->csb_rpt[stream].csb_flags |= csb_active;
994 pass2(tdbb, csb, node, (JRD_NOD) rse);
995 @@ -5118,7 +5118,7 @@
996 /* Make up a format block sufficiently large to hold instantiated record */
998 clauses = node->nod_arg[e_uni_clauses];
999 - id = (USHORT) node->nod_arg[e_uni_stream];
1000 + id = (USHORT)(IPTR) node->nod_arg[e_uni_stream];
1001 format = &csb->csb_rpt[id].csb_format;
1003 /* Process alternating rse and map blocks */
1004 @@ -5160,7 +5160,7 @@
1006 for (ptr = rse->rse_relation, end = ptr + rse->rse_count; ptr < end;
1007 ptr++) if ((*ptr)->nod_type == nod_relation) {
1008 - stream = (USHORT) (*ptr)->nod_arg[e_rel_stream];
1009 + stream = (USHORT)(IPTR) (*ptr)->nod_arg[e_rel_stream];
1010 if (!(csb->csb_rpt[stream].csb_plan))
1011 ERR_post(gds_no_stream_plan, gds_arg_string,
1012 csb->csb_rpt[stream].csb_relation->rel_name, 0);
1013 @@ -5213,7 +5213,7 @@
1015 /* find the tail for the relation specified in the rse */
1017 - stream = (USHORT) plan_relation_node->nod_arg[e_rel_stream];
1018 + stream = (USHORT)(IPTR) plan_relation_node->nod_arg[e_rel_stream];
1019 tail = &csb->csb_rpt[stream];
1021 /* if the plan references a view, find the real base relation
1022 @@ -5449,15 +5449,15 @@
1025 if (node->nod_type == nod_relation) {
1026 - USHORT stream = (USHORT) node->nod_arg[e_rel_stream];
1027 + USHORT stream = (USHORT)(IPTR) node->nod_arg[e_rel_stream];
1028 csb->csb_rpt[stream].csb_flags &= ~csb_active;
1030 else if (node->nod_type == nod_procedure) {
1031 - USHORT stream = (USHORT) node->nod_arg[e_prc_stream];
1032 + USHORT stream = (USHORT)(IPTR) node->nod_arg[e_prc_stream];
1033 csb->csb_rpt[stream].csb_flags &= ~csb_active;
1035 else if (node->nod_type == nod_aggregate) {
1036 - USHORT stream = (USHORT) node->nod_arg[e_agg_stream];
1037 + USHORT stream = (USHORT)(IPTR) node->nod_arg[e_agg_stream];
1038 assert(stream <= MAX_STREAMS);
1039 csb->csb_rpt[stream].csb_flags &= ~csb_active;
1041 @@ -5553,7 +5553,7 @@
1042 for (end = ptr + map->nod_count; ptr < end; ptr++) {
1044 field = assignment->nod_arg[e_asgn_to];
1045 - id = (USHORT) field->nod_arg[e_fld_id];
1046 + id = (USHORT)(IPTR) field->nod_arg[e_fld_id];
1047 if (id >= format->fmt_count) {
1048 format->fmt_desc.resize(id + 1);
1050 @@ -5689,13 +5689,13 @@
1051 /* for aggregates, check current rse, if not found then check
1053 if (sub->nod_type == nod_aggregate) {
1054 - if ((stream == (USHORT) sub->nod_arg[e_rel_stream]) ||
1055 + if ((stream == (USHORT)(IPTR) sub->nod_arg[e_rel_stream]) ||
1056 (stream_in_rse(stream, (RSE) sub->nod_arg[e_agg_rse])))
1057 return TRUE; /* do not mark as variant */
1060 if ((sub->nod_type == nod_relation) &&
1061 - (stream == (USHORT) sub->nod_arg[e_rel_stream]))
1062 + (stream == (USHORT)(IPTR) sub->nod_arg[e_rel_stream]))
1063 return TRUE; /* do not mark as variant */
1066 diff -ur firebird-1.5.3.4870-orig/src/jrd/common.h firebird-1.5.3.4870/src/jrd/common.h
1067 --- firebird-1.5.3.4870-orig/src/jrd/common.h 2006-03-17 01:39:04.000000000 -0500
1068 +++ firebird-1.5.3.4870/src/jrd/common.h 2006-03-17 01:32:29.000000000 -0500
1071 #define JRD_BUGCHK 15 /* facility code for bugcheck messages */
1073 -#define OFFSET(struct,fld) ((int) &((struct) 0)->fld)
1074 -#define OFFSETA(struct,fld) ((int) ((struct) 0)->fld)
1075 +#define OFFSET(struct,fld) ((int)(IPTR) &((struct) 0)->fld)
1076 +#define OFFSETA(struct,fld) ((int)(IPTR) ((struct) 0)->fld)
1079 #ifndef ODS_ALIGNMENT
1080 diff -ur firebird-1.5.3.4870-orig/src/jrd/dpm.epp firebird-1.5.3.4870/src/jrd/dpm.epp
1081 --- firebird-1.5.3.4870-orig/src/jrd/dpm.epp 2006-03-17 01:39:04.000000000 -0500
1082 +++ firebird-1.5.3.4870/src/jrd/dpm.epp 2006-03-17 01:32:29.000000000 -0500
1083 @@ -2119,7 +2119,7 @@
1087 - CCH_precedence(tdbb, &rpb->rpb_window, (SLONG) LLS_POP(stack));
1088 + CCH_precedence(tdbb, &rpb->rpb_window, (SLONG)(IPTR) LLS_POP(stack));
1090 CCH_precedence(tdbb, &rpb->rpb_window, -rpb->rpb_transaction);
1091 CCH_MARK(tdbb, &rpb->rpb_window);
1092 @@ -2736,7 +2736,7 @@
1093 If the page need to be compressed, compress it. */
1096 - CCH_precedence(tdbb, &rpb->rpb_window, (SLONG) LLS_POP(stack));
1097 + CCH_precedence(tdbb, &rpb->rpb_window, (SLONG)(IPTR) LLS_POP(stack));
1098 CCH_MARK(tdbb, &rpb->rpb_window);
1099 i = page->dpg_count + ((slot) ? 0 : 1);
1101 diff -ur firebird-1.5.3.4870-orig/src/jrd/evl.cpp firebird-1.5.3.4870/src/jrd/evl.cpp
1102 --- firebird-1.5.3.4870-orig/src/jrd/evl.cpp 2006-03-17 01:39:04.000000000 -0500
1103 +++ firebird-1.5.3.4870/src/jrd/evl.cpp 2006-03-17 01:32:29.000000000 -0500
1105 arg_number = (int)(IPTR)node->nod_arg[e_arg_number];
1106 desc = &format->fmt_desc[arg_number];
1107 impure->vlu_desc.dsc_address =
1108 - (UCHAR *) request + message->nod_impure + (int) desc->dsc_address;
1109 + (UCHAR *) request + message->nod_impure + (int)(IPTR) desc->dsc_address;
1110 impure->vlu_desc.dsc_dtype = desc->dsc_dtype;
1111 impure->vlu_desc.dsc_length = desc->dsc_length;
1112 impure->vlu_desc.dsc_scale = desc->dsc_scale;
1114 // may happen. I checked triggers and insert/update statements.
1115 // All seem to work fine.
1117 - request->req_rpb[(int) node->nod_arg[e_fld_stream]].rpb_record;
1118 - EVL_field(0, record, (USHORT) node->nod_arg[e_fld_id],
1119 + request->req_rpb[(int)(IPTR) node->nod_arg[e_fld_stream]].rpb_record;
1120 + EVL_field(0, record, (USHORT)(IPTR) node->nod_arg[e_fld_id],
1122 if (!impure->vlu_desc.dsc_address)
1123 ERR_post(gds_read_only_field, 0);
1125 impure = (INV) ((SCHAR *) tdbb->tdbb_request + node->nod_impure);
1126 SBM_reset(&impure->inv_bitmap);
1127 desc = EVL_expr(tdbb, node->nod_arg[0]);
1128 - id = 1 + 2 * (USHORT) node->nod_arg[1];
1129 + id = 1 + 2 * (USHORT)(IPTR) node->nod_arg[1];
1130 numbers = desc->dsc_address;
1131 numbers += id * sizeof(SLONG);
1132 MOVE_FAST(numbers, &rel_dbkey, sizeof(SLONG));
1133 @@ -828,10 +828,10 @@
1135 message = node->nod_arg[e_arg_message];
1136 format = (FMT) message->nod_arg[e_msg_format];
1137 - desc = &format->fmt_desc[(int) node->nod_arg[e_arg_number]];
1138 + desc = &format->fmt_desc[(int)(IPTR) node->nod_arg[e_arg_number]];
1140 impure->vlu_desc.dsc_address = (UCHAR *) request +
1141 - message->nod_impure + (int) desc->dsc_address;
1142 + message->nod_impure + (int)(IPTR) desc->dsc_address;
1143 impure->vlu_desc.dsc_dtype = desc->dsc_dtype;
1144 impure->vlu_desc.dsc_length = desc->dsc_length;
1145 impure->vlu_desc.dsc_scale = desc->dsc_scale;
1146 @@ -851,14 +851,14 @@
1150 - request->req_rpb[(int)node->nod_arg[e_fld_stream]].rpb_record;
1151 + request->req_rpb[(int)(IPTR)node->nod_arg[e_fld_stream]].rpb_record;
1152 /* In order to "map a null to a default" value (in EVL_field()),
1153 * the relation block is referenced.
1154 * Reference: Bug 10116, 10424
1156 - if (!EVL_field(request->req_rpb[(USHORT) node->nod_arg[e_fld_stream]].rpb_relation,
1157 + if (!EVL_field(request->req_rpb[(USHORT)(IPTR) node->nod_arg[e_fld_stream]].rpb_relation,
1159 - (USHORT) node->nod_arg[e_fld_id],
1160 + (USHORT)(IPTR) node->nod_arg[e_fld_id],
1163 request->req_flags |= req_null;
1167 impure = (VLU) ((SCHAR *) request + node->nod_impure);
1168 - extract_part = (ULONG) node->nod_arg[e_extract_part];
1169 + extract_part = (ULONG)(IPTR) node->nod_arg[e_extract_part];
1170 value = EVL_expr(tdbb, node->nod_arg[e_extract_value]);
1172 impure->vlu_desc.dsc_dtype = dtype_short;
1173 @@ -1173,8 +1173,8 @@
1175 switch (node->nod_type) {
1176 case nod_gen_id: /* return a 32-bit generator value */
1177 - impure->vlu_misc.vlu_long = (SLONG) DPM_gen_id(tdbb,
1179 + impure->vlu_misc.vlu_long = (SLONG)(IPTR) DPM_gen_id(tdbb,
1184 @@ -1189,7 +1189,7 @@
1187 impure->vlu_misc.vlu_int64 = DPM_gen_id(tdbb,
1190 node->nod_arg[e_gen_id],
1192 MOV_get_int64(values[0],
1193 @@ -1383,7 +1383,7 @@
1197 - desc->dsc_address = record->rec_data + (int) desc->dsc_address;
1198 + desc->dsc_address = record->rec_data + (int)(IPTR) desc->dsc_address;
1200 if (TEST_NULL(record, id)) {
1201 desc->dsc_flags |= DSC_null;
1202 @@ -1725,9 +1725,9 @@
1204 from = (*ptr)->nod_arg[e_asgn_from];
1205 field = (*ptr)->nod_arg[e_asgn_to];
1206 - id = (USHORT) field->nod_arg[e_fld_id];
1207 + id = (USHORT)(IPTR) field->nod_arg[e_fld_id];
1209 - request->req_rpb[(int) field->nod_arg[e_fld_stream]].rpb_record;
1210 + request->req_rpb[(int)(IPTR) field->nod_arg[e_fld_stream]].rpb_record;
1211 impure = (VLUX) ((SCHAR *) request + from->nod_impure);
1212 switch (from->nod_type)
1214 @@ -3395,7 +3395,7 @@
1216 request = tdbb->tdbb_request;
1217 impure = (VLU) ((SCHAR *) request + node->nod_impure);
1218 - rpb = &request->req_rpb[(int) node->nod_arg[0]];
1219 + rpb = &request->req_rpb[(int)(IPTR) node->nod_arg[0]];
1220 relation = rpb->rpb_relation;
1222 /* Format dbkey as vector of relation id, record number */
1223 @@ -4500,7 +4500,7 @@
1225 request = tdbb->tdbb_request;
1226 impure = (VLU) ((SCHAR *) request + node->nod_impure);
1227 - rpb = &request->req_rpb[(int) node->nod_arg[0]];
1228 + rpb = &request->req_rpb[(int)(IPTR) node->nod_arg[0]];
1230 /* If the current transaction has updated the record, the record version
1231 * coming in from DSQL will have the original transaction # (or current
1232 diff -ur firebird-1.5.3.4870-orig/src/jrd/exe.cpp firebird-1.5.3.4870/src/jrd/exe.cpp
1233 --- firebird-1.5.3.4870-orig/src/jrd/exe.cpp 2006-03-17 01:39:04.000000000 -0500
1234 +++ firebird-1.5.3.4870/src/jrd/exe.cpp 2006-03-17 01:32:29.000000000 -0500
1237 if (to->nod_type == nod_field)
1239 - SSHORT id = (USHORT) to->nod_arg[e_fld_id];
1240 - REC record = request->req_rpb[(int) to->nod_arg[e_fld_stream]].rpb_record;
1241 + SSHORT id = (USHORT)(IPTR) to->nod_arg[e_fld_id];
1242 + REC record = request->req_rpb[(int)(IPTR) to->nod_arg[e_fld_stream]].rpb_record;
1244 SET_NULL(record, id);
1247 message = request->req_message;
1248 format = (FMT) message->nod_arg[e_msg_format];
1250 - if (msg != (USHORT) message->nod_arg[e_msg_number])
1251 + if (msg != (USHORT)(IPTR) message->nod_arg[e_msg_number])
1252 ERR_post(gds_req_sync, 0);
1254 if (length != format->fmt_length)
1256 for (ptr = node->nod_arg, end = ptr + node->nod_count; ptr < end;
1258 message = (*ptr)->nod_arg[e_send_message];
1259 - if ((USHORT) message->nod_arg[e_msg_number] == msg) {
1260 + if ((USHORT)(IPTR) message->nod_arg[e_msg_number] == msg) {
1261 request->req_next = *ptr;
1266 format = (FMT) message->nod_arg[e_msg_format];
1268 - if (msg != (USHORT) message->nod_arg[e_msg_number])
1269 + if (msg != (USHORT)(IPTR) message->nod_arg[e_msg_number])
1270 ERR_post(gds_req_sync, 0);
1272 if (length != format->fmt_length)
1273 @@ -1049,7 +1049,7 @@
1274 desc = &format->fmt_desc[n];
1275 if (!desc->dsc_address)
1277 - p = record->rec_data + (SLONG) desc->dsc_address;
1278 + p = record->rec_data + (SLONG)(IPTR) desc->dsc_address;
1279 if (TEST_NULL(record, n))
1281 if (length = desc->dsc_length)
1282 @@ -1134,7 +1134,7 @@
1284 request = tdbb->tdbb_request;
1285 transaction = request->req_transaction;
1286 - rpb = &request->req_rpb[(int) node->nod_arg[e_erase_stream]];
1287 + rpb = &request->req_rpb[(int)(IPTR) node->nod_arg[e_erase_stream]];
1288 relation = rpb->rpb_relation;
1291 @@ -2015,7 +2015,7 @@
1292 case jrd_req::req_evaluate:
1293 if (transaction != dbb->dbb_sys_trans) {
1295 - UCHAR operation = (UCHAR) node->nod_arg[e_sav_operation];
1296 + UCHAR operation = (UCHAR)(IPTR) node->nod_arg[e_sav_operation];
1297 TEXT * node_savepoint_name = (TEXT*) node->nod_arg[e_sav_name];
1299 // Skip the savepoint created by EXE_start
1300 @@ -2328,7 +2328,7 @@
1303 case jrd_req::req_unwind:
1304 - if ((request->req_label == (USHORT) node->nod_arg[e_lbl_label]) &&
1305 + if ((request->req_label == (USHORT)(IPTR) node->nod_arg[e_lbl_label]) &&
1306 (request->req_flags & (req_leave | req_error_handler))) {
1307 request->req_flags &= ~req_leave;
1308 request->req_operation = jrd_req::req_return;
1309 @@ -2342,7 +2342,7 @@
1311 request->req_flags |= req_leave;
1312 request->req_operation = jrd_req::req_unwind;
1313 - request->req_label = (USHORT) node->nod_arg[0];
1314 + request->req_label = (USHORT)(IPTR) node->nod_arg[0];
1315 node = node->nod_parent;
1318 @@ -2652,7 +2652,7 @@
1321 desc = EVL_expr(tdbb, node->nod_arg[e_gen_value]);
1322 - (void) DPM_gen_id(tdbb, (SLONG) node->nod_arg[e_gen_id], 1,
1323 + (void) DPM_gen_id(tdbb, (SLONG)(IPTR) node->nod_arg[e_gen_id], 1,
1324 MOV_get_int64(desc, 0));
1325 request->req_operation = jrd_req::req_return;
1327 @@ -2664,7 +2664,7 @@
1330 desc = EVL_expr(tdbb, node->nod_arg[e_gen_value]);
1331 - (void) DPM_gen_id(tdbb, (SLONG) node->nod_arg[e_gen_id], 1,
1332 + (void) DPM_gen_id(tdbb, (SLONG)(IPTR) node->nod_arg[e_gen_id], 1,
1333 MOV_get_int64(desc, 0));
1334 request->req_operation = jrd_req::req_return;
1336 @@ -2794,11 +2794,11 @@
1337 transaction = request->req_transaction;
1338 impure = (STA) ((SCHAR *) request + node->nod_impure);
1340 - org_stream = (USHORT) node->nod_arg[e_mod_org_stream];
1341 + org_stream = (USHORT)(IPTR) node->nod_arg[e_mod_org_stream];
1342 org_rpb = &request->req_rpb[org_stream];
1343 relation = org_rpb->rpb_relation;
1345 - new_stream = (USHORT) node->nod_arg[e_mod_new_stream];
1346 + new_stream = (USHORT)(IPTR) node->nod_arg[e_mod_new_stream];
1347 new_rpb = &request->req_rpb[new_stream];
1350 @@ -3795,7 +3795,7 @@
1351 JRD_REQ request = tdbb->tdbb_request;
1352 JRD_TRA transaction = request->req_transaction;
1353 STA impure = (STA) ((SCHAR *) request + node->nod_impure);
1354 - SSHORT stream = (USHORT) node->nod_arg[e_sto_relation]->nod_arg[e_rel_stream];
1355 + SSHORT stream = (USHORT)(IPTR) node->nod_arg[e_sto_relation]->nod_arg[e_rel_stream];
1356 RPB* rpb = &request->req_rpb[stream];
1357 JRD_REL relation = rpb->rpb_relation;
1359 @@ -4201,8 +4201,8 @@
1361 if (node->nod_type == nod_field)
1363 - stream = (USHORT) node->nod_arg[e_fld_stream];
1364 - id = (USHORT) node->nod_arg[e_fld_id];
1365 + stream = (USHORT)(IPTR) node->nod_arg[e_fld_stream];
1366 + id = (USHORT)(IPTR) node->nod_arg[e_fld_id];
1367 relation = request->req_rpb[stream].rpb_relation;
1369 if ((vector = relation->rel_fields) &&
1370 diff -ur firebird-1.5.3.4870-orig/src/jrd/ext.cpp firebird-1.5.3.4870/src/jrd/ext.cpp
1371 --- firebird-1.5.3.4870-orig/src/jrd/ext.cpp 2006-03-17 01:39:04.000000000 -0500
1372 +++ firebird-1.5.3.4870/src/jrd/ext.cpp 2006-03-17 01:32:29.000000000 -0500
1374 record = rpb->rpb_record;
1375 format = record->rec_format;
1377 - offset = (SSHORT) format->fmt_desc[0].dsc_address;
1378 + offset = (SSHORT)(IPTR) format->fmt_desc[0].dsc_address;
1379 p = record->rec_data + offset;
1380 l = record->rec_length - offset;
1384 if ( (literal = (LIT) field->fld_missing_value) ) {
1386 - desc.dsc_address = record->rec_data + (int) desc.dsc_address;
1387 + desc.dsc_address = record->rec_data + (int)(IPTR) desc.dsc_address;
1388 if (!MOV_compare(&literal->lit_desc, &desc))
1392 desc_ptr->dsc_length &&
1393 TEST_NULL(record, i))
1395 - p = record->rec_data + (int) desc_ptr->dsc_address;
1396 + p = record->rec_data + (int)(IPTR) desc_ptr->dsc_address;
1397 if ( (literal = (LIT) field->fld_missing_value) ) {
1399 desc.dsc_address = p;
1404 - offset = (USHORT) format->fmt_desc[0].dsc_address;
1405 + offset = (USHORT)(IPTR) format->fmt_desc[0].dsc_address;
1406 p = record->rec_data + offset;
1407 l = record->rec_length - offset;
1409 diff -ur firebird-1.5.3.4870-orig/src/jrd/gds.cpp firebird-1.5.3.4870/src/jrd/gds.cpp
1410 --- firebird-1.5.3.4870-orig/src/jrd/gds.cpp 2006-03-17 01:39:04.000000000 -0500
1411 +++ firebird-1.5.3.4870/src/jrd/gds.cpp 2006-03-17 01:32:30.000000000 -0500
1412 @@ -2304,7 +2304,7 @@
1416 - if (!(result = ib_fdopen((int) result, "w+")))
1417 + if (!(result = ib_fdopen((int)(IPTR) result, "w+")))
1420 if (expanded_string)
1421 diff -ur firebird-1.5.3.4870-orig/src/jrd/idx.cpp firebird-1.5.3.4870/src/jrd/idx.cpp
1422 --- firebird-1.5.3.4870-orig/src/jrd/idx.cpp 2006-03-17 01:39:04.000000000 -0500
1423 +++ firebird-1.5.3.4870/src/jrd/idx.cpp 2006-03-17 01:32:30.000000000 -0500
1424 @@ -1055,12 +1055,12 @@
1425 index_number < idx->idx_foreign_primaries->count();
1428 - (UCHAR) (*idx->idx_foreign_primaries)[index_number]) continue;
1429 + (UCHAR)(IPTR) (*idx->idx_foreign_primaries)[index_number]) continue;
1432 - (int) (*idx->idx_foreign_relations)[index_number]);
1433 + (int)(IPTR) (*idx->idx_foreign_relations)[index_number]);
1435 - (USHORT) (*idx->idx_foreign_indexes)[index_number];
1436 + (USHORT)(IPTR) (*idx->idx_foreign_indexes)[index_number];
1438 check_partner_index(tdbb, relation, record, transaction, idx,
1439 partner_relation, index_id)) )
1440 diff -ur firebird-1.5.3.4870-orig/src/jrd/inf.cpp firebird-1.5.3.4870/src/jrd/inf.cpp
1441 --- firebird-1.5.3.4870-orig/src/jrd/inf.cpp 2006-03-17 01:39:04.000000000 -0500
1442 +++ firebird-1.5.3.4870/src/jrd/inf.cpp 2006-03-17 01:32:30.000000000 -0500
1444 node = request->req_message;
1445 if (item == gds_info_message_number)
1447 - INF_convert((SLONG) node->nod_arg[e_msg_number],
1448 + INF_convert((SLONG)(IPTR) node->nod_arg[e_msg_number],
1451 format = (FMT) node->nod_arg[e_msg_format];
1452 diff -ur firebird-1.5.3.4870-orig/src/jrd/met.epp firebird-1.5.3.4870/src/jrd/met.epp
1453 --- firebird-1.5.3.4870-orig/src/jrd/met.epp 2006-03-17 01:39:04.000000000 -0500
1454 +++ firebird-1.5.3.4870/src/jrd/met.epp 2006-03-17 01:32:31.000000000 -0500
1456 if (desc->dsc_address)
1458 format->fmt_length =
1459 - (ULONG) desc->dsc_address + desc->dsc_length;
1460 + (ULONG)(IPTR) desc->dsc_address + desc->dsc_length;
1464 @@ -2133,13 +2133,13 @@
1465 index_number < references->frgn_reference_ids->count();
1468 - if (idx->idx_id == (UCHAR) (*references->frgn_reference_ids)
1469 + if (idx->idx_id == (UCHAR)(IPTR) (*references->frgn_reference_ids)
1472 idx->idx_primary_relation =
1473 - (USHORT) (*references->frgn_relations)[index_number];
1474 + (USHORT)(IPTR) (*references->frgn_relations)[index_number];
1475 idx->idx_primary_index =
1476 - (UCHAR) (*references->frgn_indexes)[index_number];
1477 + (UCHAR)(IPTR) (*references->frgn_indexes)[index_number];
1481 @@ -2155,7 +2155,7 @@
1482 index_number < dependencies->prim_reference_ids->count();
1485 - if (idx->idx_id == (UCHAR) (*dependencies->prim_reference_ids)
1486 + if (idx->idx_id == (UCHAR)(IPTR) (*dependencies->prim_reference_ids)
1489 idx->idx_foreign_primaries =
1490 @@ -3001,10 +3001,10 @@
1492 if ( (node = csb_->csb_rpt[i].csb_message) )
1494 - if ((int) node->nod_arg[e_msg_number] == 0)
1495 + if ((int)(IPTR) node->nod_arg[e_msg_number] == 0)
1497 procedure->prc_input_msg = node;
1498 - } else if ((int) node->nod_arg[e_msg_number] == 1)
1499 + } else if ((int)(IPTR) node->nod_arg[e_msg_number] == 1)
1501 procedure->prc_output_msg = node;
1503 @@ -4580,7 +4580,7 @@
1504 node = (JRD_NOD) LLS_POP(&csb->csb_dependencies);
1505 if (!node->nod_arg[e_dep_object])
1507 - dpdo_type = (SSHORT) node->nod_arg[e_dep_object_type];
1508 + dpdo_type = (SSHORT)(IPTR) node->nod_arg[e_dep_object_type];
1511 switch (dpdo_type) {
1512 @@ -4593,13 +4593,13 @@
1513 dpdo_name = (TEXT*) procedure->prc_name->str_data;
1516 - number = (SLONG) node->nod_arg [e_dep_object];
1517 + number = (SLONG)(IPTR) node->nod_arg [e_dep_object];
1518 MET_lookup_exception (tdbb, number, name, NULL);
1521 /* CVC: Here I'm going to track those pesky things named generators and UDFs. */
1523 - number = (SLONG) node->nod_arg [e_dep_object];
1524 + number = (SLONG)(IPTR) node->nod_arg [e_dep_object];
1525 MET_lookup_generator_id (tdbb, number, name);
1528 @@ -4617,7 +4617,7 @@
1530 if (field_node->nod_type == nod_field)
1532 - fld_id = (SSHORT) field_node->nod_arg[0];
1533 + fld_id = (SSHORT)(IPTR) field_node->nod_arg[0];
1536 if ( (field = MET_get_field(relation, fld_id)) )
1537 diff -ur firebird-1.5.3.4870-orig/src/jrd/opt.cpp firebird-1.5.3.4870/src/jrd/opt.cpp
1538 --- firebird-1.5.3.4870-orig/src/jrd/opt.cpp 2006-03-17 01:39:04.000000000 -0500
1539 +++ firebird-1.5.3.4870/src/jrd/opt.cpp 2006-03-17 01:32:31.000000000 -0500
1542 if (node->nod_type != nod_rse)
1544 - stream = (USHORT) node->nod_arg[STREAM_INDEX(node)];
1545 + stream = (USHORT)(IPTR) node->nod_arg[STREAM_INDEX(node)];
1546 assert(stream <= MAX_UCHAR);
1547 assert(beds[0] < MAX_STREAMS && beds[0] < MAX_UCHAR);
1548 beds[++beds[0]] = (UCHAR) stream;
1550 (USHORT) (key_streams[0] - i));
1551 assert(local_streams[0] < MAX_STREAMS && local_streams[0] < MAX_UCHAR);
1552 local_streams[++local_streams[0]] =
1553 - (UCHAR) node->nod_arg[e_uni_stream];
1554 + (UCHAR)(IPTR) node->nod_arg[e_uni_stream];
1556 else if (node->nod_type == nod_aggregate) {
1557 assert((int)node->nod_arg[e_agg_stream] <= MAX_STREAMS);
1558 @@ -408,13 +408,13 @@
1559 rsb = gen_aggregate(tdbb, opt_, node);
1560 assert(local_streams[0] < MAX_STREAMS && local_streams[0] < MAX_UCHAR);
1561 local_streams[++local_streams[0]] =
1562 - (UCHAR) node->nod_arg[e_agg_stream];
1563 + (UCHAR)(IPTR) node->nod_arg[e_agg_stream];
1565 else if (node->nod_type == nod_procedure) {
1566 rsb = gen_procedure(tdbb, opt_, node);
1567 assert(local_streams[0] < MAX_STREAMS && local_streams[0] < MAX_UCHAR);
1568 local_streams[++local_streams[0]] =
1569 - (UCHAR) node->nod_arg[e_prc_stream];
1570 + (UCHAR)(IPTR) node->nod_arg[e_prc_stream];
1572 else if (node->nod_type == nod_rse) {
1573 compute_rse_streams(csb, (RSE) node, beds);
1576 /* Make sure we have the correct stream */
1578 - if ((USHORT) dbkey->nod_arg[0] != stream)
1579 + if ((USHORT)(IPTR) dbkey->nod_arg[0] != stream)
1582 /* If this is a dbkey for the appropriate stream, it's invertable */
1583 @@ -1687,7 +1687,7 @@
1584 switch (node->nod_type) {
1587 - n = (USHORT) node->nod_arg[e_fld_stream];
1588 + n = (USHORT)(IPTR) node->nod_arg[e_fld_stream];
1590 if (allowOnlyCurrentStream) {
1592 @@ -1713,7 +1713,7 @@
1596 - n = (USHORT) node->nod_arg[0];
1597 + n = (USHORT)(IPTR) node->nod_arg[0];
1599 if (allowOnlyCurrentStream) {
1601 @@ -1784,7 +1784,7 @@
1603 for (ptr = rse->rse_relation, end = ptr + rse->rse_count; ptr < end; ptr++) {
1604 if ((*ptr)->nod_type != nod_rse) {
1605 - n = (USHORT) (*ptr)->nod_arg[STREAM_INDEX((*ptr))];
1606 + n = (USHORT)(IPTR) (*ptr)->nod_arg[STREAM_INDEX((*ptr))];
1607 csb->csb_rpt[n].csb_flags |= csb_active;
1610 @@ -1821,7 +1821,7 @@
1612 if ((*ptr)->nod_type != nod_rse)
1614 - n = (USHORT) (*ptr)->nod_arg[STREAM_INDEX((*ptr))];
1615 + n = (USHORT)(IPTR) (*ptr)->nod_arg[STREAM_INDEX((*ptr))];
1616 csb->csb_rpt[n].csb_flags &= ~csb_active;
1619 @@ -1862,12 +1862,12 @@
1621 switch (node->nod_type) {
1623 - n = (USHORT) node->nod_arg[e_fld_stream];
1624 + n = (USHORT)(IPTR) node->nod_arg[e_fld_stream];
1625 SET_DEP_BIT(dependencies, n);
1629 - n = (USHORT) node->nod_arg[0];
1630 + n = (USHORT)(IPTR) node->nod_arg[0];
1631 SET_DEP_BIT(dependencies, n);
1634 @@ -1923,7 +1923,7 @@
1636 for (ptr = rse->rse_relation, end = ptr + rse->rse_count; ptr < end; ptr++) {
1637 if ((*ptr)->nod_type != nod_rse) {
1638 - n = (USHORT) (*ptr)->nod_arg[STREAM_INDEX((*ptr))];
1639 + n = (USHORT)(IPTR) (*ptr)->nod_arg[STREAM_INDEX((*ptr))];
1640 CLEAR_DEP_BIT(dependencies, n);
1643 @@ -1951,7 +1951,7 @@
1645 if (node->nod_type == nod_relation) {
1646 assert(streams[0] < MAX_STREAMS && streams[0] < MAX_UCHAR);
1647 - streams[++streams[0]] = (UCHAR) node->nod_arg[e_rel_stream];
1648 + streams[++streams[0]] = (UCHAR)(IPTR) node->nod_arg[e_rel_stream];
1650 else if (node->nod_type == nod_union) {
1651 clauses = node->nod_arg[e_uni_clauses];
1652 @@ -1991,7 +1991,7 @@
1654 if (node->nod_type != nod_rse) {
1655 assert(streams[0] < MAX_STREAMS && streams[0] < MAX_UCHAR);
1656 - streams[++streams[0]] = (UCHAR) node->nod_arg[STREAM_INDEX(node)];
1657 + streams[++streams[0]] = (UCHAR)(IPTR) node->nod_arg[STREAM_INDEX(node)];
1660 compute_rse_streams(csb, (RSE) node, streams);
1661 @@ -3289,7 +3289,7 @@
1662 JRD_NOD dbkey_temp, *ptr, *end;
1663 DEV_BLKCHK(dbkey, type_nod);
1664 if (dbkey->nod_type == nod_dbkey) {
1665 - if ((USHORT) dbkey->nod_arg[0] == stream)
1666 + if ((USHORT)(IPTR) dbkey->nod_arg[0] == stream)
1669 *position = *position + 1;
1670 @@ -3550,7 +3550,7 @@
1673 relation_node = plan_node->nod_arg[e_retrieve_relation];
1674 - temp[temp[0]] = (UCHAR) relation_node->nod_arg[e_rel_stream];
1675 + temp[temp[0]] = (UCHAR)(IPTR) relation_node->nod_arg[e_rel_stream];
1678 // just because the user specified a join does not mean that
1679 @@ -3724,7 +3724,7 @@
1680 rsb->rsb_type = rsb_aggregate;
1681 assert((int)node->nod_arg[e_agg_stream] <= MAX_STREAMS);
1682 assert((int)node->nod_arg[e_agg_stream] <= MAX_UCHAR);
1683 - rsb->rsb_stream = (UCHAR) node->nod_arg[e_agg_stream];
1684 + rsb->rsb_stream = (UCHAR)(IPTR) node->nod_arg[e_agg_stream];
1685 rsb->rsb_format = csb->csb_rpt[rsb->rsb_stream].csb_format;
1686 rsb->rsb_next = OPT_compile(tdbb, csb, rse, NULL);
1687 rsb->rsb_arg[0] = (RSB) node;
1688 @@ -4088,8 +4088,8 @@
1689 idx->idx_rpt; ptr < end; ptr++, idx_tail++) {
1691 if (node->nod_type != nod_field
1692 - || (USHORT) node->nod_arg[e_fld_stream] != stream
1693 - || (USHORT) node->nod_arg[e_fld_id] != idx_tail->idx_field
1694 + || (USHORT)(IPTR) node->nod_arg[e_fld_stream] != stream
1695 + || (USHORT)(IPTR) node->nod_arg[e_fld_id] != idx_tail->idx_field
1696 || ptr[2*sort->nod_count] /* do not use index if NULLS FIRST is used */
1697 #ifdef SCROLLABLE_CURSORS
1699 @@ -4249,7 +4249,7 @@
1701 stream_ptr[i]->stream_rsb = NULL;
1702 stream_ptr[i]->stream_num =
1703 - (USHORT) node->nod_arg[STREAM_INDEX(node)];
1704 + (USHORT)(IPTR) node->nod_arg[STREAM_INDEX(node)];
1708 @@ -4327,10 +4327,10 @@
1711 procedure = MET_lookup_procedure_id(tdbb,
1712 - (SSHORT)node->nod_arg[e_prc_procedure], FALSE, FALSE, 0);
1713 + (SSHORT)(IPTR)node->nod_arg[e_prc_procedure], FALSE, FALSE, 0);
1714 rsb = FB_NEW_RPT(*tdbb->tdbb_default, RSB_PRC_count) Rsb();
1715 rsb->rsb_type = rsb_procedure;
1716 - rsb->rsb_stream = (UCHAR) node->nod_arg[e_prc_stream];
1717 + rsb->rsb_stream = (UCHAR)(IPTR) node->nod_arg[e_prc_stream];
1718 rsb->rsb_procedure = procedure;
1719 rsb->rsb_format = procedure->prc_format;
1720 rsb->rsb_impure = CMP_impure(csb, sizeof(struct irsb_procedure));
1721 @@ -4943,8 +4943,8 @@
1722 for (node_ptr = sort->nod_arg; node_ptr < end_node; node_ptr++) {
1724 if (node->nod_type == nod_field
1725 - && (USHORT) node->nod_arg[e_fld_stream] == *ptr
1726 - && (USHORT) node->nod_arg[e_fld_id] == id) {
1727 + && (USHORT)(IPTR) node->nod_arg[e_fld_stream] == *ptr
1728 + && (USHORT)(IPTR) node->nod_arg[e_fld_id] == id) {
1730 CMP_get_desc(tdbb, csb, node, desc);
1731 /* International type text has a computed key */
1732 @@ -5041,8 +5041,8 @@
1733 map_item->smb_desc.dsc_address = (UCHAR *) map_length;
1734 map_length += desc->dsc_length;
1735 if (node->nod_type == nod_field) {
1736 - map_item->smb_stream = (USHORT) node->nod_arg[e_fld_stream];
1737 - map_item->smb_field_id = (USHORT) node->nod_arg[e_fld_id];
1738 + map_item->smb_stream = (USHORT)(IPTR) node->nod_arg[e_fld_stream];
1739 + map_item->smb_field_id = (USHORT)(IPTR) node->nod_arg[e_fld_id];
1743 @@ -5054,8 +5054,8 @@
1744 field has already been mentioned as a sort key, don't bother to repeat
1746 while (stream_stack) {
1747 - id = (USHORT) LLS_POP(&id_stack);
1748 - stream = (USHORT) LLS_POP(&stream_stack);
1749 + id = (USHORT)(IPTR) LLS_POP(&id_stack);
1750 + stream = (USHORT)(IPTR) LLS_POP(&stream_stack);
1751 format = CMP_format(tdbb, csb, stream);
1752 desc = &format->fmt_desc[id];
1753 if (id >= format->fmt_count || desc->dsc_length == 0)
1754 @@ -5384,7 +5384,7 @@
1755 rsb = FB_NEW_RPT(*tdbb->tdbb_default, count + nstreams + 1) Rsb();
1756 rsb->rsb_type = rsb_union;
1757 rsb->rsb_count = count;
1758 - rsb->rsb_stream = (UCHAR) union_node->nod_arg[e_uni_stream];
1759 + rsb->rsb_stream = (UCHAR)(IPTR) union_node->nod_arg[e_uni_stream];
1760 rsb->rsb_format = csb->csb_rpt[rsb->rsb_stream].csb_format;
1761 rsb->rsb_impure = CMP_impure(csb, sizeof(struct irsb));
1762 rsb_ptr = rsb->rsb_arg;
1763 @@ -5926,8 +5926,8 @@
1764 field = boolean->nod_arg[0];
1765 if (field->nod_type != nod_field)
1767 - if ((USHORT) field->nod_arg[e_fld_stream] != stream ||
1768 - (USHORT) field->nod_arg[e_fld_id] != idx->idx_rpt[0].idx_field)
1769 + if ((USHORT)(IPTR) field->nod_arg[e_fld_stream] != stream ||
1770 + (USHORT)(IPTR) field->nod_arg[e_fld_id] != idx->idx_rpt[0].idx_field)
1772 node = make_index_node(tdbb, relation, opt->opt_csb, idx);
1773 retrieval = (IRB) node->nod_arg[e_idx_retrieval];
1774 @@ -5995,8 +5995,8 @@
1778 - if ((USHORT) field->nod_arg[e_fld_stream] != stream ||
1779 - (USHORT) field->nod_arg[e_fld_id] != idx->idx_rpt[0].idx_field
1780 + if ((USHORT)(IPTR) field->nod_arg[e_fld_stream] != stream ||
1781 + (USHORT)(IPTR) field->nod_arg[e_fld_id] != idx->idx_rpt[0].idx_field
1782 || !(idx->idx_rpt[0].idx_itype == idx_string
1783 || idx->idx_rpt[0].idx_itype == idx_byte_array
1784 || idx->idx_rpt[0].idx_itype == idx_metadata
1785 @@ -6094,10 +6094,10 @@
1787 for (arg = access_type->nod_arg, end = arg + plan_count;
1788 arg < end; arg += 3) {
1789 - if (relation_id != (SSHORT) * arg)
1790 + if (relation_id != (SSHORT)(IPTR) * arg)
1791 /* index %s cannot be used in the specified plan */
1792 ERR_post(gds_index_unused, gds_arg_string, *(arg + 2), 0);
1793 - if (idx->idx_id == (USHORT) * (arg + 1))
1794 + if (idx->idx_id == (USHORT)(IPTR) * (arg + 1))
1795 if (access_type->nod_type == nod_navigational)
1796 idx->idx_runtime_flags |= idx_plan_navigate;
1797 else /* nod_indices */
1798 @@ -6169,13 +6169,13 @@
1799 If left side is still not a field, give up */
1801 if (match->nod_type != nod_field ||
1802 - (USHORT) match->nod_arg[e_fld_stream] != stream ||
1803 + (USHORT)(IPTR) match->nod_arg[e_fld_stream] != stream ||
1804 !computable(opt->opt_csb, value, stream, true, false))
1807 value = boolean->nod_arg[0];
1808 if (match->nod_type != nod_field ||
1809 - (USHORT) match->nod_arg[e_fld_stream] != stream ||
1810 + (USHORT)(IPTR) match->nod_arg[e_fld_stream] != stream ||
1811 !computable(opt->opt_csb, value, stream, true, false))
1814 @@ -6194,7 +6194,7 @@
1815 #ifdef EXPRESSION_INDICES
1816 (idx->idx_expression ||
1818 - ((USHORT) match->nod_arg[e_fld_id] == idx->idx_rpt[i].idx_field)
1819 + ((USHORT)(IPTR) match->nod_arg[e_fld_id] == idx->idx_rpt[i].idx_field)
1820 #ifdef EXPRESSION_INDICES
1823 @@ -6582,7 +6582,7 @@
1825 for (streams = river->riv_streams, end =
1826 streams + river->riv_count; streams < end; streams++)
1827 - if ((USHORT) node->nod_arg[e_fld_stream] == *streams)
1828 + if ((USHORT)(IPTR) node->nod_arg[e_fld_stream] == *streams)
1832 @@ -6779,7 +6779,7 @@
1835 if (node->nod_type != nod_rse) {
1836 - stream = (USHORT) node->nod_arg[STREAM_INDEX(node)];
1837 + stream = (USHORT)(IPTR) node->nod_arg[STREAM_INDEX(node)];
1838 csb->csb_rpt[stream].csb_flags &= ~csb_active;
1841 diff -ur firebird-1.5.3.4870-orig/src/jrd/par.cpp firebird-1.5.3.4870/src/jrd/par.cpp
1842 --- firebird-1.5.3.4870-orig/src/jrd/par.cpp 2006-03-17 01:39:04.000000000 -0500
1843 +++ firebird-1.5.3.4870/src/jrd/par.cpp 2006-03-17 01:32:31.000000000 -0500
1844 @@ -2518,7 +2518,7 @@
1845 node->nod_arg[e_agg_rse] = parse(tdbb, csb, TYPE_RSE);
1846 node->nod_arg[e_agg_group] = parse(tdbb, csb, OTHER);
1847 node->nod_arg[e_agg_map] =
1848 - par_map(tdbb, csb, (USHORT) node->nod_arg[e_agg_stream]);
1849 + par_map(tdbb, csb, (USHORT)(IPTR) node->nod_arg[e_agg_stream]);
1853 diff -ur firebird-1.5.3.4870-orig/src/jrd/rse.cpp firebird-1.5.3.4870/src/jrd/rse.cpp
1854 --- firebird-1.5.3.4870-orig/src/jrd/rse.cpp 2006-03-17 01:39:04.000000000 -0500
1855 +++ firebird-1.5.3.4870/src/jrd/rse.cpp 2006-03-17 01:32:31.000000000 -0500
1857 /* Initialize the record number of each stream in the union */
1859 ptr = &rsb->rsb_arg[rsb->rsb_count];
1860 - for (end = ptr + (USHORT) * ptr; ++ptr <= end;)
1861 - request->req_rpb[(USHORT) * ptr].rpb_number = -1;
1862 + for (end = ptr + (USHORT)(IPTR) * ptr; ++ptr <= end;)
1863 + request->req_rpb[(USHORT)(IPTR) * ptr].rpb_number = -1;
1865 rsb = rsb->rsb_arg[0];
1867 @@ -2914,7 +2914,7 @@
1868 request = tdbb->tdbb_request;
1869 stack = (LLS) rsb->rsb_arg[streams];
1870 for (; stack; stack = stack->lls_next) {
1871 - rpb = &request->req_rpb[(USHORT) stack->lls_object];
1872 + rpb = &request->req_rpb[(USHORT)(IPTR) stack->lls_object];
1874 /* Make sure a record block has been allocated. If there isn't
1875 one, first find the format, then allocate the record block */
1876 @@ -2972,7 +2972,7 @@
1877 list that contains the data to send back
1879 if (IS_INTL_DATA(&item->smb_desc) &&
1880 - (USHORT) item->smb_desc.dsc_address <
1881 + (USHORT)(IPTR) item->smb_desc.dsc_address <
1882 map->smb_key_length * sizeof(ULONG)) continue;
1884 rpb = &request->req_rpb[item->smb_stream];
1885 @@ -3238,7 +3238,7 @@
1886 the sort record, then want to sort by language dependent order */
1888 if (IS_INTL_DATA(&item->smb_desc) &&
1889 - (USHORT) item->smb_desc.dsc_address <
1890 + (USHORT)(IPTR) item->smb_desc.dsc_address <
1891 map->smb_key_length * sizeof(ULONG)) {
1892 INTL_string_to_key(tdbb, INTL_INDEX_TYPE(&item->smb_desc),
1894 diff -ur firebird-1.5.3.4870-orig/src/jrd/sdl.cpp firebird-1.5.3.4870/src/jrd/sdl.cpp
1895 --- firebird-1.5.3.4870-orig/src/jrd/sdl.cpp 2006-03-17 01:39:04.000000000 -0500
1896 +++ firebird-1.5.3.4870/src/jrd/sdl.cpp 2006-03-17 01:32:31.000000000 -0500
1899 element_desc = array_desc->ads_rpt[value].ads_desc;
1900 element_desc.dsc_address = (BLOB_PTR *) arg->sdl_arg_array +
1901 - (SLONG) element_desc.dsc_address +
1902 + (SLONG)(IPTR) element_desc.dsc_address +
1903 (array_desc->ads_element_length * subscript);
1905 /* Is this element within the array bounds? */
1906 diff -ur firebird-1.5.3.4870-orig/src/qli/command.cpp firebird-1.5.3.4870/src/qli/command.cpp
1907 --- firebird-1.5.3.4870-orig/src/qli/command.cpp 2006-03-17 01:39:04.000000000 -0500
1908 +++ firebird-1.5.3.4870/src/qli/command.cpp 2006-03-17 01:32:33.000000000 -0500
1909 @@ -311,32 +311,32 @@
1910 ptr = node->syn_arg;
1912 for (i = 0; i < node->syn_count; i++) {
1913 - foo = (USHORT) * ptr++;
1914 + foo = (USHORT)(IPTR) * ptr++;
1915 sw = (ENUM set_t) foo;
1919 - QLI_blr = (USHORT) value;
1920 + QLI_blr = (USHORT)(IPTR) value;
1923 case set_statistics:
1924 - QLI_statistics = (USHORT) value;
1925 + QLI_statistics = (USHORT)(IPTR) value;
1929 - QLI_name_columns = QLI_columns = (USHORT) value;
1930 + QLI_name_columns = QLI_columns = (USHORT)(IPTR) value;
1934 - QLI_lines = (USHORT) value;
1935 + QLI_lines = (USHORT)(IPTR) value;
1939 - QLI_semi = (USHORT) value;
1940 + QLI_semi = (USHORT)(IPTR) value;
1944 - QLI_echo = (USHORT) value;
1945 + QLI_echo = (USHORT)(IPTR) value;
1953 - QLI_count = (USHORT) value;
1954 + QLI_count = (USHORT)(IPTR) value;
1958 diff -ur firebird-1.5.3.4870-orig/src/qli/expand.cpp firebird-1.5.3.4870/src/qli/expand.cpp
1959 --- firebird-1.5.3.4870-orig/src/qli/expand.cpp 2006-03-17 01:39:04.000000000 -0500
1960 +++ firebird-1.5.3.4870/src/qli/expand.cpp 2006-03-17 01:32:33.000000000 -0500
1961 @@ -2220,7 +2220,7 @@
1962 for (i = 0; i < node->nod_count; i++) {
1964 if (expr->syn_type == nod_position) {
1965 - position = (USHORT) expr->syn_arg[0];
1966 + position = (USHORT)(IPTR) expr->syn_arg[0];
1967 if (!list || !position || position > list->nod_count)
1968 IBERROR(152); /* Msg152 invalid ORDER BY ordinal */
1969 item = (ITM) list->nod_arg[position - 1];
1970 diff -ur firebird-1.5.3.4870-orig/src/qli/meta.epp firebird-1.5.3.4870/src/qli/meta.epp
1971 --- firebird-1.5.3.4870-orig/src/qli/meta.epp 2006-03-17 01:39:04.000000000 -0500
1972 +++ firebird-1.5.3.4870/src/qli/meta.epp 2006-03-17 01:32:33.000000000 -0500
1973 @@ -3795,7 +3795,7 @@
1977 - privileges = (USHORT) node->syn_arg[s_grant_privileges];
1978 + privileges = (USHORT)(IPTR) node->syn_arg[s_grant_privileges];
1979 relation = (QLI_REL) node->syn_arg[s_grant_relation];
1980 relation->rel_database = database = setup_update(relation->rel_database);
1981 relation_name = relation->rel_symbol->sym_string;
1982 diff -Naur firebird-1.5.3.4870.old/src/alice/alice.cpp firebird-1.5.3.4870/src/alice/alice.cpp
1983 --- firebird-1.5.3.4870.old/src/alice/alice.cpp 2006-08-06 06:47:26.000000000 +0200
1984 +++ firebird-1.5.3.4870/src/alice/alice.cpp 2006-08-06 07:59:27.000000000 +0200
1986 ALICE_gfix( service->svc_argc,
1990 + (SLONG)(IPTR) service);
1992 // Mark service thread as finished.
1993 // If service is detached, cleanup memory being used by service.
1994 diff -Naur firebird-1.5.3.4870.old/src/burp/burp.cpp firebird-1.5.3.4870/src/burp/burp.cpp
1995 --- firebird-1.5.3.4870.old/src/burp/burp.cpp 2006-08-06 06:47:20.000000000 +0200
1996 +++ firebird-1.5.3.4870/src/burp/burp.cpp 2006-08-06 07:58:54.000000000 +0200
2000 exit_code = BURP_gbak(service->svc_argc, service->svc_argv,
2001 - output_netware, (SLONG) service);
2002 + output_netware, (SLONG) (IPTR) service);
2004 /* Mark service thread as finished. */
2005 /* If service is detached, cleanup memory being used by service. */
2006 diff -Naur firebird-1.5.3.4870.old/src/burp/canonical.cpp firebird-1.5.3.4870/src/burp/canonical.cpp
2007 --- firebird-1.5.3.4870.old/src/burp/canonical.cpp 2006-08-06 06:47:20.000000000 +0200
2008 +++ firebird-1.5.3.4870/src/burp/canonical.cpp 2006-08-06 07:54:25.000000000 +0200
2013 - p = buffer + (int) desc->dsc_address;
2014 + p = buffer + (int) (IPTR)desc->dsc_address;
2016 switch (desc->dsc_dtype)
2018 diff -Naur firebird-1.5.3.4870.old/src/dsql/ddl.cpp firebird-1.5.3.4870/src/dsql/ddl.cpp
2019 --- firebird-1.5.3.4870.old/src/dsql/ddl.cpp 2006-08-06 06:47:20.000000000 +0200
2020 +++ firebird-1.5.3.4870/src/dsql/ddl.cpp 2006-08-06 07:36:46.000000000 +0200
2021 @@ -1126,12 +1126,12 @@
2024 request->append_number(gds_dyn_trg_sequence,
2025 - (SSHORT)(SLONG) (constant ? constant->nod_arg[0] : 0));
2026 + (SSHORT)(SLONG)(IPTR) (constant ? constant->nod_arg[0] : 0));
2029 if ((constant = node->nod_arg[e_cnstr_type]) != NULL)
2031 - const SSHORT type = (SSHORT)(SLONG) constant->nod_arg[0];
2032 + const SSHORT type = (SSHORT)(SLONG)(IPTR) constant->nod_arg[0];
2033 request->append_number(gds_dyn_trg_type, type);
2036 @@ -1270,7 +1270,7 @@
2038 switch (element->nod_type) {
2039 case nod_file_length:
2040 - start = (SLONG) (element->nod_arg[0]) + 1;
2041 + start = (SLONG) (IPTR) (element->nod_arg[0]) + 1;
2045 @@ -1336,25 +1336,25 @@
2047 case nod_group_commit_wait:
2048 request->append_uchar(gds_dyn_log_group_commit_wait);
2049 - temp_long = (SLONG) (element->nod_arg[0]);
2050 + temp_long = (SLONG) (IPTR) (element->nod_arg[0]);
2051 request->append_ulong_with_length(temp_long);
2054 case nod_check_point_len:
2055 request->append_uchar(gds_dyn_log_check_point_length);
2056 - temp_long = (SLONG) (element->nod_arg[0]);
2057 + temp_long = (SLONG) (IPTR) (element->nod_arg[0]);
2058 request->append_ulong_with_length(temp_long);
2061 case nod_num_log_buffers:
2062 request->append_uchar(gds_dyn_log_num_of_buffers);
2063 - temp_short = (SSHORT)(SLONG) (element->nod_arg[0]);
2064 + temp_short = (SSHORT)(SLONG) (IPTR) (element->nod_arg[0]);
2065 request->append_ushort_with_length(temp_short);
2068 case nod_log_buffer_size:
2069 request->append_uchar(gds_dyn_log_buffer_size);
2070 - temp_short = (SSHORT)(SLONG) (element->nod_arg[0]);
2071 + temp_short = (SSHORT)(SLONG) (IPTR) (element->nod_arg[0]);
2072 request->append_ushort_with_length(temp_short);
2075 @@ -1637,11 +1637,11 @@
2076 request->append_number(gds_dyn_def_dimension, position);
2077 DSQL_NOD element = *ptr++;
2078 request->append_uchar(gds_dyn_dim_lower);
2079 - SLONG lrange = (SLONG) (element->nod_arg[0]);
2080 + SLONG lrange = (SLONG) (IPTR) (element->nod_arg[0]);
2081 request->append_ulong_with_length(lrange);
2083 request->append_uchar(gds_dyn_dim_upper);
2084 - SLONG hrange = (SLONG) (element->nod_arg[0]);
2085 + SLONG hrange = (SLONG) (IPTR) (element->nod_arg[0]);
2086 request->append_ulong_with_length(hrange);
2087 request->append_uchar(gds_dyn_end);
2088 if (lrange >= hrange)
2089 @@ -2062,9 +2062,9 @@
2090 request->append_cstring(gds_dyn_def_filter,
2091 ((STR) (ptr[e_filter_name]))->str_data);
2092 request->append_number(gds_dyn_filter_in_subtype,
2093 - (SSHORT)(SLONG) ((ptr[e_filter_in_type])->nod_arg[0]));
2094 + (SSHORT)(SLONG) (IPTR) ((ptr[e_filter_in_type])->nod_arg[0]));
2095 request->append_number(gds_dyn_filter_out_subtype,
2096 - (SSHORT)(SLONG) ((ptr[e_filter_out_type])->nod_arg[0]));
2097 + (SSHORT)(SLONG) (IPTR) ((ptr[e_filter_out_type])->nod_arg[0]));
2098 request->append_cstring(gds_dyn_func_entry_point,
2099 ((STR) (ptr[e_filter_entry_pt]))->str_data);
2100 request->append_cstring(gds_dyn_func_module_name,
2101 @@ -2670,16 +2670,16 @@
2102 gds_arg_gds, gds_dsql_shadow_number_err, 0);
2105 - request->append_number(gds_dyn_def_shadow, (SSHORT)(SLONG) (ptr[e_shadow_number]));
2106 + request->append_number(gds_dyn_def_shadow, (SSHORT)(SLONG) (IPTR) (ptr[e_shadow_number]));
2107 request->append_cstring(gds_dyn_def_file, ((STR) (ptr[e_shadow_name]))->str_data);
2108 request->append_number(gds_dyn_shadow_man_auto,
2109 - (SSHORT)(SLONG) ((ptr[e_shadow_man_auto])->nod_arg[0]));
2110 + (SSHORT)(SLONG) (IPTR) ((ptr[e_shadow_man_auto])->nod_arg[0]));
2111 request->append_number(gds_dyn_shadow_conditional,
2112 - (SSHORT)(SLONG) ((ptr[e_shadow_conditional])->nod_arg[0]));
2113 + (SSHORT)(SLONG) (IPTR) ((ptr[e_shadow_conditional])->nod_arg[0]));
2115 request->append_file_start(0);
2117 - SLONG length = (SLONG) ptr[e_shadow_length];
2118 + SLONG length = (SLONG) (IPTR) ptr[e_shadow_length];
2119 request->append_file_length(length);
2121 request->append_uchar(gds_dyn_end);
2122 @@ -2806,15 +2806,15 @@
2124 if (constant = node->nod_arg[e_trg_active])
2125 request->append_number(gds_dyn_trg_inactive,
2126 - (SSHORT)(SLONG) constant->nod_arg[0]);
2127 + (SSHORT)(SLONG) (IPTR) constant->nod_arg[0]);
2129 if (constant = node->nod_arg[e_trg_position])
2130 request->append_number(gds_dyn_trg_sequence,
2131 - (SSHORT)(SLONG) constant->nod_arg[0]);
2132 + (SSHORT)(SLONG) (IPTR) constant->nod_arg[0]);
2134 if (constant = node->nod_arg[e_trg_type]) {
2135 - request->append_number(gds_dyn_trg_type, (SSHORT)(SLONG) constant->nod_arg[0]);
2136 - trig_type = (USHORT)(ULONG) constant->nod_arg[0];
2137 + request->append_number(gds_dyn_trg_type, (SSHORT)(SLONG) (IPTR) constant->nod_arg[0]);
2138 + trig_type = (USHORT)(ULONG) (IPTR) constant->nod_arg[0];
2141 assert(node->nod_type == nod_mod_trigger);
2142 @@ -2893,7 +2893,7 @@
2143 for (DSQL_NOD* ptr = temp->nod_arg; ptr < end; ++ptr)
2145 DSQL_NOD message = *ptr;
2146 - SSHORT number = (SSHORT)(SLONG) message->nod_arg[e_msg_number];
2147 + SSHORT number = (SSHORT)(SLONG) (IPTR) message->nod_arg[e_msg_number];
2148 if (message->nod_type == nod_del_trigger_msg)
2150 request->append_number(gds_dyn_delete_trigger_msg, number);
2151 @@ -2954,7 +2954,7 @@
2152 // CVC: This is case of "returns <type> [by value|reference]"
2153 /* Some data types can not be returned as value */
2155 - if (((int)(SLONG) (ret_val_ptr[1]->nod_arg[0]) == FUN_value) &&
2156 + if (((int)(SLONG) (IPTR) (ret_val_ptr[1]->nod_arg[0]) == FUN_value) &&
2157 (field->fld_dtype == dtype_text ||
2158 field->fld_dtype == dtype_varying ||
2159 field->fld_dtype == dtype_cstring ||
2160 @@ -2998,7 +2998,7 @@
2161 // CVC: This is case of "returns parameter <N>"
2164 - position = (SSHORT)(SLONG) (ret_val_ptr[1]->nod_arg[0]);
2165 + position = (SSHORT)(SLONG) (IPTR) (ret_val_ptr[1]->nod_arg[0]);
2166 /* Function modifies an argument whose value is the function return value */
2168 if (!arguments || position > arguments->nod_count || position < 1) {
2169 @@ -3024,7 +3024,7 @@
2170 if (field->fld_dtype == dtype_blob)
2172 /* CVC: I need to test returning blobs by descriptor before allowing the change there. For now, I ignore the return type specification. */
2173 - BOOLEAN free_it = ((SSHORT)(SLONG) ret_val_ptr[1]->nod_arg[0] < 0);
2174 + BOOLEAN free_it = ((SSHORT)(SLONG) (IPTR) ret_val_ptr[1]->nod_arg[0] < 0);
2175 request->append_number(gds_dyn_def_function_arg, blob_position);
2176 request->append_number(gds_dyn_func_mechanism,
2177 (SSHORT)(SLONG) ((free_it ? -1 : 1) * FUN_blob_struct));
2178 @@ -3035,7 +3035,7 @@
2180 request->append_number(gds_dyn_def_function_arg, (SSHORT) 0);
2181 request->append_number(gds_dyn_func_mechanism,
2182 - (SSHORT)(SLONG) (ret_val_ptr[1]->nod_arg[0]));
2183 + (SSHORT)(SLONG) (IPTR) (ret_val_ptr[1]->nod_arg[0]));
2186 request->append_cstring(gds_dyn_function_name, udf_name);
2187 @@ -3070,7 +3070,7 @@
2188 request->append_number(gds_dyn_def_function_arg, (SSHORT) position);
2190 if (param_node [e_udf_param_type]) {
2191 - SSHORT arg_mechanism = (SSHORT)(SLONG) (param_node [e_udf_param_type]->nod_arg [0]);
2192 + SSHORT arg_mechanism = (SSHORT)(SLONG) (IPTR) (param_node [e_udf_param_type]->nod_arg [0]);
2193 request->append_number(gds_dyn_func_mechanism, arg_mechanism);
2195 else if (field->fld_dtype == dtype_blob) {
2196 @@ -3677,13 +3677,13 @@
2199 request->append_number(gds_dyn_trg_sequence,
2200 - (SSHORT)(SLONG) (constant ? constant->nod_arg[0] : 0));
2201 + (SSHORT)(SLONG) (IPTR) (constant ? constant->nod_arg[0] : 0));
2204 constant = node->nod_arg[e_cnstr_type];
2207 - trig_type = (USHORT)(ULONG) constant->nod_arg[0];
2208 + trig_type = (USHORT)(ULONG)(IPTR) constant->nod_arg[0];
2209 request->append_number(gds_dyn_trg_type, trig_type);
2212 @@ -4173,7 +4173,7 @@
2214 case nod_del_shadow:
2215 request->append_number(gds_dyn_delete_shadow,
2216 - (SSHORT)(SLONG) (node->nod_arg[0]));
2217 + (SSHORT)(SLONG) (IPTR) (node->nod_arg[0]));
2218 request->append_uchar(gds_dyn_end);
2221 @@ -4611,25 +4611,25 @@
2223 case nod_group_commit_wait:
2224 request->append_uchar(gds_dyn_log_group_commit_wait);
2225 - temp_long = (SLONG) (element->nod_arg[0]);
2226 + temp_long = (SLONG)(IPTR) (element->nod_arg[0]);
2227 request->append_ulong_with_length(temp_long);
2230 case nod_check_point_len:
2231 request->append_uchar(gds_dyn_log_check_point_length);
2232 - temp_long = (SLONG) (element->nod_arg[0]);
2233 + temp_long = (SLONG)(IPTR) (element->nod_arg[0]);
2234 request->append_ulong_with_length(temp_long);
2237 case nod_num_log_buffers:
2238 request->append_uchar(gds_dyn_log_num_of_buffers);
2239 - temp_short = (SSHORT)(SLONG) (element->nod_arg[0]);
2240 + temp_short = (SSHORT)(SLONG)(IPTR) (element->nod_arg[0]);
2241 request->append_ushort_with_length(temp_short);
2244 case nod_log_buffer_size:
2245 request->append_uchar(gds_dyn_log_buffer_size);
2246 - temp_short = (SSHORT)(SLONG) (element->nod_arg[0]);
2247 + temp_short = (SSHORT)(SLONG)(IPTR) (element->nod_arg[0]);
2248 request->append_ushort_with_length(temp_short);
2251 @@ -5095,7 +5095,7 @@
2252 const_node = element->nod_arg[e_mod_fld_pos_new_position];
2254 /* CVC: Since now the parser accepts pos=1..N, let's subtract one here. */
2255 - constant = (SSHORT)(SLONG) const_node->nod_arg [0] - 1;
2256 + constant = (SSHORT)(SLONG) (IPTR) const_node->nod_arg [0] - 1;
2258 request->append_cstring(gds_dyn_rel_name,
2259 relation_name->str_data);
2260 diff -Naur firebird-1.5.3.4870.old/src/dsql/dsql.cpp firebird-1.5.3.4870/src/dsql/dsql.cpp
2261 --- firebird-1.5.3.4870.old/src/dsql/dsql.cpp 2006-08-06 06:47:20.000000000 +0200
2262 +++ firebird-1.5.3.4870/src/dsql/dsql.cpp 2006-08-06 07:38:45.000000000 +0200
2263 @@ -1136,8 +1136,8 @@
2264 parameter = request->req_blob->blb_segment;
2265 PAR null = parameter->par_null;
2266 USHORT* ret_length =
2267 - (USHORT *) (dsql_msg + (SLONG) null->par_user_desc.dsc_address);
2268 - UCHAR* buffer = dsql_msg + (SLONG) parameter->par_user_desc.dsc_address;
2269 + (USHORT *) (dsql_msg + (SLONG) (IPTR) null->par_user_desc.dsc_address);
2270 + UCHAR* buffer = dsql_msg + (SLONG) (IPTR) parameter->par_user_desc.dsc_address;
2272 s = isc_get_segment(tdsql->tsql_status,
2273 GDS_REF(request->req_handle),
2274 @@ -1314,7 +1314,7 @@
2275 parameter = request->req_blob->blb_segment;
2277 reinterpret_cast<SCHAR*>(
2278 - dsql_msg + (SLONG) parameter->par_user_desc.dsc_address);
2279 + dsql_msg + (SLONG) (IPTR) parameter->par_user_desc.dsc_address);
2281 s = isc_put_segment(tdsql->tsql_status,
2282 GDS_REF(request->req_handle),
2283 @@ -3210,7 +3210,7 @@
2284 PAR parameter, null;
2286 if (node->nod_type == nod_constant)
2287 - return (SSHORT)(SLONG) node->nod_arg[0];
2288 + return (SSHORT)(SLONG) (IPTR) node->nod_arg[0];
2290 parameter = (PAR) node->nod_arg[e_par_parameter];
2291 if (null = parameter->par_null)
2292 @@ -3976,7 +3976,7 @@
2293 /* Make sure the message given to us is long enough */
2295 DSC desc = parameter->par_user_desc;
2296 - USHORT length = (SLONG) desc.dsc_address + desc.dsc_length;
2297 + USHORT length = (SLONG) (IPTR) desc.dsc_address + desc.dsc_length;
2298 if (length > msg_length)
2300 if (!desc.dsc_dtype)
2301 @@ -3985,7 +3985,7 @@
2303 if ((null = parameter->par_null) != NULL)
2305 - USHORT null_offset = (USHORT)(ULONG) (null->par_user_desc.dsc_address);
2306 + USHORT null_offset = (USHORT)(ULONG) (IPTR) (null->par_user_desc.dsc_address);
2307 length = null_offset + sizeof(SSHORT);
2308 if (length > msg_length)
2310 @@ -4000,7 +4000,7 @@
2314 - desc.dsc_address = dsql_msg + (SLONG) desc.dsc_address;
2315 + desc.dsc_address = dsql_msg + (SLONG) (IPTR) desc.dsc_address;
2317 MOVD_move(¶meter->par_desc, &desc);
2318 else if (!flag || *flag >= 0)
2319 diff -Naur firebird-1.5.3.4870.old/src/dsql/gen.cpp firebird-1.5.3.4870/src/dsql/gen.cpp
2320 --- firebird-1.5.3.4870.old/src/dsql/gen.cpp 2006-08-06 06:47:20.000000000 +0200
2321 +++ firebird-1.5.3.4870/src/dsql/gen.cpp 2006-08-06 07:41:31.000000000 +0200
2323 for (parameter = message->msg_parameters; parameter;
2324 parameter = parameter->par_next)
2325 parameter->par_desc.dsc_address =
2326 - message->msg_buffer + (SLONG) parameter->par_desc.dsc_address;
2327 + message->msg_buffer + (SLONG) (IPTR) parameter->par_desc.dsc_address;
2331 @@ -1021,7 +1021,7 @@
2333 if (node->nod_arg[e_exec_into_block]) {
2335 - STUFF((int)(SLONG) node->nod_arg[e_exec_into_number]);
2336 + STUFF((int)(SLONG) (IPTR) node->nod_arg[e_exec_into_number]);
2338 STUFF(blr_exec_into);
2339 temp = node->nod_arg[e_exec_into_list];
2340 @@ -1049,12 +1049,12 @@
2344 - STUFF((int)(SLONG) node->nod_arg[e_label_number]);
2345 + STUFF((int)(SLONG) (IPTR) node->nod_arg[e_label_number]);
2348 case nod_breakleave:
2350 - STUFF((int)(SLONG) node->nod_arg[e_breakleave_number]);
2351 + STUFF((int)(SLONG)(IPTR) node->nod_arg[e_breakleave_number]);
2355 @@ -1069,7 +1069,7 @@
2359 - STUFF((int)(SLONG) node->nod_arg[e_abrt_number]);
2360 + STUFF((int)(SLONG) (IPTR) node->nod_arg[e_abrt_number]);
2363 case nod_start_savepoint:
2364 @@ -1149,14 +1149,14 @@
2368 - STUFF((int)(SLONG) node->nod_arg[e_while_number]);
2369 + STUFF((int)(SLONG) (IPTR) node->nod_arg[e_while_number]);
2373 GEN_expr(request, node->nod_arg[e_while_cond]);
2374 GEN_statement(request, node->nod_arg[e_while_action]);
2376 - STUFF((int)(SLONG) node->nod_arg[e_while_number]);
2377 + STUFF((int)(SLONG) (IPTR) node->nod_arg[e_while_number]);
2381 @@ -1556,7 +1556,7 @@
2382 switch (node->nod_type) {
2384 STUFF(blr_sql_code);
2385 - STUFF_WORD((USHORT)(ULONG) node->nod_arg[0]);
2386 + STUFF_WORD((USHORT)(ULONG) (IPTR) node->nod_arg[0]);
2390 @@ -1667,7 +1667,7 @@
2391 what loop is the user trying to abandon? */
2392 if (for_select->nod_arg [e_flp_action]) {
2394 - STUFF ((int) for_select->nod_arg [e_flp_number]);
2395 + STUFF ((int) (IPTR) for_select->nod_arg [e_flp_number]);
2398 /* Generate FOR loop */
2399 @@ -2546,7 +2546,7 @@
2400 for (ptr = list->nod_arg, end = ptr + list->nod_count; ptr < end; ptr++) {
2401 dsql_nod* nulls_placement = (*ptr)->nod_arg[e_order_nulls];
2402 if (nulls_placement) {
2403 - switch ((SLONG)nulls_placement->nod_arg[0]) {
2404 + switch ((SLONG) (IPTR) nulls_placement->nod_arg[0]) {
2405 case NOD_NULLS_FIRST:
2406 STUFF(blr_nullsfirst);
2408 diff -Naur firebird-1.5.3.4870.old/src/dsql/parse.y firebird-1.5.3.4870/src/dsql/parse.y
2409 --- firebird-1.5.3.4870.old/src/dsql/parse.y 2006-08-06 06:47:21.000000000 +0200
2410 +++ firebird-1.5.3.4870/src/dsql/parse.y 2006-08-06 07:49:47.000000000 +0200
2414 | KW_DEBUG signed_short_integer
2415 - { prepare_console_debug ((int) $2, &yydebug);
2416 + { prepare_console_debug ((int)(IPTR) $2, &yydebug);
2417 $$ = make_node (nod_null, (int) 0, NULL); }
2421 | CSTRING '(' pos_short_integer ')' charset_clause
2423 lex.g_field->fld_dtype = dtype_cstring;
2424 - lex.g_field->fld_character_length = (USHORT) $3; }
2425 + lex.g_field->fld_character_length = (USHORT)(size_t) $3; }
2429 @@ -1158,7 +1158,7 @@
2432 logfile_attr : KW_SIZE equals long_integer
2433 - { lex.g_file->fil_length = (SLONG) $3; }
2434 + { lex.g_file->fil_length = (SLONG)(IPTR) $3; }
2436 | RAW_PARTITIONS equals pos_short_integer
2437 { lex.g_file->fil_partitions = (SSHORT) $3;
2438 @@ -1178,9 +1178,9 @@
2441 file_clause : STARTING file_clause_noise long_integer
2442 - { lex.g_file->fil_start = (SLONG) $3;}
2443 + { lex.g_file->fil_start = (SLONG)(IPTR) $3;}
2444 | LENGTH equals long_integer page_noise
2445 - { lex.g_file->fil_length = (SLONG) $3;}
2446 + { lex.g_file->fil_length = (SLONG)(IPTR) $3;}
2450 @@ -2186,7 +2186,7 @@
2453 array_range : signed_long_integer
2454 - { if ((SLONG) $1 < 1)
2455 + { if ((SLONG)(IPTR) $1 < 1)
2456 $$ = make_node (nod_list, (int) 2,
2457 MAKE_constant ((STR) $1, CONSTANT_SLONG),
2458 MAKE_constant ((STR) 1, CONSTANT_SLONG));
2459 @@ -2292,26 +2292,26 @@
2460 | BLOB '(' unsigned_short_integer ')'
2462 lex.g_field->fld_dtype = dtype_blob;
2463 - lex.g_field->fld_seg_length = (USHORT) $3;
2464 + lex.g_field->fld_seg_length = (USHORT)(size_t) $3;
2465 lex.g_field->fld_sub_type = 0;
2467 | BLOB '(' unsigned_short_integer ',' signed_short_integer ')'
2469 lex.g_field->fld_dtype = dtype_blob;
2470 - lex.g_field->fld_seg_length = (USHORT) $3;
2471 - lex.g_field->fld_sub_type = (USHORT) $5;
2472 + lex.g_field->fld_seg_length = (USHORT)(size_t) $3;
2473 + lex.g_field->fld_sub_type = (USHORT)(size_t) $5;
2475 | BLOB '(' ',' signed_short_integer ')'
2477 lex.g_field->fld_dtype = dtype_blob;
2478 lex.g_field->fld_seg_length = 80;
2479 - lex.g_field->fld_sub_type = (USHORT) $4;
2480 + lex.g_field->fld_sub_type = (USHORT)(size_t) $4;
2484 blob_segsize : SEGMENT KW_SIZE unsigned_short_integer
2486 - lex.g_field->fld_seg_length = (USHORT) $3;
2487 + lex.g_field->fld_seg_length = (USHORT)(size_t) $3;
2491 @@ -2321,7 +2321,7 @@
2493 blob_subtype : SUB_TYPE signed_short_integer
2495 - lex.g_field->fld_sub_type = (USHORT) $2;
2496 + lex.g_field->fld_sub_type = (USHORT)(size_t) $2;
2498 | SUB_TYPE symbol_blob_subtype_name
2500 @@ -2347,7 +2347,7 @@
2501 national_character_type : national_character_keyword '(' pos_short_integer ')'
2503 lex.g_field->fld_dtype = dtype_text;
2504 - lex.g_field->fld_character_length = (USHORT) $3;
2505 + lex.g_field->fld_character_length = (USHORT)(size_t) $3;
2506 lex.g_field->fld_flags |= FLD_national;
2508 | national_character_keyword
2509 @@ -2359,7 +2359,7 @@
2510 | national_character_keyword VARYING '(' pos_short_integer ')'
2512 lex.g_field->fld_dtype = dtype_varying;
2513 - lex.g_field->fld_character_length = (USHORT) $4;
2514 + lex.g_field->fld_character_length = (USHORT)(size_t) $4;
2515 lex.g_field->fld_flags |= FLD_national;
2518 @@ -2367,7 +2367,7 @@
2519 character_type : character_keyword '(' pos_short_integer ')'
2521 lex.g_field->fld_dtype = dtype_text;
2522 - lex.g_field->fld_character_length = (USHORT) $3;
2523 + lex.g_field->fld_character_length = (USHORT)(size_t) $3;
2527 @@ -2377,7 +2377,7 @@
2528 | varying_keyword '(' pos_short_integer ')'
2530 lex.g_field->fld_dtype = dtype_varying;
2531 - lex.g_field->fld_character_length = (USHORT) $3;
2532 + lex.g_field->fld_character_length = (USHORT)(size_t) $3;
2536 @@ -2429,10 +2429,10 @@
2538 | '(' signed_long_integer ')'
2540 - if ( ((SLONG) $2 < 1) || ((SLONG) $2 > 18) )
2541 + if ( ((SLONG)(IPTR) $2 < 1) || ((SLONG)(IPTR) $2 > 18) )
2542 yyabandon (-842, isc_precision_err);
2543 /* Precision most be between 1 and 18. */
2544 - if ((SLONG) $2 > 9)
2545 + if ((SLONG)(IPTR) $2 > 9)
2547 if ( ( (client_dialect <= SQL_DIALECT_V5) &&
2548 (db_dialect > SQL_DIALECT_V5) ) ||
2549 @@ -2469,7 +2469,7 @@
2553 - if ((SLONG) $2 < 5)
2554 + if ((SLONG)(IPTR) $2 < 5)
2556 lex.g_field->fld_dtype = dtype_short;
2557 lex.g_field->fld_length = sizeof (SSHORT);
2558 @@ -2479,17 +2479,17 @@
2559 lex.g_field->fld_dtype = dtype_long;
2560 lex.g_field->fld_length = sizeof (SLONG);
2562 - lex.g_field->fld_precision = (USHORT) $2;
2563 + lex.g_field->fld_precision = (USHORT)(size_t) $2;
2565 | '(' signed_long_integer ',' signed_long_integer ')'
2567 - if ( ((SLONG) $2 < 1) || ((SLONG) $2 > 18) )
2568 + if ( ((SLONG)(IPTR) $2 < 1) || ((SLONG)(IPTR) $2 > 18) )
2569 yyabandon (-842, isc_precision_err);
2570 /* Precision should be between 1 and 18 */
2571 - if (((SLONG) $4 > (SLONG) $2) || ((SLONG) $4 < 0))
2572 + if (((SLONG)(IPTR) $4 > (SLONG)(IPTR) $2) || ((SLONG)(IPTR) $4 < 0))
2573 yyabandon (-842, isc_scale_nogt);
2574 /* Scale must be between 0 and precision */
2575 - if ((SLONG) $2 > 9)
2576 + if ((SLONG)(IPTR) $2 > 9)
2578 if ( ( (client_dialect <= SQL_DIALECT_V5) &&
2579 (db_dialect > SQL_DIALECT_V5) ) ||
2580 @@ -2527,7 +2527,7 @@
2584 - if ((SLONG) $2 < 5)
2585 + if ((SLONG)(IPTR) $2 < 5)
2587 lex.g_field->fld_dtype = dtype_short;
2588 lex.g_field->fld_length = sizeof (SSHORT);
2589 @@ -2538,8 +2538,8 @@
2590 lex.g_field->fld_length = sizeof (SLONG);
2593 - lex.g_field->fld_precision = (USHORT) $2;
2594 - lex.g_field->fld_scale = - (SSHORT) $4;
2595 + lex.g_field->fld_precision = (USHORT)(size_t) $2;
2596 + lex.g_field->fld_scale = - (SSHORT)(size_t) $4;
2600 @@ -2553,7 +2553,7 @@
2602 float_type : KW_FLOAT precision_opt
2604 - if ((SLONG) $2 > 7)
2605 + if ((SLONG)(IPTR) $2 > 7)
2607 lex.g_field->fld_dtype = dtype_double;
2608 lex.g_field->fld_length = sizeof (double);
2609 @@ -2756,7 +2756,7 @@
2612 table_lock : FOR lock_type lock_mode
2613 - { $$ = make_flag_node (nod_lock_mode, (SSHORT) ((SSHORT) $2 | (SSHORT) $3), (SSHORT) 0, NULL); }
2614 + { $$ = make_flag_node (nod_lock_mode, (SSHORT) ((SSHORT)(size_t) $2 | (SSHORT)(size_t) $3), (SSHORT) 0, NULL); }
2618 @@ -3706,32 +3706,32 @@
2620 signed_short_integer : nonneg_short_integer
2621 | '-' neg_short_integer
2622 - { $$ = (DSQL_NOD) - (SLONG) $2; }
2623 + { $$ = (DSQL_NOD) - (SLONG)(IPTR) $2; }
2626 nonneg_short_integer : NUMBER
2627 - { if ((SLONG) $1 > SHRT_POS_MAX)
2628 + { if ((SLONG)(IPTR) $1 > SHRT_POS_MAX)
2629 yyabandon (-842, isc_expec_short);
2630 /* Short integer expected */
2634 neg_short_integer : NUMBER
2635 - { if ((SLONG) $1 > SHRT_NEG_MAX)
2636 + { if ((SLONG)(IPTR) $1 > SHRT_NEG_MAX)
2637 yyabandon (-842, isc_expec_short);
2638 /* Short integer expected */
2642 pos_short_integer : nonneg_short_integer
2643 - { if ((SLONG) $1 == 0)
2644 + { if ((SLONG)(IPTR) $1 == 0)
2645 yyabandon (-842, isc_expec_positive);
2646 /* Positive number expected */
2650 unsigned_short_integer : NUMBER
2651 - { if ((SLONG) $1 > SHRT_UNSIGNED_MAX)
2652 + { if ((SLONG)(IPTR) $1 > SHRT_UNSIGNED_MAX)
2653 yyabandon (-842, isc_expec_ushort);
2654 /* Unsigned short integer expected */
2656 @@ -3739,7 +3739,7 @@
2658 signed_long_integer : long_integer
2660 - { $$ = (DSQL_NOD) - (SLONG) $2; }
2661 + { $$ = (DSQL_NOD) - (SLONG)(IPTR) $2; }
2664 long_integer : NUMBER
2665 @@ -3820,14 +3820,14 @@
2667 string_value_function : SUBSTRING '(' value FROM pos_short_integer ')'
2668 { $$ = make_node (nod_substr, e_substr_count, $3,
2669 - MAKE_constant ((STR) ((SLONG)($5) - 1), CONSTANT_SLONG),
2670 + MAKE_constant ((STR) ((SLONG)(IPTR)($5) - 1), CONSTANT_SLONG),
2671 MAKE_constant ((STR) SHRT_POS_MAX, CONSTANT_SLONG)); }
2672 /* CVC: It was easier to provide a constant with maximum value if the
2673 third parameter -length- is ommitted than to chase and fix the functions
2674 that treat nod_substr as an aggregate and do not expect NULL arguments. */
2675 | SUBSTRING '(' value FROM pos_short_integer FOR nonneg_short_integer ')'
2676 { $$ = make_node (nod_substr, e_substr_count, $3,
2677 - MAKE_constant ((STR) ((SLONG)($5) - 1), CONSTANT_SLONG),
2678 + MAKE_constant ((STR) ((SLONG)(IPTR)($5) - 1), CONSTANT_SLONG),
2679 MAKE_constant ((STR) ($7), CONSTANT_SLONG)); }
2680 | KW_UPPER '(' value ')'
2681 { $$ = make_node (nod_upcase, 1, $3); }
2682 @@ -4960,7 +4960,7 @@
2686 - sym = HSHD_lookup (NULL_PTR, (TEXT *) string, (SSHORT)(p - string), SYM_keyword, parser_version);
2687 + sym = HSHD_lookup (NULL_PTR, (TEXT *) string, (SSHORT)(size_t)(p - string), SYM_keyword, parser_version);
2690 /* 13 June 2003. Nickolay Samofatov
2691 diff -Naur firebird-1.5.3.4870.old/src/dsql/pass1.cpp firebird-1.5.3.4870/src/dsql/pass1.cpp
2692 --- firebird-1.5.3.4870.old/src/dsql/pass1.cpp 2006-08-06 06:47:20.000000000 +0200
2693 +++ firebird-1.5.3.4870/src/dsql/pass1.cpp 2006-08-06 07:52:09.000000000 +0200
2696 /* Pass 0 here to restore older parameter
2697 ordering behavior */
2698 - (USHORT)(ULONG) input->nod_arg[0]);
2699 + (USHORT)(ULONG)(IPTR) input->nod_arg[0]);
2703 @@ -1561,7 +1561,7 @@
2707 - if (request->req_scope_level == (ULONG) node->nod_arg[1]) {
2708 + if (request->req_scope_level == (ULONG)(IPTR) node->nod_arg[1]) {
2712 @@ -4426,7 +4426,7 @@
2713 (slist_node->nod_type == nod_list))
2715 /* an select list is there */
2716 - position = (ULONG) sub->nod_arg[0];
2717 + position = (ULONG)(IPTR) sub->nod_arg[0];
2718 if ((position < 1) || (position > (ULONG) slist_node->nod_count))
2720 ERRD_post(gds_sqlerr, gds_arg_number, (SLONG) - 104,
2721 @@ -4819,7 +4819,7 @@
2724 if (node1->nod_type == nod_constant && node1->nod_desc.dsc_dtype == dtype_long) {
2725 - position = (ULONG) (node1->nod_arg[0]);
2726 + position = (ULONG)(IPTR) (node1->nod_arg[0]);
2727 if ((position < 1) || !s_list ||
2728 (position > (ULONG) s_list->nod_count)) {
2729 ERRD_post(gds_sqlerr, gds_arg_number, (SLONG) - 104,
2730 @@ -5082,7 +5082,7 @@
2731 ERRD_post(gds_sqlerr, gds_arg_number, (SLONG) - 104,
2732 gds_arg_gds, gds_dsql_command_err, gds_arg_gds, gds_order_by_err, /* invalid ORDER BY clause */
2734 - number = (SLONG) position->nod_arg[0];
2735 + number = (SLONG)(IPTR) position->nod_arg[0];
2736 if (number < 1 || number > union_items->nod_count)
2737 ERRD_post(gds_sqlerr, gds_arg_number, (SLONG) - 104,
2738 gds_arg_gds, gds_dsql_command_err, gds_arg_gds, gds_order_by_err, /* invalid ORDER BY clause */
2739 diff -Naur firebird-1.5.3.4870.old/src/dudley/generate.cpp firebird-1.5.3.4870/src/dudley/generate.cpp
2740 --- firebird-1.5.3.4870.old/src/dudley/generate.cpp 2006-08-06 06:47:26.000000000 +0200
2741 +++ firebird-1.5.3.4870/src/dudley/generate.cpp 2006-08-06 08:06:49.000000000 +0200
2746 - STUFF((int) node->nod_arg[0]);
2747 + STUFF((int) (IPTR) node->nod_arg[0]);
2751 diff -Naur firebird-1.5.3.4870.old/src/dudley/trn.cpp firebird-1.5.3.4870/src/dudley/trn.cpp
2752 --- firebird-1.5.3.4870.old/src/dudley/trn.cpp 2006-08-06 06:47:26.000000000 +0200
2753 +++ firebird-1.5.3.4870/src/dudley/trn.cpp 2006-08-06 08:07:12.000000000 +0200
2758 - drop_shadow(dyn, (SLONG) (action->act_object));
2759 + drop_shadow(dyn, (SLONG)(IPTR) (action->act_object));
2762 case act_m_trigger_msg:
2763 diff -Naur firebird-1.5.3.4870.old/src/jrd/jrd.cpp firebird-1.5.3.4870/src/jrd/jrd.cpp
2764 --- firebird-1.5.3.4870.old/src/jrd/jrd.cpp 2006-08-06 06:52:32.000000000 +0200
2765 +++ firebird-1.5.3.4870/src/jrd/jrd.cpp 2006-08-06 06:53:15.000000000 +0200
2766 @@ -3877,9 +3877,9 @@
2768 if ( (node = csb->csb_rpt[i].csb_message) )
2770 - if ((int) node->nod_arg[e_msg_number] == 0) {
2771 + if ((int) (IPTR) node->nod_arg[e_msg_number] == 0) {
2773 - } else if ((int) node->nod_arg[e_msg_number] == 1) {
2774 + } else if ((int) (IPTR) node->nod_arg[e_msg_number] == 1) {
2778 diff -Naur firebird-1.5.3.4870.old/src/jrd/jrn.cpp firebird-1.5.3.4870/src/jrd/jrn.cpp
2779 --- firebird-1.5.3.4870.old/src/jrd/jrn.cpp 2006-08-06 06:47:17.000000000 +0200
2780 +++ firebird-1.5.3.4870/src/jrd/jrn.cpp 2006-08-06 06:55:26.000000000 +0200
2782 for (loop = 0; loop < 20; loop++) {
2784 journal->jrn_channel = (int *) socket(AF_INET, SOCK_STREAM, 0);
2785 - if ((int) journal->jrn_channel != -1)
2786 + if ((int) (IPTR) journal->jrn_channel != -1)
2788 if (!SYSCALL_INTERRUPTED(errno)) {
2789 error(status_vector, journal, errno, "socket");
2790 @@ -859,18 +859,18 @@
2794 - if (!connect((int) journal->jrn_channel, (sockaddr*)&address, sizeof(address)))
2795 + if (!connect((int) (IPTR) journal->jrn_channel, (sockaddr*)&address, sizeof(address)))
2801 - close((int) journal->jrn_channel);
2802 + close((int) (IPTR) journal->jrn_channel);
2805 if (!SYSCALL_INTERRUPTED(errno)) {
2807 - close((int) journal->jrn_channel);
2808 + close((int) (IPTR) journal->jrn_channel);
2810 *ret_jrn = (JRN) NULL;
2816 - close((int) journal->jrn_channel);
2817 + close((int) (IPTR) journal->jrn_channel);
2825 - close((int) journal->jrn_channel);
2826 + close((int) (IPTR) journal->jrn_channel);
2830 @@ -1056,7 +1056,7 @@
2831 with us, so keep trying until successful. */
2834 - l = recv((int) journal->jrn_channel, (char *) reply, sizeof(struct jrnr), 0);
2835 + l = recv((int) (IPTR) journal->jrn_channel, (char *) reply, sizeof(struct jrnr), 0);
2836 } while (l < 0 && SYSCALL_INTERRUPTED(errno));
2839 @@ -1095,7 +1095,7 @@
2840 **************************************/
2843 - if (close((int) journal->jrn_channel) < 0) {
2844 + if (close((int) (IPTR) journal->jrn_channel) < 0) {
2845 error(status_vector, journal, errno, "close");
2848 @@ -1166,7 +1166,7 @@
2849 with us, so keep trying until successful. */
2852 - l = send((int) journal->jrn_channel, (char *) buffer, (int) length, 0);
2853 + l = send((int) (IPTR) journal->jrn_channel, (char *) buffer, (int) length, 0);
2854 } while (l < 0 && SYSCALL_INTERRUPTED(errno));
2857 diff -Naur firebird-1.5.3.4870.old/src/jrd/lck.cpp firebird-1.5.3.4870/src/jrd/lck.cpp
2858 --- firebird-1.5.3.4870.old/src/jrd/lck.cpp 2006-08-06 06:47:17.000000000 +0200
2859 +++ firebird-1.5.3.4870/src/jrd/lck.cpp 2006-08-06 07:56:17.000000000 +0200
2863 #define LCK_OWNER_ID_PROCESS (SLONG) getpid()
2864 -#define LCK_OWNER_ID_DBB (SLONG) dbb
2865 -#define LCK_OWNER_ID_ATT (SLONG) attachment
2866 +#define LCK_OWNER_ID_DBB (SLONG)(IPTR) dbb
2867 +#define LCK_OWNER_ID_ATT (SLONG)(IPTR) attachment
2869 #define LCK_OWNER_TYPE_PROCESS LCK_OWNER_process
2870 #define LCK_OWNER_TYPE_DBB LCK_OWNER_dbb
2871 diff -Naur firebird-1.5.3.4870.old/src/jrd/nav.cpp firebird-1.5.3.4870/src/jrd/nav.cpp
2872 --- firebird-1.5.3.4870.old/src/jrd/nav.cpp 2006-08-06 06:47:18.000000000 +0200
2873 +++ firebird-1.5.3.4870/src/jrd/nav.cpp 2006-08-06 07:00:00.000000000 +0200
2878 - (IDX *) ((SCHAR *) impure + (SLONG) rsb->rsb_arg[RSB_NAV_idx_offset]);
2879 + (IDX *) ((SCHAR *) impure + (SLONG) (IPTR) rsb->rsb_arg[RSB_NAV_idx_offset]);
2881 /* The bitmap is only valid when we are continuing on in one
2882 direction. It is of no help when we change direction,
2883 @@ -521,12 +521,12 @@
2884 #ifdef SCROLLABLE_CURSORS
2886 (impure->irsb_nav_data +
2887 - (2 * (SLONG) rsb->rsb_arg[RSB_NAV_key_length])),
2888 + (2 * (SLONG) (IPTR) rsb->rsb_arg[RSB_NAV_key_length])),
2889 upper.key_data, upper.key_length);
2892 (impure->irsb_nav_data +
2893 - (SLONG) rsb->rsb_arg[RSB_NAV_key_length]), upper.key_data,
2894 + (SLONG) (IPTR) rsb->rsb_arg[RSB_NAV_key_length]), upper.key_data,
2899 lower.key_length = impure->irsb_nav_lower_length;
2901 (impure->irsb_nav_data +
2902 - (SLONG) rsb->rsb_arg[RSB_NAV_key_length]), lower.key_data,
2903 + (SLONG) (IPTR) rsb->rsb_arg[RSB_NAV_key_length]), lower.key_data,
2907 @@ -1404,7 +1404,7 @@
2908 tdbb = GET_THREAD_DATA;
2911 - (IDX *) ((SCHAR *) impure + (SLONG) rsb->rsb_arg[RSB_NAV_idx_offset]);
2912 + (IDX *) ((SCHAR *) impure + (SLONG) (IPTR) rsb->rsb_arg[RSB_NAV_idx_offset]);
2913 page = (BTR) CCH_FETCH(tdbb, window, LCK_read, pag_index);
2915 /* the outer loop goes through all the sibling pages
2916 @@ -1619,7 +1619,7 @@
2917 tdbb = GET_THREAD_DATA;
2918 request = tdbb->tdbb_request;
2920 - (IDX *) ((SCHAR *) impure + (SLONG) rsb->rsb_arg[RSB_NAV_idx_offset]);
2921 + (IDX *) ((SCHAR *) impure + (SLONG) (IPTR) rsb->rsb_arg[RSB_NAV_idx_offset]);
2925 @@ -1656,7 +1656,7 @@
2928 struct idx *>((SCHAR *) impure +
2929 - (SLONG) rsb->rsb_arg[RSB_NAV_idx_offset]),
2930 + (SLONG) (IPTR) rsb->rsb_arg[RSB_NAV_idx_offset]),
2933 if (compare_keys(idx, key->key_data, key->key_length, &value, FALSE)) {
2934 @@ -1757,7 +1757,7 @@
2935 retrieval_node = (JRD_NOD) rsb->rsb_arg[RSB_NAV_index];
2936 retrieval = (IRB) retrieval_node->nod_arg[e_idx_retrieval];
2938 - (IDX *) ((SCHAR *) impure + (SLONG) rsb->rsb_arg[RSB_NAV_idx_offset]);
2939 + (IDX *) ((SCHAR *) impure + (SLONG) (IPTR) rsb->rsb_arg[RSB_NAV_idx_offset]);
2941 BTR_find_page(tdbb, retrieval, window, idx, &lower, &upper,
2942 (direction == RSE_get_backward));
2943 @@ -1802,7 +1802,7 @@
2944 impure->irsb_nav_upper_length = upper.key_length;
2945 MOVE_FAST(upper.key_data,
2946 (impure->irsb_nav_data +
2947 - (SLONG) rsb->rsb_arg[RSB_NAV_key_length]),
2948 + (SLONG) (IPTR) rsb->rsb_arg[RSB_NAV_key_length]),
2951 if (retrieval->irb_lower_count)
2952 @@ -1813,7 +1813,7 @@
2953 impure->irsb_nav_lower_length = lower.key_length;
2954 MOVE_FAST(lower.key_data,
2955 (impure->irsb_nav_data +
2956 - (SLONG) rsb->rsb_arg[RSB_NAV_key_length]),
2957 + (SLONG) (IPTR) rsb->rsb_arg[RSB_NAV_key_length]),
2960 if (retrieval->irb_upper_count)
2961 diff -Naur firebird-1.5.3.4870.old/src/jrd/rse.cpp firebird-1.5.3.4870/src/jrd/rse.cpp
2962 --- firebird-1.5.3.4870.old/src/jrd/rse.cpp 2006-08-06 06:47:17.000000000 +0200
2963 +++ firebird-1.5.3.4870/src/jrd/rse.cpp 2006-08-06 07:17:52.000000000 +0200
2964 @@ -2151,7 +2151,7 @@
2967 desc = msg_format->fmt_desc[msg_format->fmt_count - 1];
2968 - desc.dsc_address = (UCHAR *) (om + (int) desc.dsc_address);
2969 + desc.dsc_address = (UCHAR *) (om + (int) (IPTR) desc.dsc_address);
2970 eos_desc.dsc_dtype = dtype_short;
2971 eos_desc.dsc_scale = 0;
2972 eos_desc.dsc_length = sizeof(SSHORT);
2973 @@ -2959,7 +2959,7 @@
2974 for (item = map->smb_rpt; item < end_item; item++) {
2975 flag = *(data + item->smb_flag_offset);
2976 from = item->smb_desc;
2977 - from.dsc_address = data + (ULONG) from.dsc_address;
2978 + from.dsc_address = data + (ULONG) (IPTR) from.dsc_address;
2979 if ((node = item->smb_node) && node->nod_type != nod_field)
2982 @@ -3211,7 +3211,7 @@
2983 end_item = map->smb_rpt + map->smb_count;
2984 for (item = map->smb_rpt; item < end_item; item++) {
2985 to = item->smb_desc;
2986 - to.dsc_address = data + (ULONG) to.dsc_address;
2987 + to.dsc_address = data + (ULONG) (IPTR) to.dsc_address;
2989 if (item->smb_node) {
2990 from = EVL_expr(tdbb, item->smb_node);
2991 @@ -3301,12 +3301,12 @@
2992 desc2.dsc_flags = 0;
2993 desc2.dsc_address = (UCHAR *) & indicator;
2995 - desc1.dsc_address = msg + (int) flag_desc->dsc_address;
2996 + desc1.dsc_address = msg + (int) (IPTR) flag_desc->dsc_address;
2997 MOV_move(&desc1, &desc2);
2999 SET_NULL(record, to_id);
3000 l = to_desc->dsc_length;
3001 - p = record->rec_data + (int) to_desc->dsc_address;
3002 + p = record->rec_data + (int) (IPTR) to_desc->dsc_address;
3003 switch (to_desc->dsc_dtype) {
3005 /* YYY - not necessarily the right thing to do */
3006 @@ -3336,9 +3336,9 @@
3008 CLEAR_NULL(record, to_id);
3010 - desc1.dsc_address = msg + (int) desc1.dsc_address;
3011 + desc1.dsc_address = msg + (int) (IPTR) desc1.dsc_address;
3013 - desc2.dsc_address = record->rec_data + (int) desc2.dsc_address;
3014 + desc2.dsc_address = record->rec_data + (int) (IPTR) desc2.dsc_address;
3015 if (!DSC_EQUIV((&desc1), (&desc2)))
3016 MOV_move(&desc1, &desc2);
3018 @@ -3817,7 +3817,7 @@
3019 if (!sfb_->sfb_file_name) {
3020 TEXT file_name[128];
3022 - sfb_->sfb_file = (int) gds__temp_file(FALSE, SCRATCH, file_name);
3023 + sfb_->sfb_file = (int) (IPTR) gds__temp_file(FALSE, SCRATCH, file_name);
3024 if (sfb_->sfb_file == -1)
3025 SORT_error(tdbb->tdbb_status_vector, sfb_, "open", isc_io_error,
3027 diff -Naur firebird-1.5.3.4870.old/src/jrd/sort.cpp firebird-1.5.3.4870/src/jrd/sort.cpp
3028 --- firebird-1.5.3.4870.old/src/jrd/sort.cpp 2006-08-06 06:47:17.000000000 +0200
3029 +++ firebird-1.5.3.4870/src/jrd/sort.cpp 2006-08-06 07:19:27.000000000 +0200
3030 @@ -1788,7 +1788,7 @@
3031 /* Create a scratch file */
3034 - (int) gds__temp_file(FALSE, SCRATCH, file_name,
3035 + (int) (IPTR) gds__temp_file(FALSE, SCRATCH, file_name,
3036 sfb->sfb_dls->dls_directory, TRUE);
3038 /* allocate the file name even if the file is not open,
3039 diff -Naur firebird-1.5.3.4870.old/src/qli/eval.cpp firebird-1.5.3.4870/src/qli/eval.cpp
3040 --- firebird-1.5.3.4870.old/src/qli/eval.cpp 2006-08-06 06:47:20.000000000 +0200
3041 +++ firebird-1.5.3.4870/src/qli/eval.cpp 2006-08-06 08:02:09.000000000 +0200
3042 @@ -200,10 +200,10 @@
3044 if (node->nod_type == nod_rpt_average && node->nod_arg[e_stt_default])
3045 if (node->nod_desc.dsc_dtype == dtype_long)
3046 - *(SLONG *) node->nod_desc.dsc_address /= (SLONG) node->
3047 + *(SLONG *) node->nod_desc.dsc_address /= (SLONG) (IPTR) node->
3048 nod_arg[e_stt_default];
3050 - *(double *) node->nod_desc.dsc_address /= (SLONG) node->
3051 + *(double *) node->nod_desc.dsc_address /= (SLONG) (IPTR) node->
3052 nod_arg[e_stt_default];
3057 /* If this is the first value, just move it in. */
3059 - count = (SLONG) node->nod_arg[e_stt_default] + 1;
3060 + count = (SLONG) (IPTR) node->nod_arg[e_stt_default] + 1;
3062 if (desc2->dsc_missing)
3063 desc1->dsc_missing = DSC_missing;
3067 case nod_rpt_average:
3068 - if (!(SLONG) node->nod_arg[e_stt_default])
3069 + if (!(SLONG) (IPTR) node->nod_arg[e_stt_default])
3070 desc->dsc_missing = DSC_missing;
3073 diff -Naur firebird-1.5.3.4870.old/src/qli/expand.cpp firebird-1.5.3.4870/src/qli/expand.cpp
3074 --- firebird-1.5.3.4870.old/src/qli/expand.cpp 2006-08-06 06:47:20.000000000 +0200
3075 +++ firebird-1.5.3.4870/src/qli/expand.cpp 2006-08-06 08:02:45.000000000 +0200
3076 @@ -1830,7 +1830,7 @@
3080 - item->itm_count = (int) syn_item->syn_arg[0];
3081 + item->itm_count = (int)(IPTR) syn_item->syn_arg[0];
3085 @@ -2131,7 +2131,7 @@
3086 /* Handle implicit boolean from SQL xxx IN (yyy FROM relation) */
3088 if (input->syn_arg[s_rse_outer]) {
3089 - eql_node = MAKE_NODE((enum nod_t)(int)input->syn_arg[s_rse_op], 2);
3090 + eql_node = MAKE_NODE((enum nod_t)(int)(IPTR)input->syn_arg[s_rse_op], 2);
3091 eql_node->nod_arg[0] =
3092 expand_expression(input->syn_arg[s_rse_outer], old_stack);
3093 eql_node->nod_arg[1] =
3094 diff -Naur firebird-1.5.3.4870.old/src/qli/gener.cpp firebird-1.5.3.4870/src/qli/gener.cpp
3095 --- firebird-1.5.3.4870.old/src/qli/gener.cpp 2006-08-06 06:47:19.000000000 +0200
3096 +++ firebird-1.5.3.4870/src/qli/gener.cpp 2006-08-06 08:03:12.000000000 +0200
3097 @@ -1556,7 +1556,7 @@
3099 rlb = CHECK_RLB(request->req_blr);
3101 - if ((NOD_T) (int) node->nod_arg[e_rse_join_type] == (NOD_T) 0)
3102 + if ((NOD_T) (int) (IPTR) node->nod_arg[e_rse_join_type] == (NOD_T) 0)
3105 STUFF(blr_rs_stream);
3106 @@ -1625,7 +1625,7 @@
3107 if (list = node->nod_arg[e_rse_reduced])
3108 gen_sort(list, request, blr_project);
3110 - join_type = (NOD_T) (int) node->nod_arg[e_rse_join_type];
3111 + join_type = (NOD_T) (int) (IPTR) node->nod_arg[e_rse_join_type];
3112 if (join_type != (NOD_T) 0 && join_type != nod_join_inner) {
3113 STUFF(blr_join_type);
3114 if (join_type == nod_join_left)
3115 diff -Naur firebird-1.5.3.4870.old/src/qli/lex.cpp firebird-1.5.3.4870/src/qli/lex.cpp
3116 --- firebird-1.5.3.4870.old/src/qli/lex.cpp 2006-08-06 06:47:19.000000000 +0200
3117 +++ firebird-1.5.3.4870/src/qli/lex.cpp 2006-08-06 08:03:26.000000000 +0200
3119 for (temp = QLI_line;
3120 temp->line_next && QLI_statements;
3121 temp = temp->line_next)
3122 -if (temp->line_next->line_position == (SLONG) QLI_statements->lls_object) return;
3123 +if (temp->line_next->line_position == (SLONG) (IPTR) QLI_statements->lls_object) return;
3125 statement = (LLS) ALLOCP(type_lls);
3126 statement->lls_object = (BLK) temp->line_position;
3127 diff -Naur firebird-1.5.3.4870.old/src/qli/parse.cpp firebird-1.5.3.4870/src/qli/parse.cpp
3128 --- firebird-1.5.3.4870.old/src/qli/parse.cpp 2006-08-06 06:47:19.000000000 +0200
3129 +++ firebird-1.5.3.4870/src/qli/parse.cpp 2006-08-06 08:04:28.000000000 +0200
3130 @@ -1524,7 +1524,7 @@
3131 IBERROR(176); /* Msg176 No statements issued yet */
3133 if (MATCH(KW_ASTERISK))
3134 - LEX_edit((SLONG) 0, (SLONG) statement_list->lls_object);
3135 + LEX_edit((SLONG) 0, (SLONG) (IPTR) statement_list->lls_object);
3137 if (KEYWORD(KW_SEMI))
3139 @@ -1534,7 +1534,7 @@
3140 for (start = stop = statement_list;
3141 l && start->lls_next; l--, start = start->lls_next);
3143 - LEX_edit((SLONG) start->lls_object, (SLONG) stop->lls_object);
3144 + LEX_edit((SLONG) (IPTR) start->lls_object, (SLONG) (IPTR) stop->lls_object);
3148 @@ -2925,7 +2925,7 @@
3149 node->syn_arg[0] = INT_CAST 1;
3150 if (op == nod_column || QLI_token->tok_type == tok_number)
3151 node->syn_arg[0] = INT_CAST parse_ordinal();
3152 - if ((op == nod_skip) && ((int) node->syn_arg[0] < 1))
3153 + if ((op == nod_skip) && ((int) (IPTR) node->syn_arg[0] < 1))
3154 SYNTAX_ERROR(478); /* Msg478 number > 0 */
3156 LLS_PUSH(node, &stack);
3157 diff -Naur firebird-1.5.3.4870.old/src/qli/show.epp firebird-1.5.3.4870/src/qli/show.epp
3158 --- firebird-1.5.3.4870.old/src/qli/show.epp 2006-08-06 06:47:19.000000000 +0200
3159 +++ firebird-1.5.3.4870/src/qli/show.epp 2006-08-06 08:05:12.000000000 +0200
3161 ptr = node->syn_arg;
3163 for (i = 0; i < node->syn_count; i++) {
3164 - sw = (ENUM show_t) (int) * ptr++;
3165 + sw = (ENUM show_t) (int)(IPTR) * ptr++;
3167 if (sw != show_matching_language &&
3168 sw != show_version &&
3169 diff -Naur firebird-1.5.3.4870.old/src/remote/inet_server.cpp firebird-1.5.3.4870/src/remote/inet_server.cpp
3170 --- firebird-1.5.3.4870.old/src/remote/inet_server.cpp 2006-08-06 06:47:27.000000000 +0200
3171 +++ firebird-1.5.3.4870/src/remote/inet_server.cpp 2006-08-06 07:59:49.000000000 +0200
3176 - divorce_terminal((int) &mask);
3177 + divorce_terminal((int) (IPTR) &mask);
3180 ISC_STATUS_ARRAY status_vector;
3181 diff -Naur firebird-1.5.3.4870.old/src/remote/interface.cpp firebird-1.5.3.4870/src/remote/interface.cpp
3182 --- firebird-1.5.3.4870.old/src/remote/interface.cpp 2006-08-06 06:47:27.000000000 +0200
3183 +++ firebird-1.5.3.4870/src/remote/interface.cpp 2006-08-06 07:53:34.000000000 +0200
3184 @@ -3231,7 +3231,7 @@
3185 // Nickolay Samofatov: We pass this value to the server (as 32-bit value)
3186 // then it returns it to us and we do not use it. Maybe pass zero here
3187 // to avoid client-side security risks?
3188 - event->p_event_ast = (SLONG) ast;
3189 + event->p_event_ast = (SLONG)(IPTR) ast;
3190 event->p_event_arg = (SLONG)(IPTR) arg;
3192 event->p_event_rid = rem_event->rvnt_id;
3193 @@ -6226,8 +6226,8 @@
3194 for (; to_desc < end_desc; from_desc++, to_desc++) {
3197 - from.dsc_address = from_msg + (SLONG) from.dsc_address;
3198 - to.dsc_address = to_msg + (SLONG) to.dsc_address;
3199 + from.dsc_address = from_msg + (SLONG)(IPTR) from.dsc_address;
3200 + to.dsc_address = to_msg + (SLONG)(IPTR) to.dsc_address;
3201 CVT_move(&from, &to, (FPTR_VOID) move_error);
3204 diff -Naur firebird-1.5.3.4870.old/src/remote/protocol.cpp firebird-1.5.3.4870/src/remote/protocol.cpp
3205 --- firebird-1.5.3.4870.old/src/remote/protocol.cpp 2006-08-06 06:47:27.000000000 +0200
3206 +++ firebird-1.5.3.4870/src/remote/protocol.cpp 2006-08-06 07:53:50.000000000 +0200
3211 - p = buffer + (ULONG) desc->dsc_address;
3212 + p = buffer + (ULONG) (IPTR) desc->dsc_address;
3214 switch (desc->dsc_dtype) {
3216 diff -Naur firebird-1.5.3.4870.old/src/remote/server.cpp firebird-1.5.3.4870/src/remote/server.cpp
3217 --- firebird-1.5.3.4870.old/src/remote/server.cpp 2006-08-06 06:47:27.000000000 +0200
3218 +++ firebird-1.5.3.4870/src/remote/server.cpp 2006-08-06 08:00:17.000000000 +0200
3219 @@ -4361,7 +4361,7 @@
3221 // Nickolay Samofatov: We keep this values and even pass them to the client
3222 // (as 32-bit values) when event is fired, but client ignores them.
3223 - p_event->p_event_ast = (SLONG) event->rvnt_ast;
3224 + p_event->p_event_ast = (SLONG)(IPTR) event->rvnt_ast;
3225 p_event->p_event_arg = (SLONG)(IPTR) event->rvnt_arg;
3227 p_event->p_event_rid = event->rvnt_rid;
3228 diff -Naur firebird-1.5.3.4870.old/src/utilities/gsec.cpp firebird-1.5.3.4870/src/utilities/gsec.cpp
3229 --- firebird-1.5.3.4870.old/src/utilities/gsec.cpp 2006-08-06 06:47:32.000000000 +0200
3230 +++ firebird-1.5.3.4870/src/utilities/gsec.cpp 2006-08-06 07:57:42.000000000 +0200
3234 exit_code = UTIL_gsec(service->svc_argc, service->svc_argv,
3235 - output_svc, (SLONG) service);
3236 + output_svc, (SLONG) (IPTR) service);
3238 /* Mark service thread as finished. */
3239 /* If service is detached, cleanup memory being used by service. */
3240 diff -Naur firebird-1.5.3.4870.old/src/wal/walw.cpp firebird-1.5.3.4870/src/wal/walw.cpp
3241 --- firebird-1.5.3.4870.old/src/wal/walw.cpp 2006-08-06 06:47:20.000000000 +0200
3242 +++ firebird-1.5.3.4870/src/wal/walw.cpp 2006-08-06 07:57:21.000000000 +0200
3247 - argc = (int) argv[0];
3248 + argc = (int) (IPTR) argv[0];
3252 diff -Naur firebird-1.5.3.4870.old/src/dudley/exe.epp firebird-1.5.3.4870/src/dudley/exe.epp
3253 --- firebird-1.5.3.4870.old/src/dudley/exe.epp 2006-08-06 06:47:26.000000000 +0200
3254 +++ firebird-1.5.3.4870/src/dudley/exe.epp 2006-08-06 08:06:25.000000000 +0200
3259 - drop_shadow((SLONG) action->act_object);
3260 + drop_shadow((SLONG) (IPTR) action->act_object);
3263 case act_a_generator:
3265 --- firebird/src/jrd/jrd.h~ 2005-06-07 12:22:40.000000000 +0200
3266 +++ firebird/src/jrd/jrd.h 2006-08-20 15:31:53.734361000 +0200
3267 @@ -1050,8 +1050,10 @@
3269 #if !defined(REQUESTER)
3273 extern IHNDL internal_db_handles;
3276 #endif /* REQUESTER */