|
From: <ro...@us...> - 2011-06-24 06:34:23
|
Revision: 53218
http://firebird.svn.sourceforge.net/firebird/?rev=53218&view=rev
Author: robocop
Date: 2011-06-24 06:34:16 +0000 (Fri, 24 Jun 2011)
Log Message:
-----------
Misc.
Modified Paths:
--------------
firebird/trunk/examples/udr/UdrCppExample.cpp
firebird/trunk/src/common/IntlUtil.h
firebird/trunk/src/common/classes/ImplementHelper.h
firebird/trunk/src/common/classes/SyncObject.cpp
firebird/trunk/src/common/classes/SyncObject.h
firebird/trunk/src/common/classes/Synchronize.cpp
firebird/trunk/src/common/classes/Synchronize.h
firebird/trunk/src/jrd/Attachment.h
firebird/trunk/src/jrd/DatabaseSnapshot.cpp
firebird/trunk/src/jrd/EngineInterface.h
firebird/trunk/src/jrd/ExtEngineManager.cpp
firebird/trunk/src/jrd/ExtEngineManager.h
firebird/trunk/src/jrd/GarbageCollector.cpp
firebird/trunk/src/jrd/cch.cpp
firebird/trunk/src/jrd/cch.h
firebird/trunk/src/jrd/flu.h
firebird/trunk/src/jrd/intl.cpp
firebird/trunk/src/jrd/jrd.cpp
firebird/trunk/src/jrd/lck.cpp
firebird/trunk/src/jrd/tpc.cpp
firebird/trunk/src/jrd/tpc_proto.h
firebird/trunk/src/jrd/vio.cpp
firebird/trunk/src/remote/client/interface.cpp
firebird/trunk/src/yvalve/DistributedTransaction.cpp
firebird/trunk/src/yvalve/PluginManager.cpp
firebird/trunk/src/yvalve/YObjects.h
Modified: firebird/trunk/examples/udr/UdrCppExample.cpp
===================================================================
--- firebird/trunk/examples/udr/UdrCppExample.cpp 2011-06-23 14:54:42 UTC (rev 53217)
+++ firebird/trunk/examples/udr/UdrCppExample.cpp 2011-06-24 06:34:16 UTC (rev 53218)
@@ -716,8 +716,8 @@
outMessage.setNull(retDesc, true);
return;
}
- else
- ret += inMessage[numDesc];
+
+ ret += inMessage[numDesc];
}
outMessage[retDesc] = ret;
Modified: firebird/trunk/src/common/IntlUtil.h
===================================================================
--- firebird/trunk/src/common/IntlUtil.h 2011-06-23 14:54:42 UTC (rev 53217)
+++ firebird/trunk/src/common/IntlUtil.h 2011-06-24 06:34:16 UTC (rev 53218)
@@ -105,7 +105,7 @@
class Utf8CharSet
{
public:
- Utf8CharSet(MemoryPool& pool);
+ explicit Utf8CharSet(MemoryPool& pool);
public:
charset obj;
Modified: firebird/trunk/src/common/classes/ImplementHelper.h
===================================================================
--- firebird/trunk/src/common/classes/ImplementHelper.h 2011-06-23 14:54:42 UTC (rev 53217)
+++ firebird/trunk/src/common/classes/ImplementHelper.h 2011-06-24 06:34:16 UTC (rev 53218)
@@ -171,7 +171,7 @@
class AccessAutoInterface
{
public:
- AccessAutoInterface(C* aPtr)
+ explicit AccessAutoInterface(C* aPtr)
: ptr(aPtr)
{ }
@@ -206,7 +206,7 @@
PluginManagerInterfacePtr()
: AccessAutoInterface<IPluginManager>(MasterInterfacePtr()->getPluginManager())
{ }
- PluginManagerInterfacePtr(IMaster* master)
+ explicit PluginManagerInterfacePtr(IMaster* master)
: AccessAutoInterface<IPluginManager>(master->getPluginManager())
{ }
};
Modified: firebird/trunk/src/common/classes/SyncObject.cpp
===================================================================
--- firebird/trunk/src/common/classes/SyncObject.cpp 2011-06-23 14:54:42 UTC (rev 53217)
+++ firebird/trunk/src/common/classes/SyncObject.cpp 2011-06-24 06:34:16 UTC (rev 53218)
@@ -153,7 +153,6 @@
}
}
- return false;
}
else
{
@@ -180,8 +179,9 @@
}
}
- return false;
}
+
+ return false;
}
void SyncObject::unlock(Sync* sync, SyncType type)
@@ -366,7 +366,7 @@
}
}
-void SyncObject::validate(SyncType lockType)
+void SyncObject::validate(SyncType lockType) const
{
switch (lockType)
{
Modified: firebird/trunk/src/common/classes/SyncObject.h
===================================================================
--- firebird/trunk/src/common/classes/SyncObject.h 2011-06-23 14:54:42 UTC (rev 53217)
+++ firebird/trunk/src/common/classes/SyncObject.h 2011-06-24 06:34:16 UTC (rev 53218)
@@ -99,7 +99,7 @@
void wait(SyncType type, ThreadSync* thread, Sync* sync);
ThreadSync* grantThread(ThreadSync* thread);
void grantLocks();
- void validate(SyncType lockType);
+ void validate(SyncType lockType) const;
AtomicCounter lockState;
AtomicCounter waiters;
@@ -207,7 +207,7 @@
class SyncUnlockGuard
{
public:
- SyncUnlockGuard(Sync& aSync) :
+ explicit SyncUnlockGuard(Sync& aSync) :
sync(aSync)
{
oldState = sync.getState();
Modified: firebird/trunk/src/common/classes/Synchronize.cpp
===================================================================
--- firebird/trunk/src/common/classes/Synchronize.cpp 2011-06-23 14:54:42 UTC (rev 53217)
+++ firebird/trunk/src/common/classes/Synchronize.cpp 2011-06-24 06:34:16 UTC (rev 53218)
@@ -239,7 +239,7 @@
}
-const char* ThreadSync::getWhere()
+const char* ThreadSync::getWhere() const
{
if (lockPending && lockPending->where)
return lockPending->where;
Modified: firebird/trunk/src/common/classes/Synchronize.h
===================================================================
--- firebird/trunk/src/common/classes/Synchronize.h 2011-06-23 14:54:42 UTC (rev 53217)
+++ firebird/trunk/src/common/classes/Synchronize.h 2011-06-24 06:34:16 UTC (rev 53218)
@@ -76,14 +76,14 @@
friend class SyncObject;
public:
- ThreadSync(const char* desc);
+ explicit ThreadSync(const char* desc);
virtual ~ThreadSync();
static ThreadSync* findThread();
static ThreadSync* getThread(const char* desc);
static FB_THREAD_ID getCurrentThreadId();
- const char* getWhere();
+ const char* getWhere() const;
static void validateLocks();
Modified: firebird/trunk/src/jrd/Attachment.h
===================================================================
--- firebird/trunk/src/jrd/Attachment.h 2011-06-23 14:54:42 UTC (rev 53217)
+++ firebird/trunk/src/jrd/Attachment.h 2011-06-24 06:34:16 UTC (rev 53218)
@@ -132,7 +132,7 @@
class SyncGuard
{
public:
- SyncGuard(Attachment* att, bool optional = false)
+ explicit SyncGuard(Attachment* att, bool optional = false)
: m_mutex(NULL)
{
if (att && att->att_interface)
@@ -161,7 +161,7 @@
class Checkout
{
public:
- Checkout(Attachment* att, bool optional = false)
+ explicit Checkout(Attachment* att, bool optional = false)
: m_mutex(NULL)
{
if (att && att->att_interface)
Modified: firebird/trunk/src/jrd/DatabaseSnapshot.cpp
===================================================================
--- firebird/trunk/src/jrd/DatabaseSnapshot.cpp 2011-06-23 14:54:42 UTC (rev 53217)
+++ firebird/trunk/src/jrd/DatabaseSnapshot.cpp 2011-06-24 06:34:16 UTC (rev 53218)
@@ -773,7 +773,7 @@
// Attachment information
- Attachment* old_attachment = tdbb->getAttachment();
+ Attachment* const old_attachment = tdbb->getAttachment();
try
{
Attachment::Checkout attCout(old_attachment, true);
Modified: firebird/trunk/src/jrd/EngineInterface.h
===================================================================
--- firebird/trunk/src/jrd/EngineInterface.h 2011-06-23 14:54:42 UTC (rev 53217)
+++ firebird/trunk/src/jrd/EngineInterface.h 2011-06-24 06:34:16 UTC (rev 53218)
@@ -299,7 +299,7 @@
virtual void FB_CARG drop(Firebird::IStatus* status);
public:
- JAttachment(Attachment* handle);
+ explicit JAttachment(Attachment* handle);
Attachment* getHandle()
{
@@ -338,7 +338,7 @@
class SysAttachment : public JAttachment
{
public:
- SysAttachment(Attachment* handle)
+ explicit SysAttachment(Attachment* handle)
: JAttachment(handle)
{
}
@@ -376,7 +376,7 @@
unsigned int spbLength, const unsigned char* spb);
public:
- JService(Service* handle);
+ explicit JService(Service* handle);
private:
Service* svc;
Modified: firebird/trunk/src/jrd/ExtEngineManager.cpp
===================================================================
--- firebird/trunk/src/jrd/ExtEngineManager.cpp 2011-06-23 14:54:42 UTC (rev 53217)
+++ firebird/trunk/src/jrd/ExtEngineManager.cpp 2011-06-24 06:34:16 UTC (rev 53218)
@@ -466,7 +466,7 @@
if (align)
pos = FB_ALIGN(pos, align);
- unsigned dataPos = pos;
+ const unsigned dataPos = pos;
pos += desc.dsc_length;
align = type_alignments[dtype_short];
@@ -506,7 +506,8 @@
dsc desc;
EVL_field(rpb->rpb_relation, record, i, &desc);
-
+ // CVC: I'm not sure why it's not important to check EVL_field's result.
+
unsigned align = type_alignments[desc.dsc_dtype];
if (align)
msgBuffer.resize(FB_ALIGN(msgBuffer.getCount(), align));
Modified: firebird/trunk/src/jrd/ExtEngineManager.h
===================================================================
--- firebird/trunk/src/jrd/ExtEngineManager.h 2011-06-23 14:54:42 UTC (rev 53217)
+++ firebird/trunk/src/jrd/ExtEngineManager.h 2011-06-24 06:34:16 UTC (rev 53218)
@@ -64,7 +64,7 @@
public Firebird::PermanentStorage
{
public:
- RoutineMetadata(MemoryPool& pool)
+ explicit RoutineMetadata(MemoryPool& pool)
: PermanentStorage(pool),
package(pool),
name(pool),
Modified: firebird/trunk/src/jrd/GarbageCollector.cpp
===================================================================
--- firebird/trunk/src/jrd/GarbageCollector.cpp 2011-06-23 14:54:42 UTC (rev 53217)
+++ firebird/trunk/src/jrd/GarbageCollector.cpp 2011-06-24 06:34:16 UTC (rev 53218)
@@ -55,7 +55,7 @@
// search for given page at other transactions bitmaps
// if found at older tx - we are done, just return
- // if found at yanger tx - clear it as page should be set at oldest tx (our)
+ // if found at younger tx - clear it as page should be set at oldest tx (our)
TranData::ConstAccessor accessor(&m_tranData);
if (accessor.getFirst())
{
@@ -75,16 +75,10 @@
} while(accessor.getNext());
}
- // add page to the our tx bitmap
- if (bm)
- {
- PBM_SET(&m_pool, &bm, pageno);
- }
- else
- {
- PBM_SET(&m_pool, &bm, pageno);
+ // add page to our tx bitmap
+ PBM_SET(&m_pool, &bm, pageno);
+ if (!bm)
m_tranData.put(tranid, bm);
- }
}
@@ -136,8 +130,8 @@
TranData::ConstAccessor accessor(&m_tranData);
if (accessor.getFirst())
return accessor.current()->first;
- else
- return MAX_TRA_NUMBER;
+
+ return MAX_TRA_NUMBER;
}
Modified: firebird/trunk/src/jrd/cch.cpp
===================================================================
--- firebird/trunk/src/jrd/cch.cpp 2011-06-23 14:54:42 UTC (rev 53217)
+++ firebird/trunk/src/jrd/cch.cpp 2011-06-24 06:34:16 UTC (rev 53218)
@@ -984,7 +984,7 @@
SET_TDBB(tdbb);
Database* dbb = tdbb->getDatabase();
BufferControl* bcb = dbb->dbb_bcb;
- if (!dbb->dbb_bcb)
+ if (!bcb)
return;
bool flush_error = false;
@@ -3572,7 +3572,7 @@
const bcb_repeat* const old_end = bcb->bcb_rpt + bcb->bcb_count;
bcb_repeat* new_rpt = FB_NEW(*bcb->bcb_bufferpool) bcb_repeat[number];
- bcb_repeat* old_rpt = bcb->bcb_rpt;
+ bcb_repeat* const old_rpt = bcb->bcb_rpt;
bcb->bcb_rpt = new_rpt;
bcb->bcb_count = number;
@@ -3913,12 +3913,14 @@
if (oldest->bdb_use_count || !oldest->addRefConditional(tdbb, SYNC_EXCLUSIVE))
continue;
- if ((oldest->bdb_flags & BDB_free_pending) || !writeable(dbb, oldest)) {
+ if ((oldest->bdb_flags & BDB_free_pending) || !writeable(dbb, oldest))
+ {
oldest->release(tdbb);
continue;
}
- if (oldest->bdb_flags & BDB_lru_chained) {
+ if (oldest->bdb_flags & BDB_lru_chained)
+ {
oldest->release(tdbb);
continue;
}
@@ -5051,7 +5053,7 @@
if (!isTempPage &&
(backup_state == nbak_state_stalled ||
- (backup_state == nbak_state_merge && bdb->bdb_difference_page)))
+ (backup_state == nbak_state_merge && bdb->bdb_difference_page)))
{
const bool res = dbb->dbb_backup_manager->writeDifference(status,
Modified: firebird/trunk/src/jrd/cch.h
===================================================================
--- firebird/trunk/src/jrd/cch.h 2011-06-23 14:54:42 UTC (rev 53217)
+++ firebird/trunk/src/jrd/cch.h 2011-06-24 06:34:16 UTC (rev 53218)
@@ -177,7 +177,7 @@
class BufferDesc : public pool_alloc<type_bdb>
{
public:
- BufferDesc(BufferControl* bcb)
+ explicit BufferDesc(BufferControl* bcb)
: bdb_bcb(bcb),
bdb_page(0, 0),
bdb_pending_page(0, 0)
Modified: firebird/trunk/src/jrd/flu.h
===================================================================
--- firebird/trunk/src/jrd/flu.h 2011-06-23 14:54:42 UTC (rev 53217)
+++ firebird/trunk/src/jrd/flu.h 2011-06-24 06:34:16 UTC (rev 53218)
@@ -77,7 +77,7 @@
Firebird::RefPtr<InternalModule> interMod;
- Module(InternalModule* h)
+ explicit Module(InternalModule* h)
: interMod(h)
{ }
Modified: firebird/trunk/src/jrd/intl.cpp
===================================================================
--- firebird/trunk/src/jrd/intl.cpp 2011-06-23 14:54:42 UTC (rev 53217)
+++ firebird/trunk/src/jrd/intl.cpp 2011-06-24 06:34:16 UTC (rev 53218)
@@ -349,7 +349,7 @@
}
Jrd::Attachment* att = tdbb->getAttachment();
- Jrd::Attachment::CheckoutLockGuard guard(att, createCollationMtx); // are we need it ?
+ Jrd::Attachment::CheckoutLockGuard guard(att, createCollationMtx); // do we need it ?
Collation* to_delete = NULL;
Modified: firebird/trunk/src/jrd/jrd.cpp
===================================================================
--- firebird/trunk/src/jrd/jrd.cpp 2011-06-23 14:54:42 UTC (rev 53217)
+++ firebird/trunk/src/jrd/jrd.cpp 2011-06-24 06:34:16 UTC (rev 53218)
@@ -471,7 +471,7 @@
class DatabaseContextHolder : public Jrd::ContextPoolHolder
{
public:
- DatabaseContextHolder(thread_db* tdbb)
+ explicit DatabaseContextHolder(thread_db* tdbb)
: Jrd::ContextPoolHolder(tdbb, tdbb->getDatabase()->dbb_permanent),
savedTdbb(tdbb)
{
@@ -7281,6 +7281,9 @@
try
{
+ if (tpb_length > 0 && tpb == NULL)
+ status_exception::raise(Arg::Gds(isc_bad_tpb_form));
+
jrd_tra* transaction = TRA_start(tdbb, tpb_length, tpb);
transaction->tra_sibling = NULL;
Modified: firebird/trunk/src/jrd/lck.cpp
===================================================================
--- firebird/trunk/src/jrd/lck.cpp 2011-06-23 14:54:42 UTC (rev 53217)
+++ firebird/trunk/src/jrd/lck.cpp 2011-06-24 06:34:16 UTC (rev 53218)
@@ -108,8 +108,8 @@
{
if (tdbb->getDatabase()->dbb_config->getSharedCache())
return (LOCK_OWNER_T) getpid() << 32 | tdbb->getAttachment()->att_lock_owner_id;
- else
- return (LOCK_OWNER_T) getpid() << 32 | tdbb->getDatabase()->dbb_lock_owner_id;
+
+ return (LOCK_OWNER_T) getpid() << 32 | tdbb->getDatabase()->dbb_lock_owner_id;
}
inline SLONG* LCK_OWNER_HANDLE_DBB(thread_db* tdbb)
@@ -121,8 +121,8 @@
{
if (tdbb->getDatabase()->dbb_config->getSharedCache())
return &tdbb->getAttachment()->att_lock_owner_handle;
- else
- return &tdbb->getDatabase()->dbb_lock_owner_handle;
+
+ return &tdbb->getDatabase()->dbb_lock_owner_handle;
}
Modified: firebird/trunk/src/jrd/tpc.cpp
===================================================================
--- firebird/trunk/src/jrd/tpc.cpp 2011-06-23 14:54:42 UTC (rev 53217)
+++ firebird/trunk/src/jrd/tpc.cpp 2011-06-24 06:34:16 UTC (rev 53218)
@@ -406,7 +406,7 @@
#endif
// hvlad: No need to cache TIP pages below hdr_oldest just refreshed from
- // header page. Moreover out tip cache can now contain an gap between last
+ // header page. Moreover out tip cache can now contain a gap between the last
// cached tip page and new pages if our process was idle for long time
oldest = MAX(oldest, hdr_oldest);
Modified: firebird/trunk/src/jrd/tpc_proto.h
===================================================================
--- firebird/trunk/src/jrd/tpc_proto.h 2011-06-23 14:54:42 UTC (rev 53217)
+++ firebird/trunk/src/jrd/tpc_proto.h 2011-06-24 06:34:16 UTC (rev 53218)
@@ -39,7 +39,7 @@
class TipCache
{
public:
- TipCache(Database* dbb);
+ explicit TipCache(Database* dbb);
~TipCache();
int cacheState(thread_db*, SLONG number);
Modified: firebird/trunk/src/jrd/vio.cpp
===================================================================
--- firebird/trunk/src/jrd/vio.cpp 2011-06-23 14:54:42 UTC (rev 53217)
+++ firebird/trunk/src/jrd/vio.cpp 2011-06-24 06:34:16 UTC (rev 53218)
@@ -4273,7 +4273,8 @@
for (attachment = dbb->dbb_attachments; attachment; attachment = attachment->att_next)
{
- if (attachment->att_flags & ATT_notify_gc) {
+ if (attachment->att_flags & ATT_notify_gc)
+ {
attachment->att_flags &= ~ATT_notify_gc;
attachment->att_flags |= ATT_disable_notify_gc;
}
@@ -4290,7 +4291,8 @@
for (attachment = dbb->dbb_attachments; attachment; attachment = attachment->att_next)
{
- if (attachment->att_flags & ATT_disable_notify_gc) {
+ if (attachment->att_flags & ATT_disable_notify_gc)
+ {
attachment->att_flags &= ~ATT_disable_notify_gc;
attachment->att_flags |= ATT_notify_gc;
}
Modified: firebird/trunk/src/remote/client/interface.cpp
===================================================================
--- firebird/trunk/src/remote/client/interface.cpp 2011-06-23 14:54:42 UTC (rev 53217)
+++ firebird/trunk/src/remote/client/interface.cpp 2011-06-24 06:34:16 UTC (rev 53218)
@@ -147,7 +147,7 @@
virtual int FB_CARG seek(IStatus* status, int mode, int offset); // returns position
public:
- Blob(Rbl* handle)
+ explicit Blob(Rbl* handle)
: blob(handle)
{ }
Modified: firebird/trunk/src/yvalve/DistributedTransaction.cpp
===================================================================
--- firebird/trunk/src/yvalve/DistributedTransaction.cpp 2011-06-23 14:54:42 UTC (rev 53217)
+++ firebird/trunk/src/yvalve/DistributedTransaction.cpp 2011-06-24 06:34:16 UTC (rev 53218)
@@ -83,7 +83,7 @@
RWLock rwLock;
bool limbo;
- DTransaction(const SubArray& aSub)
+ explicit DTransaction(const SubArray& aSub)
: sub(getPool()), limbo(false)
{
sub.assign(aSub);
Modified: firebird/trunk/src/yvalve/PluginManager.cpp
===================================================================
--- firebird/trunk/src/yvalve/PluginManager.cpp 2011-06-23 14:54:42 UTC (rev 53217)
+++ firebird/trunk/src/yvalve/PluginManager.cpp 2011-06-24 06:34:16 UTC (rev 53218)
@@ -320,7 +320,7 @@
#endif
// This is called only by unregister module
// when current module is forced to go away by OS.
- // Do not unload it ourself in this case.
+ // Do not unload it ourselves in this case.
addRef();
}
else if (next)
@@ -900,7 +900,7 @@
// Module cleanup should be unregistered only if it's unloaded
// and only if it's unloaded not by PluginManager, but by OS.
// That means that task is closing unexpectedly - sooner of all
- // exit() is called by client of embedded server. Shutdown ourself.
+ // exit() is called by client of embedded server. Shutdown ourselves.
fb_shutdown(5000, fb_shutrsn_exit_called);
}
Modified: firebird/trunk/src/yvalve/YObjects.h
===================================================================
--- firebird/trunk/src/yvalve/YObjects.h 2011-06-23 14:54:42 UTC (rev 53217)
+++ firebird/trunk/src/yvalve/YObjects.h 2011-06-24 06:34:16 UTC (rev 53218)
@@ -117,7 +117,7 @@
class YHelper : public Firebird::StdPlugin<Intf, Vers>, public YObject
{
public:
- YHelper(Intf* aNext);
+ explicit YHelper(Intf* aNext);
int FB_CARG release()
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|