Skip to content

Commit 2423a14

Browse files
committed
Compare signed/unsigned warnings
1 parent 3bdaddf commit 2423a14

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

src/common/CvtFormat.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ namespace
7070
}
7171
}
7272

73-
bool contains(const char* value, USHORT& outTimezoneId, int& outParsedTimezoneLength)
73+
bool contains(const char* value, USHORT& outTimezoneId, unsigned int& outParsedTimezoneLength)
7474
{
7575
const TrieNode* currentNode = m_root;
7676
FB_SIZE_T valueLength = fb_strlen(value);
@@ -97,7 +97,7 @@ namespace
9797
TrieNode* currentNode = m_root;
9898
FB_SIZE_T valueLength = fb_strlen(value);
9999

100-
for (int i = 0; i < valueLength; i++)
100+
for (unsigned int i = 0; i < valueLength; i++)
101101
{
102102
int index = calculateIndex(value[i]);
103103

@@ -460,7 +460,7 @@ namespace
460460
patternStr = std::string_view(format + formatStart, offset - formatStart + 1);
461461
bool isFound = false;
462462

463-
for (int j = 0; j < PatternsSize; j++)
463+
for (unsigned int j = 0; j < PatternsSize; j++)
464464
{
465465
if (!strncmp(patterns[j], patternStr.data(), patternStr.length()))
466466
{
@@ -1542,7 +1542,7 @@ namespace
15421542
}
15431543
case Format::TZR:
15441544
{
1545-
int parsedTimezoneNameLength = 0;
1545+
unsigned int parsedTimezoneNameLength = 0;
15461546
const bool timezoneNameIsCorrect = timeZoneTrie().contains(str + strOffset, outTimezoneId, parsedTimezoneNameLength);
15471547
if (!timezoneNameIsCorrect)
15481548
status_exception::raise(Arg::Gds(isc_invalid_timezone_region) << string(str + strOffset, parsedTimezoneNameLength));
@@ -1669,7 +1669,7 @@ ISC_TIMESTAMP_TZ CVT_format_string_to_datetime(const dsc* desc, const Firebird::
16691669
stringUpper[i] = toupper(sourceString[i]);
16701670

16711671
string formatUpper(format.length(), '\0');
1672-
for (int i = 0; i < format.length(); i++)
1672+
for (unsigned int i = 0; i < format.length(); i++)
16731673
formatUpper[i] = toupper(format[i]);
16741674

16751675
StringToDateTimeData cvtData;

src/common/dsc.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1356,7 +1356,7 @@ static bool validate_dsc_tables();
13561356

13571357

13581358

1359-
int dsc::getStringLength() const
1359+
USHORT dsc::getStringLength() const
13601360
{
13611361
return DSC_string_length(this);
13621362
}
@@ -1533,7 +1533,7 @@ bool DSC_make_descriptor(DSC* desc,
15331533
}
15341534

15351535

1536-
int DSC_string_length(const dsc* desc)
1536+
USHORT DSC_string_length(const dsc* desc)
15371537
{
15381538
/**************************************
15391539
*
@@ -1561,10 +1561,10 @@ int DSC_string_length(const dsc* desc)
15611561
return desc->dsc_length - sizeof(USHORT);
15621562
default:
15631563
if (!DTYPE_IS_EXACT(desc->dsc_dtype) || desc->dsc_scale == 0)
1564-
return (int) _DSC_convert_to_text_length[desc->dsc_dtype];
1564+
return _DSC_convert_to_text_length[desc->dsc_dtype];
15651565
if (desc->dsc_scale < 0)
1566-
return (int) _DSC_convert_to_text_length[desc->dsc_dtype] + 1;
1567-
return (int) _DSC_convert_to_text_length[desc->dsc_dtype] + desc->dsc_scale;
1566+
return _DSC_convert_to_text_length[desc->dsc_dtype] + 1;
1567+
return _DSC_convert_to_text_length[desc->dsc_dtype] + desc->dsc_scale;
15681568
}
15691569
}
15701570

src/common/dsc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ typedef struct dsc
499499
dsc_address = address;
500500
}
501501

502-
int getStringLength() const;
502+
USHORT getStringLength() const;
503503

504504
operator Ods::Descriptor() const
505505
{

src/common/dsc_proto.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
#include "../common/dsc.h"
2828

29-
int DSC_string_length(const struct dsc*);
29+
USHORT DSC_string_length(const struct dsc*);
3030
const TEXT* DSC_dtype_tostring(UCHAR);
3131
void DSC_get_dtype_name(const dsc*, TEXT*, USHORT);
3232
bool DSC_make_descriptor(dsc*, USHORT, SSHORT,

src/jrd/SysFunction.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2626,7 +2626,7 @@ dsc* evlCharToUuid(thread_db* tdbb, const SysFunction* function, const NestValue
26262626
Arg::Str(function->name));
26272627
}
26282628

2629-
for (int i = 0; i < Uuid::STR_LEN; ++i)
2629+
for (unsigned int i = 0; i < Uuid::STR_LEN; ++i)
26302630
{
26312631
if (i == 8 || i == 13 || i == 18 || i == 23)
26322632
{

0 commit comments

Comments
 (0)