diff --git a/builds/install/arch-specific/linux/README b/builds/install/arch-specific/linux/README index 25c9a47c23..3a6b52c68a 100644 --- a/builds/install/arch-specific/linux/README +++ b/builds/install/arch-specific/linux/README @@ -1,4 +1,4 @@ -Firebird 2 Server for Linux +Firebird 3 Server for Linux More information can be found about the Firebird diff --git a/examples/interfaces/01.create.cpp b/examples/interfaces/01.create.cpp index ec5504352d..080603469d 100644 --- a/examples/interfaces/01.create.cpp +++ b/examples/interfaces/01.create.cpp @@ -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(); diff --git a/src/burp/burp.cpp b/src/burp/burp.cpp index c41bc6a4c2..04cd8ce9a0 100644 --- a/src/burp/burp.cpp +++ b/src/burp/burp.cpp @@ -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; diff --git a/src/common/MsgMetadata.h b/src/common/MsgMetadata.h index c4d1106b37..1b843d4eb6 100644 --- a/src/common/MsgMetadata.h +++ b/src/common/MsgMetadata.h @@ -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) { } diff --git a/src/common/StatementMetadata.h b/src/common/StatementMetadata.h index aac7b7a12c..f64b561dd7 100644 --- a/src/common/StatementMetadata.h +++ b/src/common/StatementMetadata.h @@ -43,7 +43,7 @@ public: class Parameters : public AttMetadata { public: - Parameters(IAttachment* att) + explicit Parameters(IAttachment* att) : AttMetadata(att), fetched(false) { diff --git a/src/common/classes/array.h b/src/common/classes/array.h index d026bbdb4e..45a52c7235 100644 --- a/src/common/classes/array.h +++ b/src/common/classes/array.h @@ -559,15 +559,15 @@ private: static int compare(const void* a, const void* b) { - const Key& first(KeyOfValue::generate(*reinterpret_cast(a))); - const Key& second(KeyOfValue::generate(*reinterpret_cast(b))); + const Key& first(KeyOfValue::generate(*static_cast(a))); + const Key& second(KeyOfValue::generate(*static_cast(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; } }; diff --git a/src/common/config/config.cpp b/src/common/config/config.cpp index 8734887b81..bdfc9fa34c 100644 --- a/src/common/config/config.cpp +++ b/src/common/config/config.cpp @@ -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 diff --git a/src/dsql/DdlNodes.h b/src/dsql/DdlNodes.h index a240de8e67..1e59dd36c4 100644 --- a/src/dsql/DdlNodes.h +++ b/src/dsql/DdlNodes.h @@ -1830,7 +1830,7 @@ public: class Property : public PermanentStorage { public: - Property(MemoryPool& p) + explicit Property(MemoryPool& p) : PermanentStorage(p), value(p) { } diff --git a/src/dsql/Parser.h b/src/dsql/Parser.h index a80ae82afa..fe94d1f31c 100644 --- a/src/dsql/Parser.h +++ b/src/dsql/Parser.h @@ -210,13 +210,11 @@ private: BoolAsValueNode* node = value->as(); if (node) return node->boolean; - else - { - ComparativeBoolNode* cmpNode = newNode( - blr_eql, value, MAKE_constant("1", CONSTANT_BOOLEAN)); - cmpNode->dsqlWasValue = true; - return cmpNode; - } + + ComparativeBoolNode* cmpNode = newNode( + blr_eql, value, MAKE_constant("1", CONSTANT_BOOLEAN)); + cmpNode->dsqlWasValue = true; + return cmpNode; } void yyReducePosn(YYPOSN& ret, YYPOSN* termPosns, YYSTYPE* termVals, diff --git a/src/iscguard/iscguard.cpp b/src/iscguard/iscguard.cpp index bb35ab91c6..0c9026078a 100644 --- a/src/iscguard/iscguard.cpp +++ b/src/iscguard/iscguard.cpp @@ -1152,7 +1152,7 @@ static void write_log(int log_action, const char* buff) tmp_buff, 0, 0, (LPTSTR) &lpMsgBuf, 0, reinterpret_cast(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); diff --git a/src/isql/extract.epp b/src/isql/extract.epp index 9cc80d12da..b6ea9d752a 100644 --- a/src/isql/extract.epp +++ b/src/isql/extract.epp @@ -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 diff --git a/src/jrd/Attachment.cpp b/src/jrd/Attachment.cpp index e0ea6c0a99..67d19fa5c2 100644 --- a/src/jrd/Attachment.cpp +++ b/src/jrd/Attachment.cpp @@ -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); diff --git a/src/jrd/Database.h b/src/jrd/Database.h index 16ee5f0428..d064decb69 100644 --- a/src/jrd/Database.h +++ b/src/jrd/Database.h @@ -304,7 +304,7 @@ public: class Linger FB_FINAL : public Firebird::RefCntIface { public: - Linger(Database* a_dbb) + explicit Linger(Database* a_dbb) : dbb(a_dbb), active(false) { } diff --git a/src/jrd/EngineInterface.h b/src/jrd/EngineInterface.h index 2a5e2f40a8..ef488e5783 100644 --- a/src/jrd/EngineInterface.h +++ b/src/jrd/EngineInterface.h @@ -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; diff --git a/src/jrd/ExtEngineManager.cpp b/src/jrd/ExtEngineManager.cpp index 81d7e35b47..0eaa9d8e53 100644 --- a/src/jrd/ExtEngineManager.cpp +++ b/src/jrd/ExtEngineManager.cpp @@ -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& 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]; diff --git a/src/jrd/RecordSourceNodes.cpp b/src/jrd/RecordSourceNodes.cpp index d42ce14eff..0b573507c8 100644 --- a/src/jrd/RecordSourceNodes.cpp +++ b/src/jrd/RecordSourceNodes.cpp @@ -1668,7 +1668,8 @@ void UnionSourceNode::genBlr(DsqlCompilerScratch* dsqlScratch) DsqlMapNode* mapNode = mapItem->as(); 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") ); diff --git a/src/jrd/Routine.cpp b/src/jrd/Routine.cpp index be2ff8093d..e161828787 100644 --- a/src/jrd/Routine.cpp +++ b/src/jrd/Routine.cpp @@ -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); diff --git a/src/jrd/cch.cpp b/src/jrd/cch.cpp index d8b555c35e..c9553ba0ec 100644 --- a/src/jrd/cch.cpp +++ b/src/jrd/cch.cpp @@ -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) { diff --git a/src/jrd/jrd.cpp b/src/jrd/jrd.cpp index 149f3ae7e8..517c4190b1 100644 --- a/src/jrd/jrd.cpp +++ b/src/jrd/jrd.cpp @@ -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) diff --git a/src/jrd/met.epp b/src/jrd/met.epp index 6b5f36f1c1..9ba3f35803 100644 --- a/src/jrd/met.epp +++ b/src/jrd/met.epp @@ -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) && diff --git a/src/jrd/trace/TraceConfigStorage.h b/src/jrd/trace/TraceConfigStorage.h index 9d77e696ce..faadc20801 100644 --- a/src/jrd/trace/TraceConfigStorage.h +++ b/src/jrd/trace/TraceConfigStorage.h @@ -132,7 +132,7 @@ private: ConfigStorage* storage; public: - StorageInstance(Firebird::MemoryPool&) : + explicit StorageInstance(Firebird::MemoryPool&) : storage(NULL) {} diff --git a/src/utilities/gsec/gsec.cpp b/src/utilities/gsec/gsec.cpp index a559db3aae..c06e996f48 100644 --- a/src/utilities/gsec/gsec.cpp +++ b/src/utilities/gsec/gsec.cpp @@ -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() : "") { } diff --git a/src/yvalve/YObjects.h b/src/yvalve/YObjects.h index 2226fcaceb..b1b24b3730 100644 --- a/src/yvalve/YObjects.h +++ b/src/yvalve/YObjects.h @@ -308,7 +308,7 @@ public: class YMetadata { public: - YMetadata(bool in) + explicit YMetadata(bool in) : flag(false), input(in) { }