1 --- firebird-1.5.2.4731/src/jrd/met.epp.orig 2004-09-15 00:01:51.000000000 +0200
2 +++ firebird-1.5.2.4731/src/jrd/met.epp 2005-12-24 12:57:15.942243120 +0100
3 @@ -2133,13 +2133,13 @@
4 index_number < references->frgn_reference_ids->count();
7 - if (idx->idx_id == (UCHAR) (*references->frgn_reference_ids)
8 + if (idx->idx_id == (UCHAR)(size_t) (*references->frgn_reference_ids)
11 idx->idx_primary_relation =
12 - (USHORT) (*references->frgn_relations)[index_number];
13 + (USHORT)(size_t) (*references->frgn_relations)[index_number];
14 idx->idx_primary_index =
15 - (UCHAR) (*references->frgn_indexes)[index_number];
16 + (UCHAR)(size_t) (*references->frgn_indexes)[index_number];
21 index_number < dependencies->prim_reference_ids->count();
24 - if (idx->idx_id == (UCHAR) (*dependencies->prim_reference_ids)
25 + if (idx->idx_id == (UCHAR)(size_t) (*dependencies->prim_reference_ids)
28 idx->idx_foreign_primaries =
30 node = (JRD_NOD) LLS_POP(&csb->csb_dependencies);
31 if (!node->nod_arg[e_dep_object])
33 - dpdo_type = (SSHORT) node->nod_arg[e_dep_object_type];
34 + dpdo_type = (SSHORT)(size_t) node->nod_arg[e_dep_object_type];
40 if (field_node->nod_type == nod_field)
42 - fld_id = (SSHORT) field_node->nod_arg[0];
43 + fld_id = (SSHORT)(size_t) field_node->nod_arg[0];
46 if ( (field = MET_get_field(relation, fld_id)) )
47 --- firebird-1.5.2.4731/src/jrd/blb.cpp.orig 2004-04-27 03:44:57.000000000 +0200
48 +++ firebird-1.5.2.4731/src/jrd/blb.cpp 2005-12-24 13:08:13.803233048 +0100
50 request = tdbb->tdbb_request;
51 source = (BID) from_desc->dsc_address;
52 destination = (BID) to_desc->dsc_address;
53 - id = (USHORT) field->nod_arg[e_fld_id];
54 + id = (USHORT)(size_t) field->nod_arg[e_fld_id];
55 rpb = &request->req_rpb[(int) field->nod_arg[e_fld_stream]];
56 relation = rpb->rpb_relation;
57 record = rpb->rpb_record;
58 --- firebird-1.5.2.4731/src/jrd/cmp.cpp.orig 2004-12-03 08:59:29.000000000 +0100
59 +++ firebird-1.5.2.4731/src/jrd/cmp.cpp 2005-12-24 13:17:54.373972880 +0100
61 /* Clone the request */
64 - (USHORT) ((request->req_impure_size - REQ_SIZE + REQ_TAIL - 1) /
65 + (USHORT)(size_t) ((request->req_impure_size - REQ_SIZE + REQ_TAIL - 1) /
67 clone = FB_NEW_RPT(*request->req_pool, n) jrd_req(request->req_pool);
68 (*vector)[level] = (BLK) clone;
73 - id = (USHORT) node->nod_arg[e_fld_id];
74 + id = (USHORT)(size_t) node->nod_arg[e_fld_id];
76 - CMP_format(tdbb, csb, (USHORT) node->nod_arg[e_fld_stream]);
77 + CMP_format(tdbb, csb, (USHORT)(size_t) node->nod_arg[e_fld_stream]);
78 if (id >= format->fmt_count) {
79 desc->dsc_dtype = dtype_null;
83 sub = node->nod_arg[e_scl_field];
85 - csb->csb_rpt[(USHORT) sub->
86 + csb->csb_rpt[(USHORT)(size_t) sub->
87 nod_arg[e_fld_stream]].csb_relation;
88 - id = (USHORT) sub->nod_arg[e_fld_id];
89 + id = (USHORT)(size_t) sub->nod_arg[e_fld_id];
90 field = MET_get_field(relation, id);
91 if (!field || !(array = field->fld_array))
92 IBERROR(223); /* msg 223 argument of scalar operation must be an array */
94 !input->nod_arg[e_fld_id] && !input->nod_arg[e_fld_stream])
97 - field_id = (USHORT) input->nod_arg[e_fld_id];
98 - stream = (USHORT) input->nod_arg[e_fld_stream];
99 + field_id = (USHORT)(size_t) input->nod_arg[e_fld_id];
100 + stream = (USHORT)(size_t) input->nod_arg[e_fld_stream];
104 @@ -2660,7 +2660,7 @@
105 relation = (*csb)->csb_rpt[stream].csb_relation;
106 field = MET_get_field(relation, field_id);
107 if (field->fld_source)
108 - field_id = (USHORT) field->fld_source->nod_arg[e_fld_id];
109 + field_id = (USHORT)(size_t) field->fld_source->nod_arg[e_fld_id];
112 stream = remap[stream];
113 @@ -2771,7 +2771,7 @@
114 node->nod_type = input->nod_type;
117 - stream = (USHORT) input->nod_arg[e_rel_stream];
118 + stream = (USHORT)(size_t) input->nod_arg[e_rel_stream];
120 Last entry in the remap contains the the original stream number.
121 Get that stream number so that the flags can be copied
122 @@ -2851,7 +2851,7 @@
123 node->nod_arg[e_prc_inputs] =
124 copy(tdbb, csb, input->nod_arg[e_prc_inputs], remap, field_id,
125 node->nod_arg[e_prc_in_msg], remap_fld);
126 - stream = (USHORT) input->nod_arg[e_prc_stream];
127 + stream = (USHORT)(size_t) input->nod_arg[e_prc_stream];
128 new_stream = (*csb)->csb_n_stream++;
129 node->nod_arg[e_prc_stream] = (JRD_NOD) (SLONG) new_stream;
130 /* TMN: Here we should really have the following assert */
131 @@ -2861,7 +2861,7 @@
132 element = CMP_csb_element(csb, new_stream);
133 // SKIDDER: Maybe we need to check if we really found a procedure ?
134 element->csb_procedure = MET_lookup_procedure_id(tdbb,
135 - (SSHORT)node->nod_arg[e_prc_procedure],FALSE,FALSE,0);
136 + (SSHORT)(size_t)node->nod_arg[e_prc_procedure],FALSE,FALSE,0);
138 (*csb)->csb_rpt[new_stream].csb_flags |=
139 (*csb)->csb_rpt[stream].csb_flags & csb_no_dbkey;
140 @@ -2874,7 +2874,7 @@
141 node = PAR_make_node(tdbb, e_agg_length);
142 node->nod_type = input->nod_type;
144 - stream = (USHORT) input->nod_arg[e_agg_stream];
145 + stream = (USHORT)(size_t) input->nod_arg[e_agg_stream];
146 assert(stream <= MAX_STREAMS);
147 new_stream = (*csb)->csb_n_stream++;
148 assert(new_stream <= MAX_STREAMS);
149 @@ -2903,7 +2903,7 @@
150 node = PAR_make_node(tdbb, e_uni_length);
151 node->nod_type = input->nod_type;
153 - stream = (USHORT) input->nod_arg[e_uni_stream];
154 + stream = (USHORT)(size_t) input->nod_arg[e_uni_stream];
155 new_stream = (*csb)->csb_n_stream++;
156 node->nod_arg[e_uni_stream] = (JRD_NOD) (SLONG) new_stream;
157 /* TMN: Here we should really have the following assert */
158 @@ -3041,7 +3041,7 @@
162 - stream = (USHORT) node->nod_arg[e_rel_stream];
163 + stream = (USHORT)(size_t) node->nod_arg[e_rel_stream];
164 csb->csb_rpt[stream].csb_flags |= csb_no_dbkey;
165 tail = &csb->csb_rpt[stream];
166 if ( (relation = tail->csb_relation) )
167 @@ -3269,7 +3269,7 @@
169 UCHAR *map, local_map[MAP_LENGTH];
171 - stream = (USHORT) node->nod_arg[e_fld_stream];
172 + stream = (USHORT)(size_t) node->nod_arg[e_fld_stream];
174 /* Look at all rse's which are lower in scope than the rse which this field
175 is referencing, and mark them as varying -- the rule is that if a field
176 @@ -3290,7 +3290,7 @@
177 if (!(relation = tail->csb_relation) ||
179 MET_get_field(relation,
180 - (USHORT) node->nod_arg[e_fld_id]))) break;
181 + (USHORT)(size_t) node->nod_arg[e_fld_id]))) break;
183 /* if this is a modify or store, check REFERENCES access to any foreign keys. */
185 @@ -3402,9 +3402,9 @@
187 sub = node->nod_arg[e_asgn_from];
188 if (sub->nod_type == nod_field) {
189 - stream = (USHORT) sub->nod_arg[e_fld_stream];
190 + stream = (USHORT)(size_t) sub->nod_arg[e_fld_stream];
191 field = MET_get_field((*csb)->csb_rpt[stream].csb_relation,
192 - (USHORT) sub->nod_arg[e_fld_id]);
193 + (USHORT)(size_t) sub->nod_arg[e_fld_id]);
195 node->nod_arg[e_asgn_missing2] = field->fld_missing_value;
197 @@ -3412,12 +3412,12 @@
198 sub = node->nod_arg[e_asgn_to];
199 if (sub->nod_type != nod_field)
201 - stream = (USHORT) sub->nod_arg[e_fld_stream];
202 + stream = (USHORT)(size_t) sub->nod_arg[e_fld_stream];
203 tail = &(*csb)->csb_rpt[stream];
206 MET_get_field(tail->csb_relation,
207 - (USHORT) sub->nod_arg[e_fld_id]))) break;
208 + (USHORT)(size_t) sub->nod_arg[e_fld_id]))) break;
209 if (field->fld_missing_value) {
210 node->nod_arg[e_asgn_missing] = field->fld_missing_value;
212 @@ -3431,7 +3431,7 @@
216 - stream = (USHORT) node->nod_arg[e_mod_new_stream];
217 + stream = (USHORT)(size_t) node->nod_arg[e_mod_new_stream];
218 tail = &(*csb)->csb_rpt[stream];
219 tail->csb_flags |= csb_modify;
220 pass1_modify(tdbb, csb, node);
221 @@ -3439,13 +3439,13 @@
222 /* assert(node->nod_arg [e_mod_new_stream] <= MAX_USHORT); */
223 if ( (node->nod_arg[e_mod_validate] =
224 make_validation(tdbb, csb,
226 + (USHORT)(size_t) node->
227 nod_arg[e_mod_new_stream])) ) node->nod_count =
228 MAX(node->nod_count, (USHORT) e_mod_validate + 1);
232 - stream = (USHORT) node->nod_arg[e_erase_stream];
233 + stream = (USHORT)(size_t) node->nod_arg[e_erase_stream];
234 tail = &(*csb)->csb_rpt[stream];
235 tail->csb_flags |= csb_erase;
236 pass1_erase(tdbb, csb, node);
237 @@ -3461,12 +3461,12 @@
240 sub = node->nod_arg[e_sto_relation];
241 - stream = (USHORT) sub->nod_arg[e_rel_stream];
242 + stream = (USHORT)(size_t) sub->nod_arg[e_rel_stream];
243 tail = &(*csb)->csb_rpt[stream];
244 tail->csb_flags |= csb_store;
245 sub = pass1_store(tdbb, csb, node);
247 - stream = (USHORT) sub->nod_arg[e_rel_stream];
248 + stream = (USHORT)(size_t) sub->nod_arg[e_rel_stream];
249 if ((!node->nod_arg[e_sto_sub_store]) &&
250 (node->nod_arg[e_sto_validate] =
251 make_validation(tdbb, csb, stream))) node->nod_count =
252 @@ -3493,7 +3493,7 @@
255 assert((int)node->nod_arg[e_agg_stream] <= MAX_STREAMS);
256 - (*csb)->csb_rpt[(USHORT) node->nod_arg[e_agg_stream]].csb_flags |=
257 + (*csb)->csb_rpt[(USHORT)(size_t) node->nod_arg[e_agg_stream]].csb_flags |=
259 ignore_dbkey(tdbb, *csb, (RSE) node->nod_arg[e_agg_rse], view);
260 node->nod_arg[e_agg_rse] =
261 @@ -3521,7 +3521,7 @@
264 type = node->nod_type;
265 - stream = (USHORT) node->nod_arg[0];
266 + stream = (USHORT)(size_t) node->nod_arg[0];
268 if (!(*csb)->csb_rpt[stream].csb_map)
270 @@ -3556,7 +3556,7 @@
273 case nod_cardinality:
274 - stream = (USHORT) node->nod_arg[e_card_stream];
275 + stream = (USHORT)(size_t) node->nod_arg[e_card_stream];
276 (*csb)->csb_rpt[stream].csb_flags |= csb_compute;
279 @@ -3623,7 +3623,7 @@
280 /* To support views of views, loop until we hit a real relation */
283 - stream = new_stream = (USHORT) node->nod_arg[e_erase_stream];
284 + stream = new_stream = (USHORT)(size_t) node->nod_arg[e_erase_stream];
285 tail = &(*csb)->csb_rpt[stream];
286 tail->csb_flags |= csb_erase;
287 relation = (*csb)->csb_rpt[stream].csb_relation;
288 @@ -3691,7 +3691,7 @@
291 parent_stream = stream;
292 - new_stream = (USHORT) source->nod_arg[e_rel_stream];
293 + new_stream = (USHORT)(size_t) source->nod_arg[e_rel_stream];
294 node->nod_arg[e_erase_stream] = (JRD_NOD) (SLONG) map[new_stream];
297 @@ -3738,7 +3738,7 @@
298 field = MET_get_field(relation, id);
299 if (field->fld_source)
301 - (USHORT) (JRD_NOD) (field->fld_source)->nod_arg[e_fld_id];
302 + (USHORT)(size_t) (JRD_NOD) (field->fld_source)->nod_arg[e_fld_id];
306 @@ -3800,8 +3800,8 @@
307 /* To support views of views, loop until we hit a real relation */
310 - stream = (USHORT) node->nod_arg[e_mod_org_stream];
311 - new_stream = (USHORT) node->nod_arg[e_mod_new_stream];
312 + stream = (USHORT)(size_t) node->nod_arg[e_mod_org_stream];
313 + new_stream = (USHORT)(size_t) node->nod_arg[e_mod_new_stream];
314 tail = &(*csb)->csb_rpt[new_stream];
315 tail->csb_flags |= csb_modify;
316 relation = (*csb)->csb_rpt[stream].csb_relation;
317 @@ -3840,7 +3840,7 @@
319 MAX(node->nod_count, (USHORT) e_mod_map_view + 1);
320 map = (*csb)->csb_rpt[stream].csb_map;
321 - stream = (USHORT) source->nod_arg[e_rel_stream];
322 + stream = (USHORT)(size_t) source->nod_arg[e_rel_stream];
323 stream = map[stream];
324 view_stream = new_stream;
326 @@ -3848,18 +3848,18 @@
330 - (SSHORT) node->nod_arg[e_mod_new_stream]);
331 + (SSHORT)(size_t) node->nod_arg[e_mod_new_stream]);
332 source = copy(tdbb, csb, source, map, 0, NULL, FALSE);
333 /* TMN: Here we should really have the following assert */
334 /* assert(source->nod_arg [e_rel_stream] <= MAX_UCHAR); */
335 - map[new_stream] = (UCHAR) source->nod_arg[e_rel_stream];
336 + map[new_stream] = (UCHAR)(size_t) source->nod_arg[e_rel_stream];
337 view_node = copy(tdbb, csb, node, map, 0, NULL, TRUE);
338 view_node->nod_arg[e_mod_org_stream] = (JRD_NOD) (SLONG) stream;
339 view_node->nod_arg[e_mod_new_stream] =
340 source->nod_arg[e_rel_stream];
341 view_node->nod_arg[e_mod_map_view] = NULL;
342 node->nod_arg[e_mod_sub_mod] = view_node;
343 - new_stream = (USHORT) source->nod_arg[e_rel_stream];
344 + new_stream = (USHORT)(size_t) source->nod_arg[e_rel_stream];
345 view_node->nod_arg[e_mod_statement] =
346 pass1_expand_view(tdbb, *csb, view_stream, new_stream, TRUE);
348 @@ -3872,14 +3872,14 @@
349 /* View passes muster -- do some translation. Start with source stream */
351 map = (*csb)->csb_rpt[stream].csb_map;
352 - stream = (USHORT) source->nod_arg[e_rel_stream];
353 + stream = (USHORT)(size_t) source->nod_arg[e_rel_stream];
354 node->nod_arg[e_mod_org_stream] = (JRD_NOD) (SLONG) map[stream];
356 /* Next, do update stream */
360 - (SSHORT) node->nod_arg[e_mod_new_stream]);
361 + (SSHORT)(size_t) node->nod_arg[e_mod_new_stream]);
362 source = copy(tdbb, csb, source, map, 0, NULL, FALSE);
363 node->nod_arg[e_mod_new_stream] = source->nod_arg[e_rel_stream];
365 @@ -4126,7 +4126,7 @@
367 pass1(tdbb, csb, source, parent_view, view_stream, FALSE);
368 procedure = MET_lookup_procedure_id(tdbb,
369 - (SSHORT)source->nod_arg[e_prc_procedure], FALSE, FALSE, 0);
370 + (SSHORT)(size_t)source->nod_arg[e_prc_procedure], FALSE, FALSE, 0);
371 post_procedure_access(tdbb, *csb, procedure);
372 CMP_post_resource(&(*csb)->csb_resources, (BLK) procedure,
373 Resource::rsc_procedure, procedure->prc_id);
374 @@ -4158,7 +4158,7 @@
376 source->nod_arg[e_rel_view] = (JRD_NOD) parent_view;
378 - stream = (USHORT) source->nod_arg[e_rel_stream];
379 + stream = (USHORT)(size_t) source->nod_arg[e_rel_stream];
380 element = CMP_csb_element(csb, stream);
381 element->csb_view = parent_view;
382 /* TMN: Here we should really have the following assert */
383 @@ -4173,7 +4173,7 @@
384 for (vcx_ptr = &parent_view->rel_view_contexts; *vcx_ptr;
385 vcx_ptr = &(*vcx_ptr)->vcx_next)
386 if ((*vcx_ptr)->vcx_context ==
387 - (USHORT) source->nod_arg[e_rel_context]) {
388 + (USHORT)(size_t) source->nod_arg[e_rel_context]) {
389 element->csb_alias = (*vcx_ptr)->vcx_context_name;
392 @@ -4317,7 +4317,7 @@
395 original = node->nod_arg[e_sto_relation];
396 - stream = (USHORT) original->nod_arg[e_rel_stream];
397 + stream = (USHORT)(size_t) original->nod_arg[e_rel_stream];
398 tail = &(*csb)->csb_rpt[stream];
399 tail->csb_flags |= csb_store;
400 relation = (*csb)->csb_rpt[stream].csb_relation;
401 @@ -4371,7 +4371,7 @@
402 node->nod_arg[e_sto_relation] =
403 copy(tdbb, csb, source, map, 0, NULL, FALSE);
405 - (USHORT) node->nod_arg[e_sto_relation]->nod_arg[e_rel_stream];
406 + (USHORT)(size_t) node->nod_arg[e_sto_relation]->nod_arg[e_rel_stream];
407 node->nod_arg[e_sto_statement] =
408 pass1_expand_view(tdbb, *csb, stream, new_stream, TRUE);
409 node->nod_arg[e_sto_statement] =
410 @@ -4719,9 +4719,9 @@
411 /* AB: Mark the streams involved with an UPDATE statement
412 active. So that the optimizer can use indices for
413 eventually used sub-selects. */
414 - stream = (USHORT) node->nod_arg[e_mod_org_stream];
415 + stream = (USHORT)(size_t) node->nod_arg[e_mod_org_stream];
416 csb->csb_rpt[stream].csb_flags |= csb_active;
417 - stream = (USHORT) node->nod_arg[e_mod_new_stream];
418 + stream = (USHORT)(size_t) node->nod_arg[e_mod_new_stream];
419 csb->csb_rpt[stream].csb_flags |= csb_active;
422 @@ -4733,9 +4733,9 @@
424 if (node->nod_type == nod_modify) {
425 /* AB: Remove the previous flags */
426 - stream = (USHORT) node->nod_arg[e_mod_org_stream];
427 + stream = (USHORT)(size_t) node->nod_arg[e_mod_org_stream];
428 csb->csb_rpt[stream].csb_flags &= ~csb_active;
429 - stream = (USHORT) node->nod_arg[e_mod_new_stream];
430 + stream = (USHORT)(size_t) node->nod_arg[e_mod_new_stream];
431 csb->csb_rpt[stream].csb_flags &= ~csb_active;
434 @@ -4834,7 +4834,7 @@
436 fmt::fmt_desc_iterator desc;
438 - stream = (USHORT) node->nod_arg[e_mod_org_stream];
439 + stream = (USHORT)(size_t) node->nod_arg[e_mod_org_stream];
440 csb->csb_rpt[stream].csb_flags |= csb_update;
441 format = CMP_format(tdbb, csb, stream);
442 desc = format->fmt_desc.begin();
443 @@ -4859,13 +4859,13 @@
447 - stream = (USHORT) node->nod_arg[e_erase_stream];
448 + stream = (USHORT)(size_t) node->nod_arg[e_erase_stream];
449 csb->csb_rpt[stream].csb_flags |= csb_update;
453 - stream = (USHORT) node->nod_arg[e_fld_stream];
454 - id = (USHORT) node->nod_arg[e_fld_id];
455 + stream = (USHORT)(size_t) node->nod_arg[e_fld_stream];
456 + id = (USHORT)(size_t) node->nod_arg[e_fld_id];
457 SBM_set(tdbb, &csb->csb_rpt[stream].csb_fields, id);
458 if (node->nod_flags & nod_value) {
459 csb->csb_impure += sizeof(struct vlux);
460 @@ -4939,7 +4939,7 @@
461 pass2_rse(tdbb, csb, (RSE) node->nod_arg[e_agg_rse]);
462 pass2(tdbb, csb, node->nod_arg[e_agg_map], node);
463 pass2(tdbb, csb, node->nod_arg[e_agg_group], node);
464 - stream = (USHORT) node->nod_arg[e_agg_stream];
465 + stream = (USHORT)(size_t) node->nod_arg[e_agg_stream];
466 assert(stream <= MAX_STREAMS);
467 process_map(tdbb, csb, node->nod_arg[e_agg_map],
468 &csb->csb_rpt[stream].csb_format);
469 @@ -5048,7 +5048,7 @@
472 if (node->nod_type == nod_relation) {
473 - USHORT stream = (USHORT) node->nod_arg[e_rel_stream];
474 + USHORT stream = (USHORT)(size_t) node->nod_arg[e_rel_stream];
475 csb->csb_rpt[stream].csb_flags |= csb_active;
476 pass2(tdbb, csb, node, (JRD_NOD) rse);
478 @@ -5056,12 +5056,12 @@
479 pass2_rse(tdbb, csb, (RSE) node);
481 else if (node->nod_type == nod_procedure) {
482 - USHORT stream = (USHORT) node->nod_arg[e_prc_stream];
483 + USHORT stream = (USHORT)(size_t) node->nod_arg[e_prc_stream];
484 csb->csb_rpt[stream].csb_flags |= csb_active;
485 pass2(tdbb, csb, node, (JRD_NOD) rse);
487 else if (node->nod_type == nod_aggregate) {
488 - USHORT stream = (USHORT) node->nod_arg[e_agg_stream];
489 + USHORT stream = (USHORT)(size_t) node->nod_arg[e_agg_stream];
490 assert(stream <= MAX_STREAMS);
491 csb->csb_rpt[stream].csb_flags |= csb_active;
492 pass2(tdbb, csb, node, (JRD_NOD) rse);
493 @@ -5116,7 +5116,7 @@
494 /* Make up a format block sufficiently large to hold instantiated record */
496 clauses = node->nod_arg[e_uni_clauses];
497 - id = (USHORT) node->nod_arg[e_uni_stream];
498 + id = (USHORT)(size_t) node->nod_arg[e_uni_stream];
499 format = &csb->csb_rpt[id].csb_format;
501 /* Process alternating rse and map blocks */
502 @@ -5158,7 +5158,7 @@
504 for (ptr = rse->rse_relation, end = ptr + rse->rse_count; ptr < end;
505 ptr++) if ((*ptr)->nod_type == nod_relation) {
506 - stream = (USHORT) (*ptr)->nod_arg[e_rel_stream];
507 + stream = (USHORT)(size_t) (*ptr)->nod_arg[e_rel_stream];
508 if (!(csb->csb_rpt[stream].csb_plan))
509 ERR_post(gds_no_stream_plan, gds_arg_string,
510 csb->csb_rpt[stream].csb_relation->rel_name, 0);
511 @@ -5211,7 +5211,7 @@
513 /* find the tail for the relation specified in the rse */
515 - stream = (USHORT) plan_relation_node->nod_arg[e_rel_stream];
516 + stream = (USHORT)(size_t) plan_relation_node->nod_arg[e_rel_stream];
517 tail = &csb->csb_rpt[stream];
519 /* if the plan references a view, find the real base relation
520 @@ -5447,15 +5447,15 @@
523 if (node->nod_type == nod_relation) {
524 - USHORT stream = (USHORT) node->nod_arg[e_rel_stream];
525 + USHORT stream = (USHORT)(size_t) node->nod_arg[e_rel_stream];
526 csb->csb_rpt[stream].csb_flags &= ~csb_active;
528 else if (node->nod_type == nod_procedure) {
529 - USHORT stream = (USHORT) node->nod_arg[e_prc_stream];
530 + USHORT stream = (USHORT)(size_t) node->nod_arg[e_prc_stream];
531 csb->csb_rpt[stream].csb_flags &= ~csb_active;
533 else if (node->nod_type == nod_aggregate) {
534 - USHORT stream = (USHORT) node->nod_arg[e_agg_stream];
535 + USHORT stream = (USHORT)(size_t) node->nod_arg[e_agg_stream];
536 assert(stream <= MAX_STREAMS);
537 csb->csb_rpt[stream].csb_flags &= ~csb_active;
539 @@ -5551,7 +5551,7 @@
540 for (end = ptr + map->nod_count; ptr < end; ptr++) {
542 field = assignment->nod_arg[e_asgn_to];
543 - id = (USHORT) field->nod_arg[e_fld_id];
544 + id = (USHORT)(size_t) field->nod_arg[e_fld_id];
545 if (id >= format->fmt_count) {
546 format->fmt_desc.resize(id + 1);
548 @@ -5687,13 +5687,13 @@
549 /* for aggregates, check current rse, if not found then check
551 if (sub->nod_type == nod_aggregate) {
552 - if ((stream == (USHORT) sub->nod_arg[e_rel_stream]) ||
553 + if ((stream == (USHORT)(size_t) sub->nod_arg[e_rel_stream]) ||
554 (stream_in_rse(stream, (RSE) sub->nod_arg[e_agg_rse])))
555 return TRUE; /* do not mark as variant */
558 if ((sub->nod_type == nod_relation) &&
559 - (stream == (USHORT) sub->nod_arg[e_rel_stream]))
560 + (stream == (USHORT)(size_t) sub->nod_arg[e_rel_stream]))
561 return TRUE; /* do not mark as variant */
564 --- firebird-1.5.2.4731/src/jrd/evl.cpp.orig 2004-10-12 17:34:39.000000000 +0200
565 +++ firebird-1.5.2.4731/src/jrd/evl.cpp 2005-12-24 13:31:35.388159752 +0100
567 // All seem to work fine.
569 request->req_rpb[(int) node->nod_arg[e_fld_stream]].rpb_record;
570 - EVL_field(0, record, (USHORT) node->nod_arg[e_fld_id],
571 + EVL_field(0, record, (USHORT)(size_t) node->nod_arg[e_fld_id],
573 if (!impure->vlu_desc.dsc_address)
574 ERR_post(gds_read_only_field, 0);
576 impure = (INV) ((SCHAR *) tdbb->tdbb_request + node->nod_impure);
577 SBM_reset(&impure->inv_bitmap);
578 desc = EVL_expr(tdbb, node->nod_arg[0]);
579 - id = 1 + 2 * (USHORT) node->nod_arg[1];
580 + id = 1 + 2 * (USHORT)(size_t) node->nod_arg[1];
581 numbers = desc->dsc_address;
582 numbers += id * sizeof(SLONG);
583 MOVE_FAST(numbers, &rel_dbkey, sizeof(SLONG));
585 * the relation block is referenced.
586 * Reference: Bug 10116, 10424
588 - if (!EVL_field(request->req_rpb[(USHORT) node->nod_arg[e_fld_stream]].rpb_relation,
589 + if (!EVL_field(request->req_rpb[(USHORT)(size_t) node->nod_arg[e_fld_stream]].rpb_relation,
591 - (USHORT) node->nod_arg[e_fld_id],
592 + (USHORT)(size_t) node->nod_arg[e_fld_id],
595 request->req_flags |= req_null;
596 @@ -1725,7 +1725,7 @@
598 from = (*ptr)->nod_arg[e_asgn_from];
599 field = (*ptr)->nod_arg[e_asgn_to];
600 - id = (USHORT) field->nod_arg[e_fld_id];
601 + id = (USHORT)(size_t) field->nod_arg[e_fld_id];
603 request->req_rpb[(int) field->nod_arg[e_fld_stream]].rpb_record;
604 impure = (VLUX) ((SCHAR *) request + from->nod_impure);
605 --- firebird-1.5.2.4731/src/jrd/exe.cpp.orig 2004-11-06 07:07:51.000000000 +0100
606 +++ firebird-1.5.2.4731/src/jrd/exe.cpp 2005-12-24 13:33:42.787792064 +0100
609 if (to->nod_type == nod_field)
611 - SSHORT id = (USHORT) to->nod_arg[e_fld_id];
612 + SSHORT id = (USHORT)(size_t) to->nod_arg[e_fld_id];
613 REC record = request->req_rpb[(int) to->nod_arg[e_fld_stream]].rpb_record;
615 SET_NULL(record, id);
617 message = request->req_message;
618 format = (FMT) message->nod_arg[e_msg_format];
620 - if (msg != (USHORT) message->nod_arg[e_msg_number])
621 + if (msg != (USHORT)(size_t) message->nod_arg[e_msg_number])
622 ERR_post(gds_req_sync, 0);
624 if (length != format->fmt_length)
626 for (ptr = node->nod_arg, end = ptr + node->nod_count; ptr < end;
628 message = (*ptr)->nod_arg[e_send_message];
629 - if ((USHORT) message->nod_arg[e_msg_number] == msg) {
630 + if ((USHORT)(size_t) message->nod_arg[e_msg_number] == msg) {
631 request->req_next = *ptr;
636 format = (FMT) message->nod_arg[e_msg_format];
638 - if (msg != (USHORT) message->nod_arg[e_msg_number])
639 + if (msg != (USHORT)(size_t) message->nod_arg[e_msg_number])
640 ERR_post(gds_req_sync, 0);
642 if (length != format->fmt_length)
643 @@ -2016,7 +2016,7 @@
644 case jrd_req::req_evaluate:
645 if (transaction != dbb->dbb_sys_trans) {
647 - UCHAR operation = (UCHAR) node->nod_arg[e_sav_operation];
648 + UCHAR operation = (UCHAR)(size_t) node->nod_arg[e_sav_operation];
649 TEXT * node_savepoint_name = (TEXT*) node->nod_arg[e_sav_name];
651 // Skip the savepoint created by EXE_start
652 @@ -2329,7 +2329,7 @@
655 case jrd_req::req_unwind:
656 - if ((request->req_label == (USHORT) node->nod_arg[e_lbl_label]) &&
657 + if ((request->req_label == (USHORT)(size_t) node->nod_arg[e_lbl_label]) &&
658 (request->req_flags & (req_leave | req_error_handler))) {
659 request->req_flags &= ~req_leave;
660 request->req_operation = jrd_req::req_return;
661 @@ -2343,7 +2343,7 @@
663 request->req_flags |= req_leave;
664 request->req_operation = jrd_req::req_unwind;
665 - request->req_label = (USHORT) node->nod_arg[0];
666 + request->req_label = (USHORT)(size_t) node->nod_arg[0];
667 node = node->nod_parent;
670 @@ -2795,11 +2795,11 @@
671 transaction = request->req_transaction;
672 impure = (STA) ((SCHAR *) request + node->nod_impure);
674 - org_stream = (USHORT) node->nod_arg[e_mod_org_stream];
675 + org_stream = (USHORT)(size_t) node->nod_arg[e_mod_org_stream];
676 org_rpb = &request->req_rpb[org_stream];
677 relation = org_rpb->rpb_relation;
679 - new_stream = (USHORT) node->nod_arg[e_mod_new_stream];
680 + new_stream = (USHORT)(size_t) node->nod_arg[e_mod_new_stream];
681 new_rpb = &request->req_rpb[new_stream];
684 @@ -3796,7 +3796,7 @@
685 JRD_REQ request = tdbb->tdbb_request;
686 JRD_TRA transaction = request->req_transaction;
687 STA impure = (STA) ((SCHAR *) request + node->nod_impure);
688 - SSHORT stream = (USHORT) node->nod_arg[e_sto_relation]->nod_arg[e_rel_stream];
689 + SSHORT stream = (USHORT)(size_t) node->nod_arg[e_sto_relation]->nod_arg[e_rel_stream];
690 RPB* rpb = &request->req_rpb[stream];
691 JRD_REL relation = rpb->rpb_relation;
693 @@ -4202,8 +4202,8 @@
695 if (node->nod_type == nod_field)
697 - stream = (USHORT) node->nod_arg[e_fld_stream];
698 - id = (USHORT) node->nod_arg[e_fld_id];
699 + stream = (USHORT)(size_t) node->nod_arg[e_fld_stream];
700 + id = (USHORT)(size_t) node->nod_arg[e_fld_id];
701 relation = request->req_rpb[stream].rpb_relation;
703 if ((vector = relation->rel_fields) &&
704 --- firebird-1.5.2.4731/src/jrd/ext.cpp.orig 2003-06-16 17:42:58.000000000 +0200
705 +++ firebird-1.5.2.4731/src/jrd/ext.cpp 2005-12-24 13:34:26.333172160 +0100
707 record = rpb->rpb_record;
708 format = record->rec_format;
710 - offset = (SSHORT) format->fmt_desc[0].dsc_address;
711 + offset = (SSHORT)(size_t) format->fmt_desc[0].dsc_address;
712 p = record->rec_data + offset;
713 l = record->rec_length - offset;
719 - offset = (USHORT) format->fmt_desc[0].dsc_address;
720 + offset = (USHORT)(size_t) format->fmt_desc[0].dsc_address;
721 p = record->rec_data + offset;
722 l = record->rec_length - offset;
724 --- firebird-1.5.2.4731/src/jrd/idx.cpp.orig 2004-09-15 00:01:50.000000000 +0200
725 +++ firebird-1.5.2.4731/src/jrd/idx.cpp 2005-12-24 13:35:08.531757000 +0100
726 @@ -1051,12 +1051,12 @@
727 index_number < idx->idx_foreign_primaries->count();
730 - (UCHAR) (*idx->idx_foreign_primaries)[index_number]) continue;
731 + (UCHAR)(size_t) (*idx->idx_foreign_primaries)[index_number]) continue;
734 (int) (*idx->idx_foreign_relations)[index_number]);
736 - (USHORT) (*idx->idx_foreign_indexes)[index_number];
737 + (USHORT)(size_t) (*idx->idx_foreign_indexes)[index_number];
739 check_partner_index(tdbb, relation, record, transaction, idx,
740 partner_relation, index_id)) )
741 --- firebird-1.5.2.4731/src/jrd/opt.cpp.orig 2004-11-27 16:57:53.000000000 +0100
742 +++ firebird-1.5.2.4731/src/jrd/opt.cpp 2005-12-24 13:42:07.610047416 +0100
745 if (node->nod_type != nod_rse)
747 - stream = (USHORT) node->nod_arg[STREAM_INDEX(node)];
748 + stream = (USHORT)(size_t) node->nod_arg[STREAM_INDEX(node)];
749 assert(stream <= MAX_UCHAR);
750 assert(beds[0] < MAX_STREAMS && beds[0] < MAX_UCHAR);
751 beds[++beds[0]] = (UCHAR) stream;
753 (USHORT) (key_streams[0] - i));
754 assert(local_streams[0] < MAX_STREAMS && local_streams[0] < MAX_UCHAR);
755 local_streams[++local_streams[0]] =
756 - (UCHAR) node->nod_arg[e_uni_stream];
757 + (UCHAR)(size_t) node->nod_arg[e_uni_stream];
759 else if (node->nod_type == nod_aggregate) {
760 assert((int)node->nod_arg[e_agg_stream] <= MAX_STREAMS);
761 @@ -408,13 +408,13 @@
762 rsb = gen_aggregate(tdbb, opt_, node);
763 assert(local_streams[0] < MAX_STREAMS && local_streams[0] < MAX_UCHAR);
764 local_streams[++local_streams[0]] =
765 - (UCHAR) node->nod_arg[e_agg_stream];
766 + (UCHAR)(size_t) node->nod_arg[e_agg_stream];
768 else if (node->nod_type == nod_procedure) {
769 rsb = gen_procedure(tdbb, opt_, node);
770 assert(local_streams[0] < MAX_STREAMS && local_streams[0] < MAX_UCHAR);
771 local_streams[++local_streams[0]] =
772 - (UCHAR) node->nod_arg[e_prc_stream];
773 + (UCHAR)(size_t) node->nod_arg[e_prc_stream];
775 else if (node->nod_type == nod_rse) {
776 compute_rse_streams(csb, (RSE) node, beds);
779 /* Make sure we have the correct stream */
781 - if ((USHORT) dbkey->nod_arg[0] != stream)
782 + if ((USHORT)(size_t) dbkey->nod_arg[0] != stream)
785 /* If this is a dbkey for the appropriate stream, it's invertable */
786 @@ -1687,7 +1687,7 @@
787 switch (node->nod_type) {
790 - n = (USHORT) node->nod_arg[e_fld_stream];
791 + n = (USHORT)(size_t) node->nod_arg[e_fld_stream];
793 if (allowOnlyCurrentStream) {
795 @@ -1713,7 +1713,7 @@
799 - n = (USHORT) node->nod_arg[0];
800 + n = (USHORT)(size_t) node->nod_arg[0];
802 if (allowOnlyCurrentStream) {
804 @@ -1784,7 +1784,7 @@
806 for (ptr = rse->rse_relation, end = ptr + rse->rse_count; ptr < end; ptr++) {
807 if ((*ptr)->nod_type != nod_rse) {
808 - n = (USHORT) (*ptr)->nod_arg[STREAM_INDEX((*ptr))];
809 + n = (USHORT)(size_t) (*ptr)->nod_arg[STREAM_INDEX((*ptr))];
810 csb->csb_rpt[n].csb_flags |= csb_active;
813 @@ -1821,7 +1821,7 @@
815 if ((*ptr)->nod_type != nod_rse)
817 - n = (USHORT) (*ptr)->nod_arg[STREAM_INDEX((*ptr))];
818 + n = (USHORT)(size_t) (*ptr)->nod_arg[STREAM_INDEX((*ptr))];
819 csb->csb_rpt[n].csb_flags &= ~csb_active;
822 @@ -1862,12 +1862,12 @@
824 switch (node->nod_type) {
826 - n = (USHORT) node->nod_arg[e_fld_stream];
827 + n = (USHORT)(size_t) node->nod_arg[e_fld_stream];
828 SET_DEP_BIT(dependencies, n);
832 - n = (USHORT) node->nod_arg[0];
833 + n = (USHORT)(size_t) node->nod_arg[0];
834 SET_DEP_BIT(dependencies, n);
837 @@ -1923,7 +1923,7 @@
839 for (ptr = rse->rse_relation, end = ptr + rse->rse_count; ptr < end; ptr++) {
840 if ((*ptr)->nod_type != nod_rse) {
841 - n = (USHORT) (*ptr)->nod_arg[STREAM_INDEX((*ptr))];
842 + n = (USHORT)(size_t) (*ptr)->nod_arg[STREAM_INDEX((*ptr))];
843 CLEAR_DEP_BIT(dependencies, n);
846 @@ -1951,7 +1951,7 @@
848 if (node->nod_type == nod_relation) {
849 assert(streams[0] < MAX_STREAMS && streams[0] < MAX_UCHAR);
850 - streams[++streams[0]] = (UCHAR) node->nod_arg[e_rel_stream];
851 + streams[++streams[0]] = (UCHAR)(size_t) node->nod_arg[e_rel_stream];
853 else if (node->nod_type == nod_union) {
854 clauses = node->nod_arg[e_uni_clauses];
855 @@ -1991,7 +1991,7 @@
857 if (node->nod_type != nod_rse) {
858 assert(streams[0] < MAX_STREAMS && streams[0] < MAX_UCHAR);
859 - streams[++streams[0]] = (UCHAR) node->nod_arg[STREAM_INDEX(node)];
860 + streams[++streams[0]] = (UCHAR)(size_t) node->nod_arg[STREAM_INDEX(node)];
863 compute_rse_streams(csb, (RSE) node, streams);
864 @@ -3289,7 +3289,7 @@
865 JRD_NOD dbkey_temp, *ptr, *end;
866 DEV_BLKCHK(dbkey, type_nod);
867 if (dbkey->nod_type == nod_dbkey) {
868 - if ((USHORT) dbkey->nod_arg[0] == stream)
869 + if ((USHORT)(size_t) dbkey->nod_arg[0] == stream)
872 *position = *position + 1;
873 @@ -3550,7 +3550,7 @@
876 relation_node = plan_node->nod_arg[e_retrieve_relation];
877 - temp[temp[0]] = (UCHAR) relation_node->nod_arg[e_rel_stream];
878 + temp[temp[0]] = (UCHAR)(size_t) relation_node->nod_arg[e_rel_stream];
881 // just because the user specified a join does not mean that
882 @@ -3724,7 +3724,7 @@
883 rsb->rsb_type = rsb_aggregate;
884 assert((int)node->nod_arg[e_agg_stream] <= MAX_STREAMS);
885 assert((int)node->nod_arg[e_agg_stream] <= MAX_UCHAR);
886 - rsb->rsb_stream = (UCHAR) node->nod_arg[e_agg_stream];
887 + rsb->rsb_stream = (UCHAR)(size_t) node->nod_arg[e_agg_stream];
888 rsb->rsb_format = csb->csb_rpt[rsb->rsb_stream].csb_format;
889 rsb->rsb_next = OPT_compile(tdbb, csb, rse, NULL);
890 rsb->rsb_arg[0] = (RSB) node;
891 @@ -4088,8 +4088,8 @@
892 idx->idx_rpt; ptr < end; ptr++, idx_tail++) {
894 if (node->nod_type != nod_field
895 - || (USHORT) node->nod_arg[e_fld_stream] != stream
896 - || (USHORT) node->nod_arg[e_fld_id] != idx_tail->idx_field
897 + || (USHORT)(size_t) node->nod_arg[e_fld_stream] != stream
898 + || (USHORT)(size_t) node->nod_arg[e_fld_id] != idx_tail->idx_field
899 || ptr[2*sort->nod_count] /* do not use index if NULLS FIRST is used */
900 #ifdef SCROLLABLE_CURSORS
902 @@ -4249,7 +4249,7 @@
904 stream_ptr[i]->stream_rsb = NULL;
905 stream_ptr[i]->stream_num =
906 - (USHORT) node->nod_arg[STREAM_INDEX(node)];
907 + (USHORT)(size_t) node->nod_arg[STREAM_INDEX(node)];
911 @@ -4327,10 +4327,10 @@
914 procedure = MET_lookup_procedure_id(tdbb,
915 - (SSHORT)node->nod_arg[e_prc_procedure], FALSE, FALSE, 0);
916 + (SSHORT)(size_t)node->nod_arg[e_prc_procedure], FALSE, FALSE, 0);
917 rsb = FB_NEW_RPT(*tdbb->tdbb_default, RSB_PRC_count) Rsb();
918 rsb->rsb_type = rsb_procedure;
919 - rsb->rsb_stream = (UCHAR) node->nod_arg[e_prc_stream];
920 + rsb->rsb_stream = (UCHAR)(size_t) node->nod_arg[e_prc_stream];
921 rsb->rsb_procedure = procedure;
922 rsb->rsb_format = procedure->prc_format;
923 rsb->rsb_impure = CMP_impure(csb, sizeof(struct irsb_procedure));
924 @@ -4943,8 +4943,8 @@
925 for (node_ptr = sort->nod_arg; node_ptr < end_node; node_ptr++) {
927 if (node->nod_type == nod_field
928 - && (USHORT) node->nod_arg[e_fld_stream] == *ptr
929 - && (USHORT) node->nod_arg[e_fld_id] == id) {
930 + && (USHORT)(size_t) node->nod_arg[e_fld_stream] == *ptr
931 + && (USHORT)(size_t) node->nod_arg[e_fld_id] == id) {
933 CMP_get_desc(tdbb, csb, node, desc);
934 /* International type text has a computed key */
935 @@ -5041,8 +5041,8 @@
936 map_item->smb_desc.dsc_address = (UCHAR *) map_length;
937 map_length += desc->dsc_length;
938 if (node->nod_type == nod_field) {
939 - map_item->smb_stream = (USHORT) node->nod_arg[e_fld_stream];
940 - map_item->smb_field_id = (USHORT) node->nod_arg[e_fld_id];
941 + map_item->smb_stream = (USHORT)(size_t) node->nod_arg[e_fld_stream];
942 + map_item->smb_field_id = (USHORT)(size_t) node->nod_arg[e_fld_id];
946 @@ -5054,8 +5054,8 @@
947 field has already been mentioned as a sort key, don't bother to repeat
949 while (stream_stack) {
950 - id = (USHORT) LLS_POP(&id_stack);
951 - stream = (USHORT) LLS_POP(&stream_stack);
952 + id = (USHORT)(size_t) LLS_POP(&id_stack);
953 + stream = (USHORT)(size_t) LLS_POP(&stream_stack);
954 format = CMP_format(tdbb, csb, stream);
955 desc = &format->fmt_desc[id];
956 if (id >= format->fmt_count || desc->dsc_length == 0)
957 @@ -5384,7 +5384,7 @@
958 rsb = FB_NEW_RPT(*tdbb->tdbb_default, count + nstreams + 1) Rsb();
959 rsb->rsb_type = rsb_union;
960 rsb->rsb_count = count;
961 - rsb->rsb_stream = (UCHAR) union_node->nod_arg[e_uni_stream];
962 + rsb->rsb_stream = (UCHAR)(size_t) union_node->nod_arg[e_uni_stream];
963 rsb->rsb_format = csb->csb_rpt[rsb->rsb_stream].csb_format;
964 rsb->rsb_impure = CMP_impure(csb, sizeof(struct irsb));
965 rsb_ptr = rsb->rsb_arg;
966 @@ -5926,8 +5926,8 @@
967 field = boolean->nod_arg[0];
968 if (field->nod_type != nod_field)
970 - if ((USHORT) field->nod_arg[e_fld_stream] != stream ||
971 - (USHORT) field->nod_arg[e_fld_id] != idx->idx_rpt[0].idx_field)
972 + if ((USHORT)(size_t) field->nod_arg[e_fld_stream] != stream ||
973 + (USHORT)(size_t) field->nod_arg[e_fld_id] != idx->idx_rpt[0].idx_field)
975 node = make_index_node(tdbb, relation, opt->opt_csb, idx);
976 retrieval = (IRB) node->nod_arg[e_idx_retrieval];
977 @@ -5995,8 +5995,8 @@
981 - if ((USHORT) field->nod_arg[e_fld_stream] != stream ||
982 - (USHORT) field->nod_arg[e_fld_id] != idx->idx_rpt[0].idx_field
983 + if ((USHORT)(size_t) field->nod_arg[e_fld_stream] != stream ||
984 + (USHORT)(size_t) field->nod_arg[e_fld_id] != idx->idx_rpt[0].idx_field
985 || !(idx->idx_rpt[0].idx_itype == idx_string
986 || idx->idx_rpt[0].idx_itype == idx_byte_array
987 || idx->idx_rpt[0].idx_itype == idx_metadata
988 @@ -6094,10 +6094,10 @@
990 for (arg = access_type->nod_arg, end = arg + plan_count;
991 arg < end; arg += 3) {
992 - if (relation_id != (SSHORT) * arg)
993 + if (relation_id != (SSHORT)(size_t) * arg)
994 /* index %s cannot be used in the specified plan */
995 ERR_post(gds_index_unused, gds_arg_string, *(arg + 2), 0);
996 - if (idx->idx_id == (USHORT) * (arg + 1))
997 + if (idx->idx_id == (USHORT)(size_t) * (arg + 1))
998 if (access_type->nod_type == nod_navigational)
999 idx->idx_runtime_flags |= idx_plan_navigate;
1000 else /* nod_indices */
1001 @@ -6169,13 +6169,13 @@
1002 If left side is still not a field, give up */
1004 if (match->nod_type != nod_field ||
1005 - (USHORT) match->nod_arg[e_fld_stream] != stream ||
1006 + (USHORT)(size_t) match->nod_arg[e_fld_stream] != stream ||
1007 !computable(opt->opt_csb, value, stream, true, false))
1010 value = boolean->nod_arg[0];
1011 if (match->nod_type != nod_field ||
1012 - (USHORT) match->nod_arg[e_fld_stream] != stream ||
1013 + (USHORT)(size_t) match->nod_arg[e_fld_stream] != stream ||
1014 !computable(opt->opt_csb, value, stream, true, false))
1017 @@ -6194,7 +6194,7 @@
1018 #ifdef EXPRESSION_INDICES
1019 (idx->idx_expression ||
1021 - ((USHORT) match->nod_arg[e_fld_id] == idx->idx_rpt[i].idx_field)
1022 + ((USHORT)(size_t) match->nod_arg[e_fld_id] == idx->idx_rpt[i].idx_field)
1023 #ifdef EXPRESSION_INDICES
1026 @@ -6582,7 +6582,7 @@
1028 for (streams = river->riv_streams, end =
1029 streams + river->riv_count; streams < end; streams++)
1030 - if ((USHORT) node->nod_arg[e_fld_stream] == *streams)
1031 + if ((USHORT)(size_t) node->nod_arg[e_fld_stream] == *streams)
1035 @@ -6779,7 +6779,7 @@
1038 if (node->nod_type != nod_rse) {
1039 - stream = (USHORT) node->nod_arg[STREAM_INDEX(node)];
1040 + stream = (USHORT)(size_t) node->nod_arg[STREAM_INDEX(node)];
1041 csb->csb_rpt[stream].csb_flags &= ~csb_active;
1044 --- firebird-1.5.2.4731/src/jrd/par.cpp.orig 2004-06-19 10:11:45.000000000 +0200
1045 +++ firebird-1.5.2.4731/src/jrd/par.cpp 2005-12-24 13:43:37.660357688 +0100
1046 @@ -2518,7 +2518,7 @@
1047 node->nod_arg[e_agg_rse] = parse(tdbb, csb, TYPE_RSE);
1048 node->nod_arg[e_agg_group] = parse(tdbb, csb, OTHER);
1049 node->nod_arg[e_agg_map] =
1050 - par_map(tdbb, csb, (USHORT) node->nod_arg[e_agg_stream]);
1051 + par_map(tdbb, csb, (USHORT)(size_t) node->nod_arg[e_agg_stream]);
1055 --- firebird-1.5.2.4731/src/jrd/rse.cpp.orig 2004-10-09 16:14:53.000000000 +0200
1056 +++ firebird-1.5.2.4731/src/jrd/rse.cpp 2005-12-24 13:47:46.019601344 +0100
1058 /* Initialize the record number of each stream in the union */
1060 ptr = &rsb->rsb_arg[rsb->rsb_count];
1061 - for (end = ptr + (USHORT) * ptr; ++ptr <= end;)
1062 - request->req_rpb[(USHORT) * ptr].rpb_number = -1;
1063 + for (end = ptr + (USHORT)(size_t) * ptr; ++ptr <= end;)
1064 + request->req_rpb[(USHORT)(size_t) * ptr].rpb_number = -1;
1066 rsb = rsb->rsb_arg[0];
1068 @@ -2914,7 +2914,7 @@
1069 request = tdbb->tdbb_request;
1070 stack = (LLS) rsb->rsb_arg[streams];
1071 for (; stack; stack = stack->lls_next) {
1072 - rpb = &request->req_rpb[(USHORT) stack->lls_object];
1073 + rpb = &request->req_rpb[(USHORT)(size_t) stack->lls_object];
1075 /* Make sure a record block has been allocated. If there isn't
1076 one, first find the format, then allocate the record block */
1077 @@ -2972,7 +2972,7 @@
1078 list that contains the data to send back
1080 if (IS_INTL_DATA(&item->smb_desc) &&
1081 - (USHORT) item->smb_desc.dsc_address <
1082 + (USHORT)(size_t) item->smb_desc.dsc_address <
1083 map->smb_key_length * sizeof(ULONG)) continue;
1085 rpb = &request->req_rpb[item->smb_stream];
1086 @@ -3238,7 +3238,7 @@
1087 the sort record, then want to sort by language dependent order */
1089 if (IS_INTL_DATA(&item->smb_desc) &&
1090 - (USHORT) item->smb_desc.dsc_address <
1091 + (USHORT)(size_t) item->smb_desc.dsc_address <
1092 map->smb_key_length * sizeof(ULONG)) {
1093 INTL_string_to_key(tdbb, INTL_INDEX_TYPE(&item->smb_desc),
1095 --- firebird-1.5.2.4731/src/qli/command.cpp.orig 2003-04-03 11:34:54.000000000 +0200
1096 +++ firebird-1.5.2.4731/src/qli/command.cpp 2005-12-24 15:04:12.438359712 +0100
1097 @@ -311,32 +311,32 @@
1098 ptr = node->syn_arg;
1100 for (i = 0; i < node->syn_count; i++) {
1101 - foo = (USHORT) * ptr++;
1102 + foo = (USHORT)(size_t) * ptr++;
1103 sw = (ENUM set_t) foo;
1107 - QLI_blr = (USHORT) value;
1108 + QLI_blr = (USHORT)(size_t) value;
1111 case set_statistics:
1112 - QLI_statistics = (USHORT) value;
1113 + QLI_statistics = (USHORT)(size_t) value;
1117 - QLI_name_columns = QLI_columns = (USHORT) value;
1118 + QLI_name_columns = QLI_columns = (USHORT)(size_t) value;
1122 - QLI_lines = (USHORT) value;
1123 + QLI_lines = (USHORT)(size_t) value;
1127 - QLI_semi = (USHORT) value;
1128 + QLI_semi = (USHORT)(size_t) value;
1132 - QLI_echo = (USHORT) value;
1133 + QLI_echo = (USHORT)(size_t) value;
1141 - QLI_count = (USHORT) value;
1142 + QLI_count = (USHORT)(size_t) value;
1146 --- firebird-1.5.2.4731/src/qli/expand.cpp.orig 2003-04-03 11:34:52.000000000 +0200
1147 +++ firebird-1.5.2.4731/src/qli/expand.cpp 2005-12-24 15:04:49.271760184 +0100
1148 @@ -2220,7 +2220,7 @@
1149 for (i = 0; i < node->nod_count; i++) {
1151 if (expr->syn_type == nod_position) {
1152 - position = (USHORT) expr->syn_arg[0];
1153 + position = (USHORT)(size_t) expr->syn_arg[0];
1154 if (!list || !position || position > list->nod_count)
1155 IBERROR(152); /* Msg152 invalid ORDER BY ordinal */
1156 item = (ITM) list->nod_arg[position - 1];
1157 --- firebird-1.5.2.4731/src/qli/meta.epp.orig 2004-09-17 22:34:59.000000000 +0200
1158 +++ firebird-1.5.2.4731/src/qli/meta.epp 2005-12-24 15:20:58.941348000 +0100
1159 @@ -3795,7 +3795,7 @@
1163 - privileges = (USHORT) node->syn_arg[s_grant_privileges];
1164 + privileges = (USHORT)(size_t) node->syn_arg[s_grant_privileges];
1165 relation = (QLI_REL) node->syn_arg[s_grant_relation];
1166 relation->rel_database = database = setup_update(relation->rel_database);
1167 relation_name = relation->rel_symbol->sym_string;
1168 --- firebird-1.5.2.4731/src/burp/burp.cpp.orig 2004-01-07 11:10:18.000000000 +0100
1169 +++ firebird-1.5.2.4731/src/burp/burp.cpp 2005-12-24 13:57:23.889751728 +0100
1170 @@ -1606,7 +1606,7 @@
1172 signal(SIGPIPE, SIG_IGN);
1174 - fil->fil_fd = reinterpret_cast<DESC>(GBAK_STDOUT_DESC);
1175 + fil->fil_fd = (DESC)(GBAK_STDOUT_DESC);
1179 @@ -1724,7 +1724,7 @@
1181 tdgbl->action->act_action = ACT_restore;
1182 if (!strcmp(fil->fil_name, "stdin")) {
1183 - fil->fil_fd = reinterpret_cast<DESC>(GBAK_STDIN_DESC);
1184 + fil->fil_fd = (DESC)(GBAK_STDIN_DESC);
1185 tdgbl->file_desc = fil->fil_fd;
1186 tdgbl->gbl_sw_files = fil->fil_next;
1188 --- firebird-1.5.2.4731/src/dsql/parse.cpp.orig 2004-01-31 14:31:48.000000000 +0100
1189 +++ firebird-1.5.2.4731/src/dsql/parse.cpp 2005-12-24 16:11:42.519653768 +0100
1190 @@ -6431,7 +6431,7 @@
1193 lex.g_field->fld_dtype = dtype_cstring;
1194 - lex.g_field->fld_character_length = (USHORT) yyvsp[-2]; }
1195 + lex.g_field->fld_character_length = (USHORT)(size_t) yyvsp[-2]; }
1198 { yyval = (DSQL_NOD) NULL; }
1199 @@ -7551,27 +7551,27 @@
1202 lex.g_field->fld_dtype = dtype_blob;
1203 - lex.g_field->fld_seg_length = (USHORT) yyvsp[-1];
1204 + lex.g_field->fld_seg_length = (USHORT)(size_t) yyvsp[-1];
1205 lex.g_field->fld_sub_type = 0;
1210 lex.g_field->fld_dtype = dtype_blob;
1211 - lex.g_field->fld_seg_length = (USHORT) yyvsp[-3];
1212 - lex.g_field->fld_sub_type = (USHORT) yyvsp[-1];
1213 + lex.g_field->fld_seg_length = (USHORT)(size_t) yyvsp[-3];
1214 + lex.g_field->fld_sub_type = (USHORT)(size_t) yyvsp[-1];
1219 lex.g_field->fld_dtype = dtype_blob;
1220 lex.g_field->fld_seg_length = 80;
1221 - lex.g_field->fld_sub_type = (USHORT) yyvsp[-1];
1222 + lex.g_field->fld_sub_type = (USHORT)(size_t) yyvsp[-1];
1227 - lex.g_field->fld_seg_length = (USHORT) yyvsp[0];
1228 + lex.g_field->fld_seg_length = (USHORT)(size_t) yyvsp[0];
1232 @@ -7581,7 +7581,7 @@
1236 - lex.g_field->fld_sub_type = (USHORT) yyvsp[0];
1237 + lex.g_field->fld_sub_type = (USHORT)(size_t) yyvsp[0];
1241 @@ -7602,7 +7602,7 @@
1244 lex.g_field->fld_dtype = dtype_text;
1245 - lex.g_field->fld_character_length = (USHORT) yyvsp[-1];
1246 + lex.g_field->fld_character_length = (USHORT)(size_t) yyvsp[-1];
1247 lex.g_field->fld_flags |= FLD_national;
1250 @@ -7616,14 +7616,14 @@
1253 lex.g_field->fld_dtype = dtype_varying;
1254 - lex.g_field->fld_character_length = (USHORT) yyvsp[-1];
1255 + lex.g_field->fld_character_length = (USHORT)(size_t) yyvsp[-1];
1256 lex.g_field->fld_flags |= FLD_national;
1261 lex.g_field->fld_dtype = dtype_text;
1262 - lex.g_field->fld_character_length = (USHORT) yyvsp[-1];
1263 + lex.g_field->fld_character_length = (USHORT)(size_t) yyvsp[-1];
1267 @@ -7635,7 +7635,7 @@
1270 lex.g_field->fld_dtype = dtype_varying;
1271 - lex.g_field->fld_character_length = (USHORT) yyvsp[-1];
1272 + lex.g_field->fld_character_length = (USHORT)(size_t) yyvsp[-1];
1276 @@ -7715,7 +7715,7 @@
1277 lex.g_field->fld_dtype = dtype_long;
1278 lex.g_field->fld_length = sizeof (SLONG);
1280 - lex.g_field->fld_precision = (USHORT) yyvsp[-1];
1281 + lex.g_field->fld_precision = (USHORT)(size_t) yyvsp[-1];
1285 @@ -7775,8 +7775,8 @@
1286 lex.g_field->fld_length = sizeof (SLONG);
1289 - lex.g_field->fld_precision = (USHORT) yyvsp[-3];
1290 - lex.g_field->fld_scale = - (SSHORT) yyvsp[-1];
1291 + lex.g_field->fld_precision = (USHORT)(size_t) yyvsp[-3];
1292 + lex.g_field->fld_scale = - (SSHORT)(size_t) yyvsp[-1];
1296 @@ -7942,7 +7942,7 @@
1297 { yyval = make_node (nod_table_lock, (int) 2, make_list (yyvsp[-1]), yyvsp[0]); }
1300 -{ yyval = make_flag_node (nod_lock_mode, (SSHORT) ((SSHORT) yyvsp[-1] | (SSHORT) yyvsp[0]), (SSHORT) 0, NULL); }
1301 +{ yyval = make_flag_node (nod_lock_mode, (SSHORT) ((SSHORT)(size_t) yyvsp[-1] | (SSHORT)(size_t) yyvsp[0]), (SSHORT) 0, NULL); }
1305 --- firebird-1.5.2.4731/src/gpre/cmd.cpp.orig 2003-10-30 23:25:53.000000000 +0100
1306 +++ firebird-1.5.2.4731/src/gpre/cmd.cpp 2005-12-24 12:30:50.312295512 +0100
1309 case ACT_drop_shadow:
1310 put_numeric(request, gds_dyn_delete_shadow,
1311 - (SSHORT) action->act_object);
1312 + (SSHORT)(size_t) action->act_object);
1316 --- firebird-1.5.2.4731/src/common/classes/alloc.h.orig 2004-09-17 22:34:27.000000000 +0200
1317 +++ firebird-1.5.2.4731/src/common/classes/alloc.h 2005-12-24 12:27:24.200629248 +0100
1318 @@ -242,22 +242,22 @@
1319 void operator delete[](void* mem) throw();
1321 #ifdef DEBUG_GDS_ALLOC
1322 -static inline void* operator new(size_t s, Firebird::MemoryPool& pool, char* file, int line) {
1323 +inline void* operator new(size_t s, Firebird::MemoryPool& pool, char* file, int line) {
1324 return pool.allocate(s, 0, file, line);
1325 // return pool.calloc(s, 0, file, line);
1327 -static inline void* operator new[](size_t s, Firebird::MemoryPool& pool, char* file, int line) {
1328 +inline void* operator new[](size_t s, Firebird::MemoryPool& pool, char* file, int line) {
1329 return pool.allocate(s, 0, file, line);
1330 // return pool.calloc(s, 0, file, line);
1332 #define FB_NEW(pool) new(pool,__FILE__,__LINE__)
1333 #define FB_NEW_RPT(pool,count) new(pool,count,__FILE__,__LINE__)
1335 -static inline void* operator new(size_t s, Firebird::MemoryPool& pool) {
1336 +inline void* operator new(size_t s, Firebird::MemoryPool& pool) {
1337 return pool.allocate(s);
1338 // return pool.calloc(s);
1340 -static inline void* operator new[](size_t s, Firebird::MemoryPool& pool) {
1341 +inline void* operator new[](size_t s, Firebird::MemoryPool& pool) {
1342 return pool.allocate(s);
1343 // return pool.calloc(s);