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

Do not use flags for values that are exclusive (can't be combined).

This commit is contained in:
robocop 2008-04-16 10:38:08 +00:00
parent 30659ae817
commit 4580126101
5 changed files with 20 additions and 14 deletions

View File

@ -6286,7 +6286,7 @@ static void put_local_variables(dsql_req* request, dsql_nod* parameters,
}
dsql_nod* var_node =
MAKE_variable(field, field->fld_name.c_str(), VAR_output, 0, 0, locals);
MAKE_variable(field, field->fld_name.c_str(), VAR_local, 0, 0, locals);
*ptr = var_node;
dsql_var* variable = (dsql_var*) var_node->nod_arg[e_var_variable];

View File

@ -313,20 +313,15 @@ class dsql_var : public pool_alloc_rpt<SCHAR, dsql_type_var>
{
public:
dsql_fld* var_field; //!< Field on which variable is based
USHORT var_flags;
USHORT var_flags; // Reserved
//dsql_var_type var_type; // Too cumbersome to compile the right data type.
int var_type; // Input, output or local var.
USHORT var_msg_number; //!< Message number containing variable
USHORT var_msg_item; //!< Item number in message
USHORT var_variable_number; //!< Local variable number
TEXT var_name[2];
};
// values used in var_flags
enum var_flags_vals {
VAR_input = 1,
VAR_output = 2,
VAR_local = 4
};
// Symbolic names for international text types
// (either collation or character set name)

View File

@ -220,7 +220,7 @@ void GEN_expr( dsql_req* request, dsql_nod* node)
case nod_variable:
variable = (dsql_var*) node->nod_arg[e_var_variable];
if (variable->var_flags & VAR_input) {
if (variable->var_type == VAR_input) {
stuff(request, blr_parameter2);
stuff(request, variable->var_msg_number);
stuff_word(request, variable->var_msg_item);

View File

@ -1821,7 +1821,7 @@ dsql_nod* MAKE_trigger_type(dsql_nod* prefix_node, dsql_nod* suffix_node)
**/
dsql_nod* MAKE_variable(dsql_fld* field,
const TEXT* name,
USHORT type,
const dsql_var_type type,
USHORT msg_number, USHORT item_number, USHORT local_number)
{
DEV_BLKCHK(field, dsql_type_fld);
@ -1836,7 +1836,8 @@ dsql_nod* MAKE_variable(dsql_fld* field,
variable->var_variable_number = local_number;
variable->var_field = field;
strcpy(variable->var_name, name);
variable->var_flags = type;
variable->var_flags = 0;
variable->var_type = type;
MAKE_desc_from_field(&node->nod_desc, field);
return node;

View File

@ -44,6 +44,15 @@ namespace Jrd {
CONSTANT_TIMESTAMP = 5, // stored as a QUAD
CONSTANT_SINT64 = 6 // stored as a SINT64
};
// Parameters to MAKE_variable
enum dsql_var_type
{
VAR_input,
VAR_output,
VAR_local
};
};
@ -64,8 +73,9 @@ Jrd::dsql_sym* MAKE_symbol(Jrd::dsql_dbb*, const TEXT*, USHORT,
Jrd::sym_type, Jrd::dsql_req*);
Jrd::dsql_str* MAKE_tagged_string(const char* str, size_t length, const char* charset);
Jrd::dsql_nod* MAKE_trigger_type(Jrd::dsql_nod*, Jrd::dsql_nod*);
Jrd::dsql_nod* MAKE_variable(Jrd::dsql_fld*, const TEXT*, USHORT, USHORT,
USHORT, USHORT);
Jrd::dsql_nod* MAKE_variable(Jrd::dsql_fld*, const TEXT*,
const Jrd::dsql_var_type type, USHORT,
USHORT, USHORT);
#endif // DSQL_MAKE_PROTO_H