Skip to content

Commit 5a4a905

Browse files
author
Artyom Abakumov
committed
Compare FB_NELEM only with FB_SIZE_T and FB_SSIZE_T
1 parent 0ae47e1 commit 5a4a905

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

src/common/pretty.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ int PRETTY_print_cdb(const UCHAR* blr, FPTR_PRINT_CALLBACK routine, void* user_a
159159
while (parameter = BLR_BYTE)
160160
{
161161
const char* p;
162-
if (parameter > static_cast<SSHORT>(FB_NELEM(cdb_table)) || !(p = cdb_table[parameter]))
162+
if (parameter > static_cast<FB_SSIZE_T>(FB_NELEM(cdb_table)) || !(p = cdb_table[parameter]))
163163
{
164164
return error(control, 0, "*** cdb parameter %d is undefined ***\n", parameter);
165165
}

src/jrd/filters.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -811,7 +811,7 @@ ISC_STATUS filter_transliterate_text(USHORT action, BlobControl* control)
811811
{
812812
case isc_blob_filter_open:
813813
case isc_blob_filter_create:
814-
for (USHORT i = 0; i < FB_NELEM(control->ctl_data); i++)
814+
for (FB_SIZE_T i = 0; i < FB_NELEM(control->ctl_data); i++)
815815
control->ctl_data[i] = 0;
816816
aux = NULL;
817817

src/jrd/par.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1519,7 +1519,7 @@ DmlNode* PAR_parse_node(thread_db* tdbb, CompilerScratch* csb)
15191519
const ULONG blrOffset = csb->csb_blr_reader.getOffset();
15201520
const SSHORT blrOperator = csb->csb_blr_reader.getByte();
15211521

1522-
if (blrOperator < 0 || static_cast<USHORT>(blrOperator) >= FB_NELEM(blr_parsers))
1522+
if (blrOperator < 0 || static_cast<FB_SIZE_T>(blrOperator) >= FB_NELEM(blr_parsers))
15231523
{
15241524
// NS: This error string is correct, please do not mangle it again and again.
15251525
// The whole error message is "BLR syntax error: expected %s at offset %d, encountered %d"

src/yvalve/gds.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4025,7 +4025,7 @@ static void blr_print_verb(gds_ctl* control, SSHORT level)
40254025
case blr_invoke_function_type:
40264026
n = control->ctl_blr_reader.getByte();
40274027

4028-
if (n == 0 || n >= static_cast<SSHORT>(FB_NELEM(typeSubCodes)))
4028+
if (n == 0 || n >= static_cast<FB_SSIZE_T>(FB_NELEM(typeSubCodes)))
40294029
blr_error(control, "*** invalid blr_invoke_function_type sub code ***");
40304030

40314031
blr_format(control, "blr_invoke_function_type_%s,", typeSubCodes[n]);
@@ -4123,7 +4123,7 @@ static void blr_print_verb(gds_ctl* control, SSHORT level)
41234123
case blr_invsel_procedure_type:
41244124
n = control->ctl_blr_reader.getByte();
41254125

4126-
if (n == 0 || n >= static_cast<SSHORT>(FB_NELEM(typeSubCodes)))
4126+
if (n == 0 || n >= static_cast<FB_SSIZE_T>(FB_NELEM(typeSubCodes)))
41274127
blr_error(control, "*** invalid blr_invsel_procedure_type sub code ***");
41284128

41294129
blr_format(control, "blr_invsel_procedure_type_%s,", typeSubCodes[n]);

0 commit comments

Comments
 (0)