Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/common/cvt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1406,7 +1406,7 @@ double CVT_get_double(const dsc* desc, DecimalStatus decSt, ErrorFunction err, b
* Convert something arbitrary to a double precision number
*
**************************************/
double value;
double value = 0.0;

switch (desc->dsc_dtype)
{
Expand Down
4 changes: 1 addition & 3 deletions src/common/unicode_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1853,7 +1853,7 @@ USHORT UnicodeUtil::Utf16Collation::stringToKey(USHORT srcLen, const USHORT* src
if (keys)
{
UCHAR lastCharKey[BUFFER_TINY]; // sort key for a single character
ULONG prefixLen, lastCharKeyLen;
ULONG prefixLen = 0, lastCharKeyLen = 0;

srcLenLong -= i;

Expand All @@ -1877,8 +1877,6 @@ USHORT UnicodeUtil::Utf16Collation::stringToKey(USHORT srcLen, const USHORT* src
fb_assert(lastCharKey[lastCharKeyLen - 1] == '\0');
--lastCharKeyLen;
}
else
prefixLen = 0;

bool fallbackToPrefixKey = false;

Expand Down
6 changes: 3 additions & 3 deletions src/gpre/pat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,9 @@ void PATTERN_expand( USHORT column, const TEXT* pattern, PAT* args)
bool sw_gen = true;
p += align(p, column);

SSHORT value; // value needs to be signed since some of the
// values printed out are signed.
SLONG long_value;
SSHORT value = 0; // value needs to be signed since some of the
SLONG long_value = 0; // values printed out are signed.

TEXT c;
while ((c = *pattern++))
{
Expand Down
14 changes: 7 additions & 7 deletions src/jrd/btr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2315,15 +2315,13 @@ void BTR_reserve_slot(thread_db* tdbb, IndexCreation& creation)
}

UCHAR* desc = 0;
USHORT len, space;
const USHORT len = idx->idx_count * sizeof(irtd);
USHORT space = dbb->dbb_page_size;
index_root_page::irt_repeat* slot = NULL;
index_root_page::irt_repeat* end = NULL;

for (int retry = 0; retry < 2; ++retry)
{
len = idx->idx_count * sizeof(irtd);

space = dbb->dbb_page_size;
slot = NULL;

end = root->irt_rpt + root->irt_count;
Expand Down Expand Up @@ -2358,6 +2356,8 @@ void BTR_reserve_slot(thread_db* tdbb, IndexCreation& creation)
}
else
break;

space = dbb->dbb_page_size;
}

// If we didn't pick up an empty slot, allocate a new one
Expand Down Expand Up @@ -2816,8 +2816,8 @@ static void compress(thread_db* tdbb,
const Database* dbb = tdbb->getDatabase();
bool first_key = true;
VaryStr<MAX_KEY * 4> buffer;
size_t multiKeyLength;
UCHAR* ptr;
size_t multiKeyLength = 0;
UCHAR* ptr = nullptr;
UCHAR* p = key->key_data;
SSHORT scale = matchScale ? matchScale : desc->dsc_scale;

Expand All @@ -2829,7 +2829,7 @@ static void compress(thread_db* tdbb,

do
{
size_t length;
size_t length = 0;

has_next = false;

Expand Down
2 changes: 1 addition & 1 deletion src/jrd/exe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ void EXE_assignment(thread_db* tdbb, const ValueExprNode* to, dsc* from_desc, bo

if (null && to_desc->dsc_dtype <= dtype_varying)
{
USHORT minlen;
USHORT minlen = 0;

switch (to_desc->dsc_dtype)
{
Expand Down
23 changes: 7 additions & 16 deletions src/jrd/filters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1044,22 +1044,14 @@ ISC_STATUS filter_transliterate_text(USHORT action, BlobControl* control)

// Do we already have enough bytes in temp buffer to fill output buffer?

bool can_use_more;
bool can_use_more = true;
USHORT length = aux->ctlaux_buffer1_unused;
if (length)
// Always keep a minimal count of bytes in the input buffer
// to prevent the case of truncated characters.
if (length >= 4 && control->ctl_buffer_length < (length * aux->ctlaux_expansion_factor / EXP_SCALE))
{
if (control->ctl_buffer_length < (length * aux->ctlaux_expansion_factor / EXP_SCALE))
{
// No need to fetch more bytes, we have enough pending
can_use_more = false;
}
else
can_use_more = true;

// Always keep a minimal count of bytes in the input buffer,
// to prevent the case of truncated characters.
if (length < 4)
can_use_more = true;
// No need to fetch more bytes, we have enough pending
can_use_more = false;
}

/* Load data into the temporary buffer if,
Expand All @@ -1071,8 +1063,7 @@ ISC_STATUS filter_transliterate_text(USHORT action, BlobControl* control)

USHORT bytes_read_from_source = 0;

///if (!length || (can_use_more && (aux->ctlaux_source_blob_status == isc_segment)))
if (!length || can_use_more)
if (can_use_more)
{
// Get a segment, or partial segment, from the source
// into the temporary buffer
Expand Down
4 changes: 1 addition & 3 deletions src/jrd/recsrc/FilteredStream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ bool FilteredStream::evaluateBoolean(thread_db* tdbb) const
// on the right.

// ANY/ALL select node pointer
const BoolExprNode* select_node;
const BoolExprNode* select_node = nullptr;

// ANY/ALL column node pointer
const BoolExprNode* column_node = m_anyBoolean;
Expand All @@ -203,8 +203,6 @@ bool FilteredStream::evaluateBoolean(thread_db* tdbb) const
select_node = booleanNode->arg1;
column_node = booleanNode->arg2;
}
else
select_node = NULL;
}

if (column_node && m_ansiAny)
Expand Down
2 changes: 1 addition & 1 deletion src/utilities/guard/guard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,6 @@ int CLIB_ROUTINE main( int argc, char **argv)
time_t timer = 0;

do {
int ret_code;

if (shutting_down)
{
Expand Down Expand Up @@ -226,6 +225,7 @@ int CLIB_ROUTINE main( int argc, char **argv)
}

// wait for child to die, and evaluate exit status
int ret_code = NORMAL_EXIT;
bool shutdown_child = true;
if (!shutting_down)
{
Expand Down
4 changes: 2 additions & 2 deletions src/yvalve/gds.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3173,7 +3173,7 @@ static int blr_print_dtype(gds_ctl* control)
* data described.
*
**************************************/
SSHORT length;
SSHORT length = 0;

const USHORT dtype = control->ctl_blr_reader.getByte();

Expand Down Expand Up @@ -3537,7 +3537,7 @@ static void blr_print_verb(gds_ctl* control, SSHORT level)
blr_print_blr(control, blr_operator);
level++;
const UCHAR* ops = blr_print_table[blr_operator].blr_operators;
SSHORT n;
SSHORT n = 0;

while (*ops)
{
Expand Down