From f601bbdb8b261d42d55bc5a0dcc53ac7f8a47cc6 Mon Sep 17 00:00:00 2001 From: robocop Date: Wed, 8 Aug 2012 02:20:30 +0000 Subject: [PATCH] Misc. --- examples/dbcrypt/CryptKeyHolder.cpp | 2 +- src/burp/burp.h | 2 +- src/common/classes/alloc.h | 2 +- src/common/cvt.cpp | 2 +- src/common/db_alias.cpp | 3 ++- src/dsql/ExprNodes.cpp | 7 ++++--- src/include/firebird/Crypt.h | 2 +- src/jrd/CryptoManager.h | 6 +++--- src/jrd/trace/TraceJrdHelpers.h | 2 +- src/lock/print.cpp | 30 +++++++++++++++-------------- src/msgs/facilities2.sql | 2 +- src/msgs/history2.sql | 1 + src/remote/server/server.cpp | 4 ++-- 13 files changed, 35 insertions(+), 30 deletions(-) diff --git a/examples/dbcrypt/CryptKeyHolder.cpp b/examples/dbcrypt/CryptKeyHolder.cpp index 28ec5b0b95..a241470b15 100644 --- a/examples/dbcrypt/CryptKeyHolder.cpp +++ b/examples/dbcrypt/CryptKeyHolder.cpp @@ -145,7 +145,7 @@ private: class CallbackInterface : public ICryptKeyCallback { public: - CallbackInterface(CryptKeyHolder* p) + explicit CallbackInterface(CryptKeyHolder* p) : parent(p) { } diff --git a/src/burp/burp.h b/src/burp/burp.h index 4ebfe8084b..499af92395 100644 --- a/src/burp/burp.h +++ b/src/burp/burp.h @@ -868,7 +868,7 @@ const unsigned int MIN_SPLIT_SIZE = 2048; // bytes class BurpGlobals : public ThreadData { public: - BurpGlobals(Firebird::UtilSvc* us) + explicit BurpGlobals(Firebird::UtilSvc* us) : ThreadData(ThreadData::tddGBL), defaultCollations(*getDefaultMemoryPool()), uSvc(us), diff --git a/src/common/classes/alloc.h b/src/common/classes/alloc.h index 247dd45083..6f7ba8b8f2 100644 --- a/src/common/classes/alloc.h +++ b/src/common/classes/alloc.h @@ -491,7 +491,7 @@ inline void* operator new[](size_t s, Firebird::MemoryPool& pool) throw (OOM_EXC #endif #ifndef USE_SYSTEM_NEW -// We must define placement operators NEW & DELETE ourself +// We must define placement operators NEW & DELETE ourselves inline void* operator new(size_t s, void* place) throw () { return place; diff --git a/src/common/cvt.cpp b/src/common/cvt.cpp index e3dc7a264f..9148e75aac 100644 --- a/src/common/cvt.cpp +++ b/src/common/cvt.cpp @@ -124,7 +124,7 @@ using namespace Firebird; #define CVT_COPY_BUFF(from, to, len) \ {if (len) {memcpy(to, from, len); from += len; to += len;} } -// AP,2012: Look like there is no need making len zero, but I keep old define for a reference. +// AP,2012: Looks like there is no need making len zero, but I keep old define for a reference. // {if (len) {memcpy(to, from, len); from += len; to += len; len = 0;} } enum EXPECT_DATETIME diff --git a/src/common/db_alias.cpp b/src/common/db_alias.cpp index d16b421bd6..0c1034e892 100644 --- a/src/common/db_alias.cpp +++ b/src/common/db_alias.cpp @@ -264,7 +264,8 @@ namespace // Checks that argument doesn't contain colon or directory separator static inline bool hasSeparator(const PathName& name) { - for (const char* p = name.c_str(); *p; p++) { + for (const char* p = name.c_str(); *p; p++) + { if (*p == ':' || *p == '/' || *p == '\\') return true; } diff --git a/src/dsql/ExprNodes.cpp b/src/dsql/ExprNodes.cpp index 1f1259949d..be70e6cf04 100644 --- a/src/dsql/ExprNodes.cpp +++ b/src/dsql/ExprNodes.cpp @@ -11123,9 +11123,8 @@ DmlNode* ValueIfNode::parse(thread_db* tdbb, MemoryPool& pool, CompilerScratch* decodeNode->conditions->add(cmp->arg2); decodeNode->values->add(node->trueValue); - ValueExprNode* last; - - while ((node = (last = node->falseValue)->as())) + ValueExprNode* last = node->falseValue; + while ((node = last->as())) { ComparativeBoolNode* cmp = node->condition->as(); if (!cmp || cmp->blrOp != blr_eql) @@ -11138,6 +11137,8 @@ DmlNode* ValueIfNode::parse(thread_db* tdbb, MemoryPool& pool, CompilerScratch* decodeNode->conditions->add(cmp->arg2); decodeNode->values->add(node->trueValue); + + last = node->falseValue; } decodeNode->values->add(last); diff --git a/src/include/firebird/Crypt.h b/src/include/firebird/Crypt.h index b85faade9c..c302461449 100644 --- a/src/include/firebird/Crypt.h +++ b/src/include/firebird/Crypt.h @@ -48,7 +48,7 @@ public: // Part 2. Database crypt. -// This interface is used to transfer some data (related with crypt keys) +// This interface is used to transfer some data (related to crypt keys) // between different components of firebird. class ICryptKeyCallback : public IVersioned { diff --git a/src/jrd/CryptoManager.h b/src/jrd/CryptoManager.h index 091790ad77..b38e560116 100644 --- a/src/jrd/CryptoManager.h +++ b/src/jrd/CryptoManager.h @@ -64,7 +64,7 @@ class Lock; class CryptoManager : public Firebird::PermanentStorage { public: - CryptoManager(thread_db* tdbb); + explicit CryptoManager(thread_db* tdbb); ~CryptoManager(); void shutdown(thread_db* tdbb); @@ -100,7 +100,7 @@ private: class HolderAttachments { public: - HolderAttachments(Firebird::MemoryPool& p); + explicit HolderAttachments(Firebird::MemoryPool& p); ~HolderAttachments(); void registerAttachment(Attachment* att); @@ -122,7 +122,7 @@ private: class KeyHolderPlugins { public: - KeyHolderPlugins(Firebird::MemoryPool& p) + explicit KeyHolderPlugins(Firebird::MemoryPool& p) : knownHolders(p) { } diff --git a/src/jrd/trace/TraceJrdHelpers.h b/src/jrd/trace/TraceJrdHelpers.h index e91045a070..3b44518f91 100644 --- a/src/jrd/trace/TraceJrdHelpers.h +++ b/src/jrd/trace/TraceJrdHelpers.h @@ -416,7 +416,7 @@ class TraceSweepEvent { // implementation is at tra.cpp public: - TraceSweepEvent(thread_db* tdbb); + explicit TraceSweepEvent(thread_db* tdbb); ~TraceSweepEvent(); diff --git a/src/lock/print.cpp b/src/lock/print.cpp index 3b8e669ddc..904ad1994e 100644 --- a/src/lock/print.cpp +++ b/src/lock/print.cpp @@ -1274,20 +1274,22 @@ static void prt_owner(OUTFILE outfile, FPRINTF(outfile, "\n"); - if (sw_requests && !sw_pending) + if (sw_requests) { - const srq* que_inst; - SRQ_LOOP(owner->own_requests, que_inst) - prt_request(outfile, LOCK_header, - (lrq*) ((UCHAR*) que_inst - OFFSET(lrq*, lrq_own_requests))); - } - - if (sw_requests && sw_pending) - { - const srq* que_inst; - SRQ_LOOP(owner->own_pending, que_inst) - prt_request(outfile, LOCK_header, - (lrq*) ((UCHAR*) que_inst - OFFSET(lrq*, lrq_own_pending))); + if (sw_pending) + { + const srq* que_inst; + SRQ_LOOP(owner->own_pending, que_inst) + prt_request(outfile, LOCK_header, + (lrq*) ((UCHAR*) que_inst - OFFSET(lrq*, lrq_own_pending))); + } + else + { + const srq* que_inst; + SRQ_LOOP(owner->own_requests, que_inst) + prt_request(outfile, LOCK_header, + (lrq*) ((UCHAR*) que_inst - OFFSET(lrq*, lrq_own_requests))); + } } } @@ -1295,7 +1297,7 @@ static void prt_owner(OUTFILE outfile, static void prt_owner_wait_cycle(OUTFILE outfile, const lhb* LOCK_header, const own* owner, - USHORT indent, waitque *waiters) + USHORT indent, waitque* waiters) { /************************************** * diff --git a/src/msgs/facilities2.sql b/src/msgs/facilities2.sql index 20facfeb9c..64f2da246e 100644 --- a/src/msgs/facilities2.sql +++ b/src/msgs/facilities2.sql @@ -9,7 +9,7 @@ set bulk_insert INSERT INTO FACILITIES (LAST_CHANGE, FACILITY, FAC_CODE, MAX_NUM ('2012-01-13 11:20:16', 'DYN', 8, 285) ('1996-11-07 13:39:40', 'INSTALL', 10, 1) ('1996-11-07 13:38:41', 'TEST', 11, 4) -('2012-03-02 11:55:44', 'GBAK', 12, 352) +('2012-06-23 05:40:21', 'GBAK', 12, 352) ('2012-02-18 20:00:00', 'SQLERR', 13, 1033) ('1996-11-07 13:38:42', 'SQLWARN', 14, 613) ('2006-09-10 03:04:31', 'JRD_BUGCHK', 15, 307) diff --git a/src/msgs/history2.sql b/src/msgs/history2.sql index 09cb3be023..99d97ded59 100644 --- a/src/msgs/history2.sql +++ b/src/msgs/history2.sql @@ -1258,6 +1258,7 @@ Fetches = !f', NULL, NULL, 'c_pg'); (1249, 'alexpeshkoff', '2009-11-13 17:49:54', 18, 27, '------------------------------------------------------------------------------------------', NULL, NULL, 'c_pg') (1250, 'cvc', '2009-12-18 09:21:40', 12, 68, ' committing metadata', NULL, NULL, 'c_pg') (1251, 'cvc', '2009-12-18 08:21:50', 12, 196, 'restoring parameter @1 for stored procedure', NULL, NULL, 'c_pg') +(1252, 'alexpeshkoff', '2012-06-23 05:40:21', 12, 266, 'standard output is not supported when using split operation', NULL, NULL, 'c_pg') stop COMMIT WORK; diff --git a/src/remote/server/server.cpp b/src/remote/server/server.cpp index c787058b31..11c2d7ac08 100644 --- a/src/remote/server/server.cpp +++ b/src/remote/server/server.cpp @@ -747,7 +747,7 @@ InitInstance knownCryptKeyTypes; class CryptKeyCallback : public VersionedIface { public: - CryptKeyCallback(rem_port* prt) + explicit CryptKeyCallback(rem_port* prt) : port(prt), l(0), d(NULL) { } @@ -792,7 +792,7 @@ private: class ServerCallback : public ServerCallbackBase, public GlobalStorage { public: - ServerCallback(rem_port* prt) + explicit ServerCallback(rem_port* prt) : cryptCallback(prt) { }