8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-22 18:03:03 +01:00

Compare signed/unsigned warnings

This commit is contained in:
AlexPeshkoff 2024-12-26 17:24:37 +03:00
parent 3bdaddfb5c
commit 2423a1487b
5 changed files with 13 additions and 13 deletions

View File

@ -70,7 +70,7 @@ namespace
} }
} }
bool contains(const char* value, USHORT& outTimezoneId, int& outParsedTimezoneLength) bool contains(const char* value, USHORT& outTimezoneId, unsigned int& outParsedTimezoneLength)
{ {
const TrieNode* currentNode = m_root; const TrieNode* currentNode = m_root;
FB_SIZE_T valueLength = fb_strlen(value); FB_SIZE_T valueLength = fb_strlen(value);
@ -97,7 +97,7 @@ namespace
TrieNode* currentNode = m_root; TrieNode* currentNode = m_root;
FB_SIZE_T valueLength = fb_strlen(value); FB_SIZE_T valueLength = fb_strlen(value);
for (int i = 0; i < valueLength; i++) for (unsigned int i = 0; i < valueLength; i++)
{ {
int index = calculateIndex(value[i]); int index = calculateIndex(value[i]);
@ -460,7 +460,7 @@ namespace
patternStr = std::string_view(format + formatStart, offset - formatStart + 1); patternStr = std::string_view(format + formatStart, offset - formatStart + 1);
bool isFound = false; bool isFound = false;
for (int j = 0; j < PatternsSize; j++) for (unsigned int j = 0; j < PatternsSize; j++)
{ {
if (!strncmp(patterns[j], patternStr.data(), patternStr.length())) if (!strncmp(patterns[j], patternStr.data(), patternStr.length()))
{ {
@ -1542,7 +1542,7 @@ namespace
} }
case Format::TZR: case Format::TZR:
{ {
int parsedTimezoneNameLength = 0; unsigned int parsedTimezoneNameLength = 0;
const bool timezoneNameIsCorrect = timeZoneTrie().contains(str + strOffset, outTimezoneId, parsedTimezoneNameLength); const bool timezoneNameIsCorrect = timeZoneTrie().contains(str + strOffset, outTimezoneId, parsedTimezoneNameLength);
if (!timezoneNameIsCorrect) if (!timezoneNameIsCorrect)
status_exception::raise(Arg::Gds(isc_invalid_timezone_region) << string(str + strOffset, parsedTimezoneNameLength)); 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::
stringUpper[i] = toupper(sourceString[i]); stringUpper[i] = toupper(sourceString[i]);
string formatUpper(format.length(), '\0'); string formatUpper(format.length(), '\0');
for (int i = 0; i < format.length(); i++) for (unsigned int i = 0; i < format.length(); i++)
formatUpper[i] = toupper(format[i]); formatUpper[i] = toupper(format[i]);
StringToDateTimeData cvtData; StringToDateTimeData cvtData;

View File

@ -1356,7 +1356,7 @@ static bool validate_dsc_tables();
int dsc::getStringLength() const USHORT dsc::getStringLength() const
{ {
return DSC_string_length(this); return DSC_string_length(this);
} }
@ -1533,7 +1533,7 @@ bool DSC_make_descriptor(DSC* desc,
} }
int DSC_string_length(const dsc* desc) USHORT DSC_string_length(const dsc* desc)
{ {
/************************************** /**************************************
* *
@ -1561,10 +1561,10 @@ int DSC_string_length(const dsc* desc)
return desc->dsc_length - sizeof(USHORT); return desc->dsc_length - sizeof(USHORT);
default: default:
if (!DTYPE_IS_EXACT(desc->dsc_dtype) || desc->dsc_scale == 0) if (!DTYPE_IS_EXACT(desc->dsc_dtype) || desc->dsc_scale == 0)
return (int) _DSC_convert_to_text_length[desc->dsc_dtype]; return _DSC_convert_to_text_length[desc->dsc_dtype];
if (desc->dsc_scale < 0) if (desc->dsc_scale < 0)
return (int) _DSC_convert_to_text_length[desc->dsc_dtype] + 1; return _DSC_convert_to_text_length[desc->dsc_dtype] + 1;
return (int) _DSC_convert_to_text_length[desc->dsc_dtype] + desc->dsc_scale; return _DSC_convert_to_text_length[desc->dsc_dtype] + desc->dsc_scale;
} }
} }

View File

@ -499,7 +499,7 @@ typedef struct dsc
dsc_address = address; dsc_address = address;
} }
int getStringLength() const; USHORT getStringLength() const;
operator Ods::Descriptor() const operator Ods::Descriptor() const
{ {

View File

@ -26,7 +26,7 @@
#include "../common/dsc.h" #include "../common/dsc.h"
int DSC_string_length(const struct dsc*); USHORT DSC_string_length(const struct dsc*);
const TEXT* DSC_dtype_tostring(UCHAR); const TEXT* DSC_dtype_tostring(UCHAR);
void DSC_get_dtype_name(const dsc*, TEXT*, USHORT); void DSC_get_dtype_name(const dsc*, TEXT*, USHORT);
bool DSC_make_descriptor(dsc*, USHORT, SSHORT, bool DSC_make_descriptor(dsc*, USHORT, SSHORT,

View File

@ -2626,7 +2626,7 @@ dsc* evlCharToUuid(thread_db* tdbb, const SysFunction* function, const NestValue
Arg::Str(function->name)); Arg::Str(function->name));
} }
for (int i = 0; i < Uuid::STR_LEN; ++i) for (unsigned int i = 0; i < Uuid::STR_LEN; ++i)
{ {
if (i == 8 || i == 13 || i == 18 || i == 23) if (i == 8 || i == 13 || i == 18 || i == 23)
{ {