mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-24 02:03:03 +01:00
Misc, style and unused vars.
This commit is contained in:
parent
a14e71314b
commit
dae574f7f1
@ -124,7 +124,8 @@ BOOL WINAPI TryEnterCriticalSection_Win9X(CRITICAL_SECTION* cs)
|
||||
|
||||
// On Win 98 and Win ME TryEnterCriticalSection is defined, but not implemented
|
||||
// So direct linking to it won't hurt and will signal our incompatibility with Win 95
|
||||
TryEnterCS::tTryEnterCriticalSection* TryEnterCS::m_funct = reinterpret_cast<TryEnterCS::tTryEnterCriticalSection*>(&TryEnterCriticalSection);
|
||||
TryEnterCS::tTryEnterCriticalSection* TryEnterCS::m_funct =
|
||||
reinterpret_cast<TryEnterCS::tTryEnterCriticalSection*>(&TryEnterCriticalSection);
|
||||
|
||||
static TryEnterCS tryEnterCS;
|
||||
|
||||
|
@ -4626,7 +4626,8 @@ static dsql_nod* pass1_recursive_cte(CompiledStatement* statement, dsql_nod* inp
|
||||
else
|
||||
new_qry->nod_arg[0] = rse;
|
||||
|
||||
if (!anchor_rse) {
|
||||
if (!anchor_rse)
|
||||
{
|
||||
if (qry->nod_type == nod_list)
|
||||
anchor_rse = new_qry;
|
||||
else
|
||||
|
@ -1395,7 +1395,8 @@ IndexTableScan* OptimizerRetrieval::generateNavigation()
|
||||
|
||||
jrd_nod* const index_node = makeIndexScanNode(&indexScratches[i]);
|
||||
const USHORT key_length = ROUNDUP(BTR_key_length(tdbb, relation, idx), sizeof(SLONG));
|
||||
return FB_NEW(*tdbb->getDefaultPool()) IndexTableScan(optimizer->opt_csb, getAlias(), stream, index_node, key_length);
|
||||
return FB_NEW(*tdbb->getDefaultPool())
|
||||
IndexTableScan(optimizer->opt_csb, getAlias(), stream, index_node, key_length);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
|
@ -604,7 +604,6 @@ bool EVL_boolean(thread_db* tdbb, jrd_nod* node)
|
||||
}
|
||||
|
||||
Cursor* const select = (Cursor*) node->nod_arg[e_any_rsb];
|
||||
|
||||
select->open(tdbb);
|
||||
value = select->fetchNext(tdbb);
|
||||
select->close(tdbb);
|
||||
|
@ -3243,7 +3243,8 @@ static RecordSource* gen_retrieval(thread_db* tdbb,
|
||||
else
|
||||
{
|
||||
// Persistent table
|
||||
OptimizerRetrieval optimizerRetrieval(*tdbb->getDefaultPool(), opt, stream, outer_flag, inner_flag, sort_ptr);
|
||||
OptimizerRetrieval optimizerRetrieval(*tdbb->getDefaultPool(),
|
||||
opt, stream, outer_flag, inner_flag, sort_ptr);
|
||||
AutoPtr<InversionCandidate> candidate(optimizerRetrieval.getInversion(&nav_rsb));
|
||||
|
||||
if (candidate && candidate->inversion)
|
||||
@ -3488,8 +3489,8 @@ static SortedStream* gen_sort(thread_db* tdbb,
|
||||
ERR_post(Arg::Gds(isc_imp_exc));
|
||||
|
||||
// Now that we know the number of items, allocate a sort map block.
|
||||
SortedStream::SortMap* map = FB_NEW(*tdbb->getDefaultPool()) SortedStream::SortMap(
|
||||
*tdbb->getDefaultPool());
|
||||
SortedStream::SortMap* map =
|
||||
FB_NEW(*tdbb->getDefaultPool()) SortedStream::SortMap(*tdbb->getDefaultPool());
|
||||
|
||||
if (project_flag)
|
||||
map->flags |= SortedStream::FLAG_PROJECT;
|
||||
@ -4019,10 +4020,12 @@ static RecordSource* gen_union(thread_db* tdbb,
|
||||
// hvlad: save size of inner impure area and context of mapped record
|
||||
// for recursive processing later
|
||||
const UCHAR map_stream = (UCHAR)(IPTR) union_node->nod_arg[e_uni_map_stream];
|
||||
return FB_NEW(*tdbb->getDefaultPool()) RecursiveStream(csb, stream, map_stream, rsbs[0], rsbs[1], maps[0], maps[1], nstreams, streams, base_impure);
|
||||
return FB_NEW(*tdbb->getDefaultPool()) RecursiveStream(csb, stream, map_stream,
|
||||
rsbs[0], rsbs[1], maps[0], maps[1], nstreams, streams, base_impure);
|
||||
}
|
||||
|
||||
return FB_NEW(*tdbb->getDefaultPool()) Union(csb, stream, count / 2, rsbs.begin(), maps.begin(), nstreams, streams);
|
||||
return FB_NEW(*tdbb->getDefaultPool())
|
||||
Union(csb, stream, count / 2, rsbs.begin(), maps.begin(), nstreams, streams);
|
||||
}
|
||||
|
||||
|
||||
@ -4373,7 +4376,6 @@ jrd_nod* make_dbkey(thread_db* tdbb, OptimizerBlk* opt, jrd_nod* boolean, USHORT
|
||||
|
||||
jrd_nod* dbkey = boolean->nod_arg[0];
|
||||
jrd_nod* value = boolean->nod_arg[1];
|
||||
SLONG n = 0;
|
||||
|
||||
if (dbkey->nod_type != nod_dbkey && dbkey->nod_type != nod_concatenate)
|
||||
{
|
||||
@ -4394,6 +4396,7 @@ jrd_nod* make_dbkey(thread_db* tdbb, OptimizerBlk* opt, jrd_nod* boolean, USHORT
|
||||
|
||||
// If this is a concatenation, find an appropriate dbkey
|
||||
|
||||
SLONG n = 0;
|
||||
if (dbkey->nod_type == nod_concatenate)
|
||||
{
|
||||
dbkey = find_dbkey(dbkey, stream, &n);
|
||||
|
@ -561,12 +561,12 @@ AggregatedStream::State AggregatedStream::evaluateGroup(thread_db* tdbb, Aggrega
|
||||
}
|
||||
// If vlux_count is non-zero, we need to fall through.
|
||||
|
||||
case nod_agg_count_distinct:
|
||||
computeDistinct(tdbb, from);
|
||||
// fall through
|
||||
|
||||
case nod_agg_count:
|
||||
case nod_agg_count2:
|
||||
case nod_agg_count_distinct:
|
||||
if (from->nod_type == nod_agg_count_distinct)
|
||||
computeDistinct(tdbb, from);
|
||||
|
||||
if (!impure->vlu_desc.dsc_dtype)
|
||||
SET_NULL(record, id);
|
||||
else
|
||||
|
@ -46,7 +46,7 @@ BitmapTableScan::BitmapTableScan(CompilerScratch* csb, const string& name, UCHAR
|
||||
|
||||
void BitmapTableScan::open(thread_db* tdbb)
|
||||
{
|
||||
Database* const dbb = tdbb->getDatabase();
|
||||
//Database* const dbb = tdbb->getDatabase();
|
||||
jrd_req* const request = tdbb->getRequest();
|
||||
Impure* const impure = (Impure*) ((UCHAR*) request + m_impure);
|
||||
|
||||
|
@ -55,7 +55,7 @@ BufferedStream::BufferedStream(CompilerScratch* csb, RecordSource* next)
|
||||
const UCHAR stream = *i;
|
||||
CompilerScratch::csb_repeat* const tail = &csb->csb_rpt[stream];
|
||||
|
||||
UInt32Bitmap::Accessor accessor(csb->csb_rpt[stream].csb_fields);
|
||||
UInt32Bitmap::Accessor accessor(tail->csb_fields);
|
||||
|
||||
if (accessor.getFirst())
|
||||
{
|
||||
|
@ -161,7 +161,7 @@ bool FilteredStream::evaluateBoolean(thread_db* tdbb)
|
||||
// NULL, this must also be returned as NULL.
|
||||
// (Note that normally, an AND of a NULL and a FALSE would be FALSE, not NULL).
|
||||
|
||||
// This all depends on evl.c putting the unoptimized expression
|
||||
// This all depends on evl.cpp putting the unoptimized expression
|
||||
// in the rsb. The unoptimized expression always has the
|
||||
// select expression on the left, and the column comparison
|
||||
// on the right.
|
||||
@ -189,9 +189,6 @@ bool FilteredStream::evaluateBoolean(thread_db* tdbb)
|
||||
|
||||
if (column_node && m_ansiAny)
|
||||
{
|
||||
bool any_null; // some records null for ANY/ALL
|
||||
bool any_true; // some records true for ANY/ALL
|
||||
|
||||
if (m_ansiNot)
|
||||
{
|
||||
// do NOT ANY
|
||||
@ -201,8 +198,9 @@ bool FilteredStream::evaluateBoolean(thread_db* tdbb)
|
||||
// (numTrue + numUnknown = 0),
|
||||
// NOT ANY is true
|
||||
|
||||
any_null = false;
|
||||
any_true = false;
|
||||
bool any_null = false; // some records true for ANY/ALL
|
||||
bool any_true = false; // some records true for ANY/ALL
|
||||
|
||||
while (m_next->getRecord(tdbb))
|
||||
{
|
||||
if (EVL_boolean(tdbb, m_boolean))
|
||||
|
@ -48,10 +48,11 @@ IndexTableScan::IndexTableScan(CompilerScratch* csb, const string& name, UCHAR s
|
||||
{
|
||||
fb_assert(m_index);
|
||||
|
||||
USHORT size = sizeof(Impure) + 2 * m_length;
|
||||
size_t size = sizeof(Impure) + 2u * static_cast<size_t>(m_length);
|
||||
size = FB_ALIGN(size, FB_ALIGNMENT);
|
||||
m_offset = size;
|
||||
size += sizeof(index_desc);
|
||||
fb_assert(size < size_t(MAX_USHORT));
|
||||
|
||||
m_impure = CMP_impure(csb, size);
|
||||
}
|
||||
@ -331,7 +332,7 @@ int IndexTableScan::compareKeys(const index_desc* idx,
|
||||
|
||||
if (idx->idx_count > 1)
|
||||
{
|
||||
// If we search for NULLs at the begin then we're done if the first
|
||||
// If we search for NULLs at the beginning then we're done if the first
|
||||
// segment isn't the first one possible (0 for ASC, 255 for DESC).
|
||||
if (length2 == 0)
|
||||
{
|
||||
|
@ -42,8 +42,9 @@ MergeJoin::MergeJoin(CompilerScratch* csb, size_t count,
|
||||
SortedStream* const* args, jrd_nod* const* keys)
|
||||
: m_args(csb->csb_pool), m_keys(csb->csb_pool)
|
||||
{
|
||||
m_impure = CMP_impure(csb, (USHORT) (sizeof(struct Impure) +
|
||||
count * sizeof(Impure::irsb_mrg_repeat)));
|
||||
size_t size = sizeof(struct Impure) + count * sizeof(Impure::irsb_mrg_repeat);
|
||||
fb_assert(size < size_t(MAX_USHORT));
|
||||
m_impure = CMP_impure(csb, (USHORT) size);
|
||||
|
||||
m_args.resize(count);
|
||||
m_keys.resize(count);
|
||||
|
@ -61,7 +61,7 @@ void ProcedureScan::open(thread_db* tdbb)
|
||||
rpb->rpb_record = NULL;
|
||||
|
||||
USHORT iml;
|
||||
UCHAR* im;
|
||||
const UCHAR* im;
|
||||
|
||||
jrd_req* const proc_request = EXE_find_request(tdbb, m_procedure->prc_request, false);
|
||||
impure->irsb_req_handle = proc_request;
|
||||
|
@ -146,7 +146,7 @@ void RecordSource::restoreRecord(thread_db* tdbb, record_param* rpb)
|
||||
const USHORT size = rec_copy->rec_length;
|
||||
if (size > record->rec_length)
|
||||
{
|
||||
// hvlad: saved copy of record have longer format, reallocate
|
||||
// hvlad: saved copy of record has longer format, reallocate
|
||||
// given record to make enough space for saved data
|
||||
record = VIO_record(tdbb, rpb, rec_copy->rec_format, pool);
|
||||
}
|
||||
|
@ -506,7 +506,7 @@ namespace Jrd
|
||||
jrd_nod* node; // expression node
|
||||
};
|
||||
|
||||
SortMap(MemoryPool& p)
|
||||
explicit SortMap(MemoryPool& p)
|
||||
: PermanentStorage(p),
|
||||
keyItems(p),
|
||||
items(p)
|
||||
|
@ -97,7 +97,7 @@ bool SortedStream::getRecord(thread_db* tdbb)
|
||||
return false;
|
||||
}
|
||||
|
||||
mapData(tdbb, request, reinterpret_cast<UCHAR*>(data));
|
||||
mapData(tdbb, request, data);
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -188,7 +188,7 @@ sort_context* SortedStream::init(thread_db* tdbb)
|
||||
UCHAR* data = NULL;
|
||||
SORT_put(tdbb, handle, reinterpret_cast<ULONG**>(&data));
|
||||
|
||||
// Zero out the sort key. This solve a multitude of problems.
|
||||
// Zero out the sort key. This solves a multitude of problems.
|
||||
|
||||
memset(data, 0, m_map->length);
|
||||
|
||||
@ -270,7 +270,7 @@ sort_context* SortedStream::init(thread_db* tdbb)
|
||||
}
|
||||
|
||||
// For the sake of prudence, set all record parameter blocks to contain
|
||||
// the most recent format. This is will guarentee that all fields mapped
|
||||
// the most recent format. This will guarentee that all fields mapped
|
||||
// back to records by get_sort() have homes in the target record.
|
||||
|
||||
if (records)
|
||||
|
Loading…
Reference in New Issue
Block a user