8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-23 00:03:02 +01:00

-Fix cast warnings

-Fix signed/unsigned comparison warnings
-Fix format warnings
-Add MinGW 3.0 rc header
This commit is contained in:
brodsom 2003-08-09 21:15:32 +00:00
parent ae427196e7
commit daf2d5ff2c
10 changed files with 99 additions and 93 deletions

View File

@ -270,7 +270,7 @@ void IDX_create_index(
if ((attachment = tdbb->tdbb_attachment) &&
(attachment != dbb->dbb_attachments || attachment->att_next)) {
if (attachment->att_flags & ATT_gbak_attachment ||
DPM_data_pages(tdbb, relation) > dbb->dbb_bcb->bcb_count) {
DPM_data_pages(tdbb, relation) > (SLONG) dbb->dbb_bcb->bcb_count) {
primary.rpb_window.win_flags = secondary.rpb_window.win_flags =
WIN_large_scan;
primary.rpb_org_scans = secondary.rpb_org_scans =
@ -1047,15 +1047,15 @@ JRD_REL * bad_relation, USHORT * bad_index)
}
else if (idx->idx_flags & (idx_primary | idx_unique))
for (index_number = 0;
index_number < idx->idx_foreign_primaries->count();
index_number < (int) idx->idx_foreign_primaries->count();
index_number++) {
if (idx->idx_id !=
(UCHAR) (*idx->idx_foreign_primaries)[index_number]) continue;
(UCHAR)(ULONG) (*idx->idx_foreign_primaries)[index_number]) continue;
partner_relation =
MET_relation(tdbb,
(int) (*idx->idx_foreign_relations)[index_number]);
index_id =
(USHORT) (*idx->idx_foreign_indexes)[index_number];
(USHORT)(ULONG) (*idx->idx_foreign_indexes)[index_number];
if ( (result =
check_partner_index(tdbb, relation, record, transaction, idx,
partner_relation, index_id)) )

View File

@ -1711,7 +1711,7 @@ ULONG ISC_exception_post(ULONG except_code, TEXT * err_msg)
case EXCEPTION_STACK_OVERFLOW:
ERR_post(isc_exception_stack_overflow, 0);
/* This will never be called, but to be safe it's here */
result = EXCEPTION_CONTINUE_EXECUTION;
result = (ULONG) EXCEPTION_CONTINUE_EXECUTION;
is_critical = false;
break;
@ -1741,7 +1741,7 @@ ULONG ISC_exception_post(ULONG except_code, TEXT * err_msg)
else
{
sprintf (log_msg, "%s An exception occurred that does\n"
"\t\tnot have a description. Exception number %X.\n"
"\t\tnot have a description. Exception number %"XLONGFORMAT".\n"
"\tThis exception will cause the Firebird server\n"
"\tto terminate abnormally.", err_msg, except_code);
}

View File

@ -46,6 +46,9 @@
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef MINGW
#include <io.h>
#endif
#ifdef HAVE_PWD_H
#include <pwd.h>
#endif
@ -3914,9 +3917,9 @@ ISC_STATUS DLL_EXPORT GDS_TRANSACT_REQUEST(ISC_STATUS* user_status,
{
if ( (node = csb->csb_rpt[i].csb_message) )
{
if ((int) node->nod_arg[e_msg_number] == 0) {
if ((int)(SLONG) node->nod_arg[e_msg_number] == 0) {
in_message = node;
} else if ((int) node->nod_arg[e_msg_number] == 1) {
} else if ((int)(SLONG) node->nod_arg[e_msg_number] == 1) {
out_message = node;
}
}

View File

@ -314,7 +314,7 @@ int LLIO_seek(
method = FILE_END;
break;
}
if (SetFilePointer((HANDLE) file_desc, offset, NULL, method) == -1) {
if (SetFilePointer((HANDLE) file_desc, offset, NULL, method) == (DWORD) -1) {
if (status_vector)
io_error(status_vector, "SetFilePointer", filename,
isc_io_access_err);

View File

@ -37,7 +37,7 @@
*
*/
/*
$Id: met.epp,v 1.64 2003-08-03 23:54:39 brodsom Exp $
$Id: met.epp,v 1.65 2003-08-09 21:15:32 brodsom Exp $
*/
// This MUST be at the top of the file
#ifdef DARWIN
@ -1890,7 +1890,7 @@ int MET_lookup_partner(
index_number + 1);
(*references->frgn_relations)[index_number] =
(BLK) partner_relation->rel_id;
(BLK) (ULONG) partner_relation->rel_id;
references->frgn_indexes =
vec::newVector(*dbb->dbb_permanent, references->frgn_indexes,
@ -1968,7 +1968,7 @@ int MET_lookup_partner(
index_number+1);
(*dependencies->prim_relations)[index_number] =
(BLK) partner_relation->rel_id;
(BLK) (ULONG) partner_relation->rel_id;
dependencies->prim_indexes =
vec::newVector(*dbb->dbb_permanent, dependencies->prim_indexes,
@ -2026,16 +2026,16 @@ int MET_lookup_partner(
if (references->frgn_reference_ids)
{
for (index_number = 0;
index_number < references->frgn_reference_ids->count();
index_number < (int) references->frgn_reference_ids->count();
index_number++)
{
if (idx->idx_id == (UCHAR) (*references->frgn_reference_ids)
if (idx->idx_id == (UCHAR)(ULONG) (*references->frgn_reference_ids)
[index_number])
{
idx->idx_primary_relation =
(USHORT) (*references->frgn_relations)[index_number];
(USHORT)(ULONG) (*references->frgn_relations)[index_number];
idx->idx_primary_index =
(UCHAR) (*references->frgn_indexes)[index_number];
(UCHAR)(ULONG) (*references->frgn_indexes)[index_number];
return TRUE;
}
}
@ -2048,10 +2048,10 @@ int MET_lookup_partner(
if (dependencies->prim_reference_ids)
{
for (index_number = 0;
index_number < dependencies->prim_reference_ids->count();
index_number < (int) dependencies->prim_reference_ids->count();
index_number++)
{
if (idx->idx_id == (UCHAR) (*dependencies->prim_reference_ids)
if (idx->idx_id == (UCHAR)(ULONG) (*dependencies->prim_reference_ids)
[index_number])
{
idx->idx_foreign_primaries =
@ -2160,7 +2160,7 @@ JRD_PRC MET_lookup_procedure_id(TDBB tdbb, SSHORT id,
dbb = tdbb->tdbb_database;
if ((procedures = dbb->dbb_procedures)
&& id < procedures->count()
&& id < (SSHORT) procedures->count()
&& (procedure = (JRD_PRC)(*procedures)[id])
&& procedure->prc_id == id
&& !(procedure->prc_flags & PRC_being_scanned)
@ -2336,7 +2336,7 @@ JRD_REL MET_lookup_relation_id(TDBB tdbb, SLONG id, BOOLEAN return_deleted)
check_relation = NULL;
if ((vector = dbb->dbb_relations) &&
(id < vector->count()) && (relation = (JRD_REL) (*vector)[id]))
(id < (SLONG) vector->count()) && (relation = (JRD_REL) (*vector)[id]))
{
if (relation->rel_flags & REL_deleted)
{
@ -2646,7 +2646,6 @@ JRD_PRC MET_procedure(TDBB tdbb, int id, BOOLEAN noscan, USHORT flags)
FMT format;
fmt::fmt_desc_iterator desc;
SSHORT i;
USHORT length;
SET_TDBB(tdbb);
dbb = tdbb->tdbb_database;
@ -2655,7 +2654,7 @@ JRD_PRC MET_procedure(TDBB tdbb, int id, BOOLEAN noscan, USHORT flags)
{
vector = dbb->dbb_procedures = vec::newVector(*dbb->dbb_permanent, id + 10);
}
else if (id >= vector->count())
else if (id >= (int) vector->count())
{
vector->resize(id + 10);
}
@ -2824,6 +2823,7 @@ JRD_PRC MET_procedure(TDBB tdbb, int id, BOOLEAN noscan, USHORT flags)
if ((vector = procedure->prc_output_fields) && (*vector)[0])
{
ULONG length;
format = procedure->prc_format =
fmt::newFmt(*dbb->dbb_permanent, procedure->prc_outputs);
format->fmt_count = procedure->prc_outputs;
@ -2845,7 +2845,7 @@ JRD_PRC MET_procedure(TDBB tdbb, int id, BOOLEAN noscan, USHORT flags)
length += desc->dsc_length;
}
}
format->fmt_length = length;
format->fmt_length = (USHORT) length;
}
old_pool = tdbb->tdbb_default;
@ -2859,10 +2859,10 @@ JRD_PRC MET_procedure(TDBB tdbb, int id, BOOLEAN noscan, USHORT flags)
{
if ( (node = csb_->csb_rpt[i].csb_message) )
{
if ((int) node->nod_arg[e_msg_number] == 0)
if ((int) (SLONG) node->nod_arg[e_msg_number] == 0)
{
procedure->prc_input_msg = node;
} else if ((int) node->nod_arg[e_msg_number] == 1)
} else if ((int) (SLONG) node->nod_arg[e_msg_number] == 1)
{
procedure->prc_output_msg = node;
}
@ -4141,7 +4141,7 @@ static BOOLEAN par_messages(TDBB tdbb,
align = PAR_desc(csb, &*desc);
if (align)
offset = FB_ALIGN(offset, align);
desc->dsc_address = (UCHAR *) offset;
desc->dsc_address = (UCHAR *) (ULONG) offset;
offset += desc->dsc_length;
}
format->fmt_length = offset;
@ -4438,7 +4438,7 @@ static void store_dependencies(TDBB tdbb,
node = (JRD_NOD) LLS_POP(&csb->csb_dependencies);
if (!node->nod_arg[e_dep_object])
continue;
dpdo_type = (SSHORT) node->nod_arg[e_dep_object_type];
dpdo_type = (SSHORT) (SLONG) node->nod_arg[e_dep_object_type];
relation = NULL;
procedure = NULL;
switch (dpdo_type) {
@ -4475,7 +4475,7 @@ static void store_dependencies(TDBB tdbb,
{
if (field_node->nod_type == nod_field)
{
fld_id = (SSHORT) field_node->nod_arg[0];
fld_id = (SSHORT) (SLONG) field_node->nod_arg[0];
if (relation)
{
if ( (field = MET_get_field(relation, fld_id)) )

View File

@ -45,6 +45,10 @@
#include <unistd.h>
#endif
#ifdef MINGW
#include <io.h>
#endif
void BackupManager::generate_filename() {
strncpy(diff_name, (char*)database->dbb_filename->str_data, sizeof(diff_name));
strncat(diff_name, ".delta", sizeof(diff_name)-strlen(diff_name)-1);

View File

@ -163,7 +163,7 @@ ULONG start_seqno, USHORT start_file, USHORT num_files, SCHAR ** files)
/* If file size is not specified, go for the maximum possible */
if (!file_size)
file_size = -1;
file_size = (ULONG) -1;
OLD_handle = NULL;
@ -195,8 +195,7 @@ ULONG start_seqno, USHORT start_file, USHORT num_files, SCHAR ** files)
page = (PIP) CCH_FETCH(NULL_TDBB, &window, LCK_read, pag_pages);
MOVE_FAST((UCHAR *) page, (UCHAR *) temp_page, dbb->dbb_page_size);
CCH_RELEASE(NULL_TDBB, &window);
if (start_page < ((sequence + 1) * pgc->pgc_ppp)) {
if (start_page < (ULONG) ((sequence + 1) * pgc->pgc_ppp)) {
last_page = old_dump_all_pages(OLD_handle, temp_page,
sequence, start_page);
/* Check for error */
@ -603,7 +602,7 @@ static int old_put(OLD OLD_handle, SCHAR * logrec, USHORT len)
/* Leave space for trailer page. */
if (OLD_handle->old_cur_size + 2 * OLD_handle->old_rec_size >
if ((ULONG) (OLD_handle->old_cur_size + 2 * OLD_handle->old_rec_size) >
OLD_handle->old_file_size) {
/* Rollover to next file */

View File

@ -383,7 +383,7 @@ RSB OPT_compile(TDBB tdbb,
if (node->nod_type != nod_rse)
{
stream = (USHORT) node->nod_arg[STREAM_INDEX(node)];
stream = (USHORT)(ULONG) node->nod_arg[STREAM_INDEX(node)];
assert(stream <= MAX_UCHAR);
assert(beds[0] < MAX_STREAMS && beds[0] < MAX_UCHAR);
beds[++beds[0]] = (UCHAR) stream;
@ -403,21 +403,21 @@ RSB OPT_compile(TDBB tdbb,
(USHORT) (key_streams[0] - i));
assert(local_streams[0] < MAX_STREAMS && local_streams[0] < MAX_UCHAR);
local_streams[++local_streams[0]] =
(UCHAR) node->nod_arg[e_uni_stream];
(UCHAR)(ULONG) node->nod_arg[e_uni_stream];
}
else if (node->nod_type == nod_aggregate) {
assert((int)node->nod_arg[e_agg_stream] <= MAX_STREAMS);
assert((int)node->nod_arg[e_agg_stream] <= MAX_UCHAR);
assert((int)(SLONG)node->nod_arg[e_agg_stream] <= MAX_STREAMS);
assert((int)(SLONG)node->nod_arg[e_agg_stream] <= MAX_UCHAR);
rsb = gen_aggregate(tdbb, opt_, node);
assert(local_streams[0] < MAX_STREAMS && local_streams[0] < MAX_UCHAR);
local_streams[++local_streams[0]] =
(UCHAR) node->nod_arg[e_agg_stream];
(UCHAR)(ULONG) node->nod_arg[e_agg_stream];
}
else if (node->nod_type == nod_procedure) {
rsb = gen_procedure(tdbb, opt_, node);
assert(local_streams[0] < MAX_STREAMS && local_streams[0] < MAX_UCHAR);
local_streams[++local_streams[0]] =
(UCHAR) node->nod_arg[e_prc_stream];
(UCHAR)(ULONG) node->nod_arg[e_prc_stream];
}
else if (node->nod_type == nod_rse) {
compute_rse_streams(csb, (RSE) node, beds);
@ -820,7 +820,7 @@ JRD_NOD OPT_make_dbkey(OPT opt_, JRD_NOD boolean, USHORT stream)
/* Make sure we have the correct stream */
if ((USHORT) dbkey->nod_arg[0] != stream)
if ((USHORT)(ULONG) dbkey->nod_arg[0] != stream)
return NULL;
/* If this is a dbkey for the appropriate stream, it's invertable */
@ -1606,7 +1606,7 @@ static bool computable(CSB csb,
switch (node->nod_type) {
case nod_field:
if ((n = (USHORT) node->nod_arg[e_fld_stream]) == stream) {
if ((n = (USHORT)(ULONG) node->nod_arg[e_fld_stream]) == stream) {
return false;
}
// AB: cbs_made_river has been replaced by find_used_streams()
@ -1622,7 +1622,7 @@ static bool computable(CSB csb,
return true;
case nod_dbkey:
if ((n = (USHORT) node->nod_arg[0]) == stream) {
if ((n = (USHORT)(ULONG) node->nod_arg[0]) == stream) {
return false;
}
// AB: cbs_made_river has been replaced by find_used_streams()
@ -1684,7 +1684,7 @@ static bool computable(CSB csb,
for (ptr = rse->rse_relation, end = ptr + rse->rse_count; ptr < end; ptr++) {
if ((*ptr)->nod_type != nod_rse) {
n = (USHORT) (*ptr)->nod_arg[STREAM_INDEX((*ptr))];
n = (USHORT)(ULONG) (*ptr)->nod_arg[STREAM_INDEX((*ptr))];
csb->csb_rpt[n].csb_flags |= csb_active;
}
}
@ -1721,7 +1721,7 @@ static bool computable(CSB csb,
{
if ((*ptr)->nod_type != nod_rse)
{
n = (USHORT) (*ptr)->nod_arg[STREAM_INDEX((*ptr))];
n = (USHORT)(ULONG) (*ptr)->nod_arg[STREAM_INDEX((*ptr))];
csb->csb_rpt[n].csb_flags &= ~csb_active;
}
}
@ -1762,12 +1762,12 @@ static void compute_dependencies(JRD_NOD node, ULONG * dependencies)
switch (node->nod_type) {
case nod_field:
n = (USHORT) node->nod_arg[e_fld_stream];
n = (USHORT)(ULONG) node->nod_arg[e_fld_stream];
SET_DEP_BIT(dependencies, n);
return;
case nod_dbkey:
n = (USHORT) node->nod_arg[0];
n = (USHORT)(ULONG) node->nod_arg[0];
SET_DEP_BIT(dependencies, n);
return;
@ -1823,7 +1823,7 @@ static void compute_dependencies(JRD_NOD node, ULONG * dependencies)
for (ptr = rse->rse_relation, end = ptr + rse->rse_count; ptr < end; ptr++) {
if ((*ptr)->nod_type != nod_rse) {
n = (USHORT) (*ptr)->nod_arg[STREAM_INDEX((*ptr))];
n = (USHORT)(ULONG) (*ptr)->nod_arg[STREAM_INDEX((*ptr))];
CLEAR_DEP_BIT(dependencies, n);
}
}
@ -1851,7 +1851,7 @@ static void compute_dbkey_streams(CSB csb, JRD_NOD node, UCHAR * streams)
if (node->nod_type == nod_relation) {
assert(streams[0] < MAX_STREAMS && streams[0] < MAX_UCHAR);
streams[++streams[0]] = (UCHAR) node->nod_arg[e_rel_stream];
streams[++streams[0]] = (UCHAR)(ULONG) node->nod_arg[e_rel_stream];
}
else if (node->nod_type == nod_union) {
clauses = node->nod_arg[e_uni_clauses];
@ -1891,7 +1891,7 @@ static void compute_rse_streams(CSB csb, RSE rse, UCHAR * streams)
node = *ptr;
if (node->nod_type != nod_rse) {
assert(streams[0] < MAX_STREAMS && streams[0] < MAX_UCHAR);
streams[++streams[0]] = (UCHAR) node->nod_arg[STREAM_INDEX(node)];
streams[++streams[0]] = (UCHAR)(ULONG) node->nod_arg[STREAM_INDEX(node)];
}
else {
compute_rse_streams(csb, (RSE) node, streams);
@ -2919,7 +2919,7 @@ static JRD_NOD find_dbkey(JRD_NOD dbkey, USHORT stream, SLONG * position)
JRD_NOD dbkey_temp, *ptr, *end;
DEV_BLKCHK(dbkey, type_nod);
if (dbkey->nod_type == nod_dbkey) {
if ((USHORT) dbkey->nod_arg[0] == stream)
if ((USHORT)(ULONG) dbkey->nod_arg[0] == stream)
return dbkey;
else {
*position = *position + 1;
@ -3026,7 +3026,7 @@ static void find_rsbs(RSB rsb, LLS * stream_list, LLS * rsb_list)
case rsb_procedure:
/* No need to go any farther down with these */
LLS_PUSH((BLK) rsb->rsb_stream, stream_list);
LLS_PUSH((BLK)(ULONG) rsb->rsb_stream, stream_list);
return;
case rsb_cross:
/* Loop through the sub-streams */
@ -3180,7 +3180,7 @@ static void form_rivers(TDBB tdbb,
temp[0]++;
relation_node = plan_node->nod_arg[e_retrieve_relation];
temp[temp[0]] = (UCHAR) relation_node->nod_arg[e_rel_stream];
temp[temp[0]] = (UCHAR)(ULONG) relation_node->nod_arg[e_rel_stream];
}
/* just because the user specified a join does not mean that
@ -3347,9 +3347,9 @@ static RSB gen_aggregate(TDBB tdbb, OPT opt, JRD_NOD node)
RSB rsb = FB_NEW_RPT(*tdbb->tdbb_default, 1) Rsb();
rsb->rsb_type = rsb_aggregate;
assert((int)node->nod_arg[e_agg_stream] <= MAX_STREAMS);
assert((int)node->nod_arg[e_agg_stream] <= MAX_UCHAR);
rsb->rsb_stream = (UCHAR) node->nod_arg[e_agg_stream];
assert((int)(SLONG)node->nod_arg[e_agg_stream] <= MAX_STREAMS);
assert((int)(SLONG)node->nod_arg[e_agg_stream] <= MAX_UCHAR);
rsb->rsb_stream = (UCHAR)(ULONG) node->nod_arg[e_agg_stream];
rsb->rsb_format = csb->csb_rpt[rsb->rsb_stream].csb_format;
rsb->rsb_next = OPT_compile(tdbb, csb, rse, NULL);
rsb->rsb_arg[0] = (RSB) node;
@ -3713,8 +3713,8 @@ static RSB gen_navigation(TDBB tdbb,
idx->idx_rpt; ptr < end; ptr++, idx_tail++) {
node = *ptr;
if (node->nod_type != nod_field
|| (USHORT) node->nod_arg[e_fld_stream] != stream
|| (USHORT) node->nod_arg[e_fld_id] != idx_tail->idx_field
|| (USHORT)(ULONG) node->nod_arg[e_fld_stream] != stream
|| (USHORT)(ULONG) node->nod_arg[e_fld_id] != idx_tail->idx_field
|| ptr[2*sort->nod_count] /* do not use index if NULLS FIRST is used */
#ifdef SCROLLABLE_CURSORS
)
@ -3874,7 +3874,7 @@ static RSB gen_outer(TDBB tdbb,
{
stream_ptr[i]->stream_rsb = NULL;
stream_ptr[i]->stream_num =
(USHORT) node->nod_arg[STREAM_INDEX(node)];
(USHORT)(ULONG) node->nod_arg[STREAM_INDEX(node)];
}
}
@ -3952,10 +3952,10 @@ static RSB gen_procedure(TDBB tdbb, OPT opt, JRD_NOD node)
SET_TDBB(tdbb);
csb = opt->opt_csb;
procedure = MET_lookup_procedure_id(tdbb,
(SSHORT)node->nod_arg[e_prc_procedure], FALSE, FALSE, 0);
(SSHORT)(SLONG)node->nod_arg[e_prc_procedure], FALSE, FALSE, 0);
rsb = FB_NEW_RPT(*tdbb->tdbb_default, RSB_PRC_count) Rsb();
rsb->rsb_type = rsb_procedure;
rsb->rsb_stream = (UCHAR) node->nod_arg[e_prc_stream];
rsb->rsb_stream = (UCHAR)(ULONG) node->nod_arg[e_prc_stream];
rsb->rsb_procedure = procedure;
rsb->rsb_impure = CMP_impure(csb, sizeof(struct irsb_procedure));
rsb->rsb_arg[RSB_PRC_inputs] = (RSB) node->nod_arg[e_prc_inputs];
@ -4532,12 +4532,12 @@ static RSB gen_sort(TDBB tdbb,
while (SBM_next(csb->csb_rpt[*ptr].csb_fields, &id, RSE_get_forward)) {
items++;
LLS_PUSH((BLK) id, &id_stack);
LLS_PUSH((BLK) * ptr, &stream_stack);
LLS_PUSH((BLK)(ULONG) * ptr, &stream_stack);
for (node_ptr = sort->nod_arg; node_ptr < end_node; node_ptr++) {
node = *node_ptr;
if (node->nod_type == nod_field
&& (USHORT) node->nod_arg[e_fld_stream] == *ptr
&& (USHORT) node->nod_arg[e_fld_id] == id) {
&& (USHORT)(ULONG) node->nod_arg[e_fld_stream] == *ptr
&& (USHORT)(ULONG) node->nod_arg[e_fld_id] == id) {
desc = &descriptor;
CMP_get_desc(tdbb, csb, node, desc);
/* International type text has a computed key */
@ -4634,8 +4634,8 @@ static RSB gen_sort(TDBB tdbb,
map_item->smb_desc.dsc_address = (UCHAR *) map_length;
map_length += desc->dsc_length;
if (node->nod_type == nod_field) {
map_item->smb_stream = (USHORT) node->nod_arg[e_fld_stream];
map_item->smb_field_id = (USHORT) node->nod_arg[e_fld_id];
map_item->smb_stream = (USHORT)(ULONG) node->nod_arg[e_fld_stream];
map_item->smb_field_id = (USHORT)(ULONG) node->nod_arg[e_fld_id];
}
}
@ -4647,8 +4647,8 @@ static RSB gen_sort(TDBB tdbb,
field has already been mentioned as a sort key, don't bother to repeat
it. */
while (stream_stack) {
id = (USHORT) LLS_POP(&id_stack);
stream = (USHORT) LLS_POP(&stream_stack);
id = (USHORT)(ULONG) LLS_POP(&id_stack);
stream = (USHORT)(ULONG) LLS_POP(&stream_stack);
format = CMP_format(tdbb, csb, stream);
desc = &format->fmt_desc[id];
if (id >= format->fmt_count || desc->dsc_length == 0)
@ -4972,7 +4972,7 @@ static RSB gen_union(TDBB tdbb,
rsb = FB_NEW_RPT(*tdbb->tdbb_default, count + nstreams + 1) Rsb();
rsb->rsb_type = rsb_union;
rsb->rsb_count = count;
rsb->rsb_stream = (UCHAR) union_node->nod_arg[e_uni_stream];
rsb->rsb_stream = (UCHAR)(ULONG) union_node->nod_arg[e_uni_stream];
rsb->rsb_format = csb->csb_rpt[rsb->rsb_stream].csb_format;
rsb->rsb_impure = CMP_impure(csb, sizeof(struct irsb));
rsb_ptr = rsb->rsb_arg;
@ -4983,9 +4983,9 @@ static RSB gen_union(TDBB tdbb,
/* Save the count and numbers of the streams that make up the union */
*rsb_ptr++ = (RSB) nstreams;
*rsb_ptr++ = (RSB)(ULONG) nstreams;
while (nstreams--)
*rsb_ptr++ = (RSB) * streams++;
*rsb_ptr++ = (RSB)(ULONG) * streams++;
return rsb;
}
@ -5514,8 +5514,8 @@ static JRD_NOD make_missing(TDBB tdbb,
field = boolean->nod_arg[0];
if (field->nod_type != nod_field)
return NULL;
if ((USHORT) field->nod_arg[e_fld_stream] != stream ||
(USHORT) field->nod_arg[e_fld_id] != idx->idx_rpt[0].idx_field)
if ((USHORT)(ULONG) field->nod_arg[e_fld_stream] != stream ||
(USHORT)(ULONG) field->nod_arg[e_fld_id] != idx->idx_rpt[0].idx_field)
return NULL;
node = make_index_node(tdbb, relation, opt->opt_csb, idx);
retrieval = (IRB) node->nod_arg[e_idx_retrieval];
@ -5583,8 +5583,8 @@ static JRD_NOD make_starts(TDBB tdbb,
return NULL;
}
if ((USHORT) field->nod_arg[e_fld_stream] != stream ||
(USHORT) field->nod_arg[e_fld_id] != idx->idx_rpt[0].idx_field
if ((USHORT)(ULONG) field->nod_arg[e_fld_stream] != stream ||
(USHORT)(ULONG) field->nod_arg[e_fld_id] != idx->idx_rpt[0].idx_field
|| !(idx->idx_rpt[0].idx_itype == idx_string
|| idx->idx_rpt[0].idx_itype == idx_byte_array
|| idx->idx_rpt[0].idx_itype == idx_metadata
@ -5682,10 +5682,10 @@ static void mark_indices(csb_repeat * csb_tail, SSHORT relation_id)
if (access_type) {
for (arg = access_type->nod_arg, end = arg + plan_count;
arg < end; arg += 3) {
if (relation_id != (SSHORT) * arg)
if (relation_id != (SSHORT)(SLONG) * arg)
/* index %s cannot be used in the specified plan */
ERR_post(gds_index_unused, gds_arg_string, *(arg + 2), 0);
if (idx->idx_id == (USHORT) * (arg + 1))
if (idx->idx_id == (USHORT)(ULONG) * (arg + 1))
if (access_type->nod_type == nod_navigational)
idx->idx_runtime_flags |= idx_plan_navigate;
else /* nod_indices */
@ -5757,13 +5757,13 @@ static SSHORT match_index(TDBB tdbb,
If left side is still not a field, give up */
if (match->nod_type != nod_field ||
(USHORT) match->nod_arg[e_fld_stream] != stream ||
(USHORT)(ULONG) match->nod_arg[e_fld_stream] != stream ||
!computable(opt->opt_csb, value, stream, true))
{
match = value;
value = boolean->nod_arg[0];
if (match->nod_type != nod_field ||
(USHORT) match->nod_arg[e_fld_stream] != stream ||
(USHORT)(ULONG) match->nod_arg[e_fld_stream] != stream ||
!computable(opt->opt_csb, value, stream, true))
{
return 0;
@ -5782,7 +5782,7 @@ static SSHORT match_index(TDBB tdbb,
#ifdef EXPRESSION_INDICES
(idx->idx_expression ||
#endif
((USHORT) match->nod_arg[e_fld_id] == idx->idx_rpt[i].idx_field)
((USHORT)(ULONG) match->nod_arg[e_fld_id] == idx->idx_rpt[i].idx_field)
#ifdef EXPRESSION_INDICES
)
#endif
@ -6169,7 +6169,7 @@ static BOOLEAN river_reference(RIV river, JRD_NOD node)
return FALSE;
for (streams = river->riv_streams, end =
streams + river->riv_count; streams < end; streams++)
if ((USHORT) node->nod_arg[e_fld_stream] == *streams)
if ((USHORT)(ULONG) node->nod_arg[e_fld_stream] == *streams)
return TRUE;
return FALSE;
}
@ -6365,7 +6365,7 @@ static void set_rse_inactive(CSB csb, RSE rse)
ptr < end; ptr++) {
node = *ptr;
if (node->nod_type != nod_rse) {
stream = (USHORT) node->nod_arg[STREAM_INDEX(node)];
stream = (USHORT)(ULONG) node->nod_arg[STREAM_INDEX(node)];
csb->csb_rpt[stream].csb_flags &= ~csb_active;
}
else

View File

@ -34,7 +34,7 @@
*
*/
/*
$Id: par.cpp,v 1.45 2003-07-23 22:42:09 arnobrinkman Exp $
$Id: par.cpp,v 1.46 2003-08-09 21:15:32 brodsom Exp $
*/
#include "firebird.h"
@ -1857,7 +1857,7 @@ static void par_procedure_parms(
message->nod_count = count_table[blr_message];
*message_ptr = message;
message->nod_count = 0;
message->nod_arg[e_msg_number] = (JRD_NOD) (SLONG) n;
message->nod_arg[e_msg_number] = (JRD_NOD)(ULONG) n;
format =
input_flag ? procedure->prc_input_fmt : procedure->prc_output_fmt;
/* dimitr: procedure (with its parameter formats) is allocated out of
@ -1911,13 +1911,13 @@ static void par_procedure_parms(
prm->nod_type = nod_argument;
prm->nod_count = 1;
prm->nod_arg[e_arg_message] = message;
prm->nod_arg[e_arg_number] = (JRD_NOD) i++;
prm->nod_arg[e_arg_number] = (JRD_NOD)(ULONG) i++;
prm_f = prm->nod_arg[e_arg_flag] =
PAR_make_node(tdbb, e_arg_length);
prm_f->nod_type = nod_argument;
prm_f->nod_count = 0;
prm_f->nod_arg[e_arg_message] = message;
prm_f->nod_arg[e_arg_number] = (JRD_NOD) i++;
prm_f->nod_arg[e_arg_number] = (JRD_NOD)(ULONG) i++;
}
}
else if ((input_flag ? procedure->prc_inputs : procedure->prc_outputs) &&
@ -2412,7 +2412,7 @@ static JRD_NOD parse(TDBB tdbb, CSB * csb, USHORT expected)
break;
case blr_user_savepoint:
*arg++ = (JRD_NOD) BLR_BYTE;
*arg++ = (JRD_NOD) (ULONG) BLR_BYTE;
par_name(csb, name);
*arg++ = (JRD_NOD) ALL_cstring(name);
break;
@ -2508,11 +2508,11 @@ static JRD_NOD parse(TDBB tdbb, CSB * csb, USHORT expected)
case blr_aggregate:
node->nod_arg[e_agg_stream] = (JRD_NOD) (SLONG) par_context(csb, 0);
assert((int)node->nod_arg[e_agg_stream] <= MAX_STREAMS);
assert((int)(SLONG)node->nod_arg[e_agg_stream] <= MAX_STREAMS);
node->nod_arg[e_agg_rse] = parse(tdbb, csb, TYPE_RSE);
node->nod_arg[e_agg_group] = parse(tdbb, csb, OTHER);
node->nod_arg[e_agg_map] =
par_map(tdbb, csb, (USHORT) node->nod_arg[e_agg_stream]);
par_map(tdbb, csb, (USHORT)(ULONG) node->nod_arg[e_agg_stream]);
break;
case blr_group_by:

View File

@ -20,7 +20,7 @@
* All Rights Reserved.
* Contributor(s): ______________________________________.
*
* $Id: rse.cpp,v 1.29 2003-07-11 22:39:13 skidder Exp $
* $Id: rse.cpp,v 1.30 2003-08-09 21:15:32 brodsom Exp $
*
* 2001.07.28: John Bellardo: Implemented rse_skip and made rse_first work with
* seekable streams.
@ -730,8 +730,8 @@ void RSE_open(TDBB tdbb, RSB rsb)
/* Initialize the record number of each stream in the union */
ptr = &rsb->rsb_arg[rsb->rsb_count];
for (end = ptr + (USHORT) * ptr; ++ptr <= end;)
request->req_rpb[(USHORT) * ptr].rpb_number = -1;
for (end = ptr + (USHORT)(ULONG) * ptr; ++ptr <= end;)
request->req_rpb[(USHORT)(ULONG) * ptr].rpb_number = -1;
rsb = rsb->rsb_arg[0];
}
@ -2907,7 +2907,7 @@ static void join_to_nulls(TDBB tdbb, RSB rsb, USHORT streams)
request = tdbb->tdbb_request;
stack = (LLS) rsb->rsb_arg[streams];
for (; stack; stack = stack->lls_next) {
rpb = &request->req_rpb[(USHORT) stack->lls_object];
rpb = &request->req_rpb[(USHORT)(ULONG) stack->lls_object];
/* Make sure a record block has been allocated. If there isn't
one, first find the format, then allocate the record block */
@ -2965,7 +2965,7 @@ static void map_sort_data(JRD_REQ request, SMB map, UCHAR * data)
list that contains the data to send back
*/
if (IS_INTL_DATA(&item->smb_desc) &&
(USHORT) item->smb_desc.dsc_address <
(USHORT)(ULONG) item->smb_desc.dsc_address <
map->smb_key_length * sizeof(ULONG)) continue;
rpb = &request->req_rpb[item->smb_stream];
@ -3216,7 +3216,7 @@ static void open_sort(TDBB tdbb, RSB rsb, IRSB_SORT impure, ULONG max_records)
the sort record, then want to sort by language dependent order */
if (IS_INTL_DATA(&item->smb_desc) &&
(USHORT) item->smb_desc.dsc_address <
(USHORT)(ULONG) item->smb_desc.dsc_address <
map->smb_key_length * sizeof(ULONG)) {
INTL_string_to_key(tdbb, INTL_INDEX_TYPE(&item->smb_desc),
from, &to, FALSE);