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

More consts

This commit is contained in:
asfernandes 2010-08-12 00:59:48 +00:00
parent 38a4fb7be2
commit 7b8a8065c4
5 changed files with 18 additions and 18 deletions

View File

@ -721,7 +721,7 @@ ExprNode* SubstringSimilarNode::pass1(thread_db* tdbb, CompilerScratch* csb)
if ((node->nod_flags & nod_invariant) &&
(pattern->nod_type != nod_literal || escape->nod_type != nod_literal))
{
jrd_node_base **ctx_node, **end;
const jrd_node_base* const* ctx_node, *const *end;
for (ctx_node = csb->csb_current_nodes.begin(), end = csb->csb_current_nodes.end();
ctx_node < end; ctx_node++)
{

View File

@ -133,11 +133,13 @@ JrdStatement::JrdStatement(thread_db* tdbb, MemoryPool* p, CompilerScratch* csb)
fors = csb->csb_fors;
// make a vector of all used ExecuteStatements into
execStmts = csb->csb_exec_sta;
for (Array<jrd_nod*>::iterator i = csb->csb_exec_sta.begin(); i != csb->csb_exec_sta.end(); ++i)
execStmts.add(*i);
// make a vector of all invariant-type nodes, so that we will
// be able to easily reinitialize them when we restart the request
invariants = csb->csb_invariants;
for (Array<jrd_nod*>::iterator i = csb->csb_invariants.begin(); i != csb->csb_invariants.end(); ++i)
invariants.add(*i);
rpbsSetup.grow(csb->csb_n_stream);

View File

@ -74,10 +74,10 @@ public:
const jrd_prc* procedure; // procedure, if any
const Function* function; // function, if any
Firebird::MetaName triggerName; // name of request (trigger), if any
jrd_nod* topNode; // top of execution tree
const jrd_nod* topNode; // top of execution tree
Firebird::Array<const RecordSource*> fors; // record sources
Firebird::Array<jrd_nod*> execStmts; // exec_into nodes
Firebird::Array<jrd_nod*> invariants; // invariant nodes
Firebird::Array<const jrd_nod*> execStmts; // exec_into nodes
Firebird::Array<const jrd_nod*> invariants; // invariant nodes
Firebird::RefStrPtr sqlText; // SQL text (encoded in the metadata charset)
Firebird::Array<UCHAR> blr; // BLR for non-SQL query
MapFieldInfo mapFieldInfo; // Map field name to field info

View File

@ -979,7 +979,7 @@ void EXE_start(thread_db* tdbb, jrd_req* request, jrd_tra* transaction)
request->req_timestamp.validate();
// Set all invariants to not computed.
jrd_nod** ptr, **end;
const jrd_nod* const* ptr, * const* end;
for (ptr = statement->invariants.begin(), end = statement->invariants.end();
ptr < end; ++ptr)
{
@ -1051,7 +1051,7 @@ void EXE_unwind(thread_db* tdbb, jrd_req* request)
for (size_t i = 0; i < statement->execStmts.getCount(); ++i)
{
jrd_nod* node = statement->execStmts[i];
const jrd_nod* node = statement->execStmts[i];
ExecuteStatement* impure = request->getImpure<ExecuteStatement>(node->nod_impure);
impure->close(tdbb);
}
@ -1917,7 +1917,7 @@ const jrd_nod* EXE_looper(thread_db* tdbb, jrd_req* request, const jrd_nod* in_n
{
fb_assert(statement->topNode->nod_type == nod_list);
jrd_nod* outMsgNode = statement->topNode->nod_arg[e_extproc_output_message];
const jrd_nod* outMsgNode = statement->topNode->nod_arg[e_extproc_output_message];
fb_assert(outMsgNode->nod_type == nod_message);
const Format* outFormat = (Format*) outMsgNode->nod_arg[e_msg_format];
@ -1926,11 +1926,11 @@ const jrd_nod* EXE_looper(thread_db* tdbb, jrd_req* request, const jrd_nod* in_n
if (!request->resultSet)
{
// input message
jrd_nod* inMsgNode = statement->topNode->nod_arg[e_extproc_input_message];
const jrd_nod* inMsgNode = statement->topNode->nod_arg[e_extproc_input_message];
fb_assert(inMsgNode->nod_type == nod_message);
fb_assert(request->req_message == inMsgNode);
jrd_nod* list = statement->topNode->nod_arg[e_extproc_input_assign];
const jrd_nod* list = statement->topNode->nod_arg[e_extproc_input_assign];
fb_assert(list->nod_type == nod_asn_list ||
(list->nod_type == nod_list && list->nod_count == 0));
@ -1979,7 +1979,7 @@ const jrd_nod* EXE_looper(thread_db* tdbb, jrd_req* request, const jrd_nod* in_n
fb_assert(eofDesc.dsc_dtype == dtype_short);
*((SSHORT*) (UCHAR*) (outMsg + (IPTR) eofDesc.dsc_address)) = (SSHORT) result;
jrd_nod* list = statement->topNode->nod_arg[e_extproc_output_assign];
const jrd_nod* list = statement->topNode->nod_arg[e_extproc_output_assign];
fb_assert(list->nod_type == nod_asn_list ||
(list->nod_type == nod_list && list->nod_count == 0));

View File

@ -124,11 +124,11 @@ public:
{
NestConst<jrd_nod> arg[1];
jrd_nod*& operator [](size_t index) { return arg[index].ptr; }
const jrd_nod* const& operator [](size_t index) const { return arg[index].ptr; }
jrd_nod*& operator [](size_t index) { return *arg[index].getAddress(); }
const jrd_nod* const& operator [](size_t index) const { return *arg[index].getAddress(); }
operator jrd_nod** () { return &arg[0].ptr; }
operator const jrd_nod* const* () const { return &arg[0].ptr; }
operator jrd_nod** () { return arg[0].getAddress(); }
operator const jrd_nod* const* () const { return arg[0].getAddress(); }
} nod_arg;
***/
};
@ -213,8 +213,6 @@ public:
Firebird::HalfStaticArray<sort_key_def, 2> keyItems;
};
const size_t asb_delta = ((sizeof(AggregateSort) - sizeof(jrd_nod)) / sizeof (jrd_nod**));
// Inversion (i.e. nod_index) impure area
struct impure_inversion