mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-22 22:43:03 +01:00
Misc and warnings.
This commit is contained in:
parent
aa1aa4eed8
commit
2810026363
@ -1,4 +1,4 @@
|
||||
Firebird 2 Server for Linux
|
||||
Firebird 3 Server for Linux
|
||||
|
||||
|
||||
More information can be found about the Firebird
|
||||
|
@ -76,7 +76,7 @@ int main()
|
||||
try
|
||||
{
|
||||
// status vector and main dispatcher are returned by calls to IMaster functions
|
||||
// no error return may happen - this functions always succeed
|
||||
// no error return may happen - these functions always succeed
|
||||
st = master->getStatus();
|
||||
prov = master->getDispatcher();
|
||||
|
||||
|
@ -255,7 +255,7 @@ static int svc_api_gbak(Firebird::UtilSvc* uSvc, const Switches& switches)
|
||||
}
|
||||
}
|
||||
|
||||
Firebird::string* dbName = flag_restore ? &files[1] : &files[0];
|
||||
const Firebird::string* dbName = flag_restore ? &files[1] : &files[0];
|
||||
|
||||
ISC_STATUS_ARRAY status;
|
||||
FB_API_HANDLE svc_handle = 0;
|
||||
|
@ -96,7 +96,7 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
MsgMetadata(IMessageMetadata* from)
|
||||
explicit MsgMetadata(IMessageMetadata* from)
|
||||
: items(getPool()),
|
||||
length(0)
|
||||
{
|
||||
@ -246,7 +246,7 @@ public:
|
||||
class AttMetadata : public MsgMetadata
|
||||
{
|
||||
public:
|
||||
AttMetadata(IAttachment* att)
|
||||
explicit AttMetadata(IAttachment* att)
|
||||
: MsgMetadata(),
|
||||
attachment(att)
|
||||
{ }
|
||||
|
@ -43,7 +43,7 @@ public:
|
||||
class Parameters : public AttMetadata
|
||||
{
|
||||
public:
|
||||
Parameters(IAttachment* att)
|
||||
explicit Parameters(IAttachment* att)
|
||||
: AttMetadata(att),
|
||||
fetched(false)
|
||||
{
|
||||
|
@ -559,15 +559,15 @@ private:
|
||||
|
||||
static int compare(const void* a, const void* b)
|
||||
{
|
||||
const Key& first(KeyOfValue::generate(*reinterpret_cast<const Value*>(a)));
|
||||
const Key& second(KeyOfValue::generate(*reinterpret_cast<const Value*>(b)));
|
||||
const Key& first(KeyOfValue::generate(*static_cast<const Value*>(a)));
|
||||
const Key& second(KeyOfValue::generate(*static_cast<const Value*>(b)));
|
||||
|
||||
if (Cmp::greaterThan(first, second))
|
||||
return 1;
|
||||
else if (Cmp::greaterThan(second, first))
|
||||
if (Cmp::greaterThan(second, first))
|
||||
return -1;
|
||||
else
|
||||
return 0;
|
||||
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -716,10 +716,11 @@ int Config::getWireCrypt(WireCryptMode wcMode) const
|
||||
Firebird::NoCaseString wireCrypt(wc);
|
||||
if (wireCrypt == "DISABLED")
|
||||
return WIRE_CRYPT_DISABLED;
|
||||
else if (wireCrypt == "ENABLED")
|
||||
if (wireCrypt == "ENABLED")
|
||||
return WIRE_CRYPT_ENABLED;
|
||||
else // the safest choice
|
||||
return WIRE_CRYPT_REQUIRED;
|
||||
|
||||
// the safest choice
|
||||
return WIRE_CRYPT_REQUIRED;
|
||||
}
|
||||
|
||||
bool Config::getRemoteAccess() const
|
||||
|
@ -1830,7 +1830,7 @@ public:
|
||||
class Property : public PermanentStorage
|
||||
{
|
||||
public:
|
||||
Property(MemoryPool& p)
|
||||
explicit Property(MemoryPool& p)
|
||||
: PermanentStorage(p),
|
||||
value(p)
|
||||
{ }
|
||||
|
@ -210,13 +210,11 @@ private:
|
||||
BoolAsValueNode* node = value->as<BoolAsValueNode>();
|
||||
if (node)
|
||||
return node->boolean;
|
||||
else
|
||||
{
|
||||
ComparativeBoolNode* cmpNode = newNode<ComparativeBoolNode>(
|
||||
blr_eql, value, MAKE_constant("1", CONSTANT_BOOLEAN));
|
||||
cmpNode->dsqlWasValue = true;
|
||||
return cmpNode;
|
||||
}
|
||||
|
||||
ComparativeBoolNode* cmpNode = newNode<ComparativeBoolNode>(
|
||||
blr_eql, value, MAKE_constant("1", CONSTANT_BOOLEAN));
|
||||
cmpNode->dsqlWasValue = true;
|
||||
return cmpNode;
|
||||
}
|
||||
|
||||
void yyReducePosn(YYPOSN& ret, YYPOSN* termPosns, YYSTYPE* termVals,
|
||||
|
@ -1152,7 +1152,7 @@ static void write_log(int log_action, const char* buff)
|
||||
tmp_buff, 0, 0, (LPTSTR) &lpMsgBuf, 0,
|
||||
reinterpret_cast<va_list*>(act_buff));
|
||||
|
||||
const int len = MIN(BUFF_SIZE-1, strlen(lpMsgBuf) - 1);
|
||||
const int len = MIN(BUFF_SIZE - 1, strlen(lpMsgBuf) - 1);
|
||||
strncpy(act_buff[0], lpMsgBuf, len);
|
||||
act_buff[0][len] = 0;
|
||||
LocalFree(lpMsgBuf);
|
||||
|
@ -2549,8 +2549,8 @@ static void list_functions_legacy()
|
||||
bool firstarg = true;
|
||||
|
||||
FOR FNA IN RDB$FUNCTION_ARGUMENTS WITH
|
||||
FUN.RDB$FUNCTION_NAME EQ FNA.RDB$FUNCTION_NAME AND
|
||||
FUN.RDB$PACKAGE_NAME MISSING
|
||||
FUN.RDB$FUNCTION_NAME EQ FNA.RDB$FUNCTION_NAME
|
||||
AND FUN.RDB$PACKAGE_NAME MISSING
|
||||
SORTED BY FNA.RDB$ARGUMENT_POSITION
|
||||
|
||||
// Find parameter type
|
||||
|
@ -560,7 +560,11 @@ void Jrd::Attachment::releaseLocks(thread_db* tdbb)
|
||||
}
|
||||
}
|
||||
|
||||
void Jrd::Attachment::SyncGuard::init(const char* f, bool optional)
|
||||
void Jrd::Attachment::SyncGuard::init(const char* f, bool
|
||||
#ifdef DEV_BUILD
|
||||
optional
|
||||
#endif
|
||||
)
|
||||
{
|
||||
fb_assert(optional || jAtt);
|
||||
|
||||
|
@ -304,7 +304,7 @@ public:
|
||||
class Linger FB_FINAL : public Firebird::RefCntIface<Firebird::ITimer, FB_TIMER_VERSION>
|
||||
{
|
||||
public:
|
||||
Linger(Database* a_dbb)
|
||||
explicit Linger(Database* a_dbb)
|
||||
: dbb(a_dbb), active(false)
|
||||
{ }
|
||||
|
||||
|
@ -392,7 +392,7 @@ public:
|
||||
|
||||
private:
|
||||
Attachment* att;
|
||||
// This mutexes guarantee attachment existence. After releasing both of them with possibly
|
||||
// These mutexes guarantee attachment existence. After releasing both of them with possibly
|
||||
// zero att_use_count one should check does attachment still exists calling getHandle().
|
||||
Firebird::Mutex mainMutex, asyncMutex;
|
||||
|
||||
|
@ -80,7 +80,7 @@ namespace
|
||||
{
|
||||
*desc = format->fmt_desc[index];
|
||||
|
||||
if (index % 2 == 0 && index / 2 < parameters.getCount())
|
||||
if (index % 2 == 0 && index / 2u < parameters.getCount())
|
||||
{
|
||||
const Parameter* param = parameters[index / 2];
|
||||
|
||||
@ -234,7 +234,7 @@ namespace
|
||||
: CompoundStmtNode(pool)
|
||||
{
|
||||
// Iterate over the format items, except the EOF item.
|
||||
for (USHORT i = 0; i < message->format->fmt_count / 2 * 2; i += 2)
|
||||
for (USHORT i = 0; i < (message->format->fmt_count / 2) * 2; i += 2)
|
||||
{
|
||||
ExtInitParameterNode* init = FB_NEW(pool) ExtInitParameterNode(
|
||||
tdbb, pool, csb, message, i);
|
||||
@ -251,7 +251,7 @@ namespace
|
||||
: CompoundStmtNode(pool)
|
||||
{
|
||||
// Iterate over the format items, except the EOF item.
|
||||
for (USHORT i = 0; i < message->format->fmt_count / 2 * 2; i += 2)
|
||||
for (USHORT i = 0; i < (message->format->fmt_count / 2) * 2; i += 2)
|
||||
{
|
||||
if (!message->isSpecial[i / 2])
|
||||
continue;
|
||||
@ -908,7 +908,7 @@ void ExtEngineManager::Trigger::execute(thread_db* tdbb, ExternalTrigger::Action
|
||||
Record* record = newRpb->rpb_record;
|
||||
UCHAR* p = newMsg.begin();
|
||||
|
||||
for (unsigned i = 0; i < format->fmt_count / 2; ++i)
|
||||
for (unsigned i = 0; i < format->fmt_count / 2u; ++i)
|
||||
{
|
||||
USHORT fieldPos = fieldsPos[i];
|
||||
|
||||
@ -944,7 +944,7 @@ void ExtEngineManager::Trigger::setValues(thread_db* tdbb, Array<UCHAR>& msgBuff
|
||||
UCHAR* p = msgBuffer.getBuffer(format->fmt_length);
|
||||
memset(p, 0, format->fmt_length);
|
||||
|
||||
for (unsigned i = 0; i < format->fmt_count / 2; ++i)
|
||||
for (unsigned i = 0; i < format->fmt_count / 2u; ++i)
|
||||
{
|
||||
USHORT fieldPos = fieldsPos[i];
|
||||
|
||||
|
@ -1668,7 +1668,8 @@ void UnionSourceNode::genBlr(DsqlCompilerScratch* dsqlScratch)
|
||||
DsqlMapNode* mapNode = mapItem->as<DsqlMapNode>();
|
||||
fb_assert(mapNode);
|
||||
|
||||
if (!mapNode) {
|
||||
if (!mapNode)
|
||||
{
|
||||
ERRD_post(Arg::Gds(isc_sqlerr) << Arg::Num(-901) <<
|
||||
Arg::Gds(isc_dsql_internal_err) <<
|
||||
Arg::Gds(isc_random) << Arg::Str("UnionSourceNode::genBlr: expected DsqlMapNode") );
|
||||
|
@ -264,7 +264,7 @@ void Routine::remove(thread_db* tdbb)
|
||||
|
||||
// Routine that is being altered may have references
|
||||
// to it by other routines via pointer to current meta
|
||||
// data structure, so don't loose the structure or the pointer.
|
||||
// data structure, so don't lose the structure or the pointer.
|
||||
if (checkCache(tdbb) && !(flags & Routine::FLAG_BEING_ALTERED))
|
||||
clearCache(tdbb);
|
||||
|
||||
|
@ -2416,7 +2416,7 @@ static void adjust_scan_count(WIN* window, bool mustRead)
|
||||
|
||||
if (window->win_flags & WIN_large_scan)
|
||||
{
|
||||
if (mustRead || bdb->bdb_flags & BDB_prefetch || bdb->bdb_scan_count < 0)
|
||||
if (mustRead || (bdb->bdb_flags & BDB_prefetch) || bdb->bdb_scan_count < 0)
|
||||
bdb->bdb_scan_count = window->win_scans;
|
||||
}
|
||||
else if (window->win_flags & WIN_garbage_collector)
|
||||
@ -2758,7 +2758,7 @@ static void flushAll(thread_db* tdbb, USHORT flush_flag)
|
||||
}
|
||||
}
|
||||
|
||||
// release lock before loosing control over bdb, it prevents
|
||||
// release lock before losing control over bdb, it prevents
|
||||
// concurrent operations on released lock
|
||||
if (release_flag)
|
||||
{
|
||||
|
@ -494,7 +494,7 @@ namespace
|
||||
class OverwriteHolder : public MutexLockGuard
|
||||
{
|
||||
public:
|
||||
OverwriteHolder(Database* to_remove)
|
||||
explicit OverwriteHolder(Database* to_remove)
|
||||
: MutexLockGuard(databases_mutex, FB_FUNCTION), dbb(to_remove)
|
||||
{
|
||||
for (Database** d_ptr = &databases; *d_ptr; d_ptr = &(*d_ptr)->dbb_next)
|
||||
|
@ -2633,7 +2633,7 @@ jrd_prc* MET_lookup_procedure_id(thread_db* tdbb, USHORT id,
|
||||
|
||||
jrd_prc* procedure;
|
||||
|
||||
if (id < (SSHORT) attachment->att_procedures.getCount() && (procedure = attachment->att_procedures[id]) &&
|
||||
if (id < (USHORT) attachment->att_procedures.getCount() && (procedure = attachment->att_procedures[id]) &&
|
||||
procedure->getId() == id &&
|
||||
!(procedure->flags & Routine::FLAG_BEING_SCANNED) &&
|
||||
((procedure->flags & Routine::FLAG_SCANNED) || noscan) &&
|
||||
|
@ -132,7 +132,7 @@ private:
|
||||
ConfigStorage* storage;
|
||||
|
||||
public:
|
||||
StorageInstance(Firebird::MemoryPool&) :
|
||||
explicit StorageInstance(Firebird::MemoryPool&) :
|
||||
storage(NULL)
|
||||
{}
|
||||
|
||||
|
@ -392,7 +392,7 @@ int gsec(Firebird::UtilSvc* uSvc)
|
||||
class Attributes : public ConfigFile
|
||||
{
|
||||
public:
|
||||
Attributes(IUser* data)
|
||||
explicit Attributes(IUser* data)
|
||||
: ConfigFile(USE_TEXT, data->attributes()->entered() ? data->attributes()->get() : "")
|
||||
{ }
|
||||
|
||||
|
@ -308,7 +308,7 @@ public:
|
||||
class YMetadata
|
||||
{
|
||||
public:
|
||||
YMetadata(bool in)
|
||||
explicit YMetadata(bool in)
|
||||
: flag(false), input(in)
|
||||
{ }
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user