From dfd10062f67cd18d50055a2c06219d131fdcf750 Mon Sep 17 00:00:00 2001 From: robocop Date: Sat, 29 Mar 2008 11:20:37 +0000 Subject: [PATCH] Style. --- src/jrd/GlobalRWLock.cpp | 2 +- src/jrd/GlobalRWLock.h | 4 ++-- src/jrd/cch.cpp | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/jrd/GlobalRWLock.cpp b/src/jrd/GlobalRWLock.cpp index bed56fc266..3a22215794 100644 --- a/src/jrd/GlobalRWLock.cpp +++ b/src/jrd/GlobalRWLock.cpp @@ -132,7 +132,7 @@ bool GlobalRWLock::lock(thread_db* tdbb, locklevel_t level, SSHORT wait, SLONG o } } - bool all_compatible = !writer.entry_count && (level == LCK_read || readers.getCount() == 0); + const bool all_compatible = !writer.entry_count && (level == LCK_read || readers.getCount() == 0); // We own the lock and all present requests are compatible with us // In case of any congestion we force all requests through the lock diff --git a/src/jrd/GlobalRWLock.h b/src/jrd/GlobalRWLock.h index ad524fea0e..15cdbd9322 100644 --- a/src/jrd/GlobalRWLock.h +++ b/src/jrd/GlobalRWLock.h @@ -114,7 +114,7 @@ public: // Change the lock owner. The function doesn't wait. void changeLockOwner(thread_db* tdbb, locklevel_t level, SLONG old_owner_handle, SLONG new_owner_handle); - SLONG getLockData() { + SLONG getLockData() const { return cached_lock->lck_data; } void setLockData(SLONG lck_data); @@ -160,7 +160,7 @@ private: class CountersLockHolder : public AstInhibit, public Firebird::MutexLockGuard { public: - CountersLockHolder(Firebird::Mutex& mtx) + explicit CountersLockHolder(Firebird::Mutex& mtx) : AstInhibit(), MutexLockGuard(mtx) { } }; diff --git a/src/jrd/cch.cpp b/src/jrd/cch.cpp index 4bbf0185ad..d2642eca4d 100644 --- a/src/jrd/cch.cpp +++ b/src/jrd/cch.cpp @@ -1800,7 +1800,7 @@ void CCH_mark(thread_db* tdbb, WIN * window, USHORT mark_system, USHORT must_wri bdb->bdb_flags |= BDB_db_dirty; #endif - bool was_dirty = bdb->bdb_flags & BDB_dirty; + const bool was_dirty = bdb->bdb_flags & BDB_dirty; bdb->bdb_flags |= (BDB_dirty | BDB_marked); if (must_write || dbb->dbb_backup_manager->database_flush_in_progress()) @@ -1809,7 +1809,7 @@ void CCH_mark(thread_db* tdbb, WIN * window, USHORT mark_system, USHORT must_wri if (!was_marked) { if (was_dirty) { // Mark can be called many times without release - // Backup lock owner can ba database or attachment + // Backup lock owner can be database or attachment fb_assert(bdb->bdb_backup_lock_owner == BackupManager::database_lock_handle(tdbb)); dbb->dbb_backup_manager->release_dirty_page(tdbb, bdb->bdb_backup_lock_owner); } @@ -6243,7 +6243,7 @@ static bool write_page( /* write out page to main database file, and to any shadows, making a special case of the header page */ - int backup_state = dbb->dbb_backup_manager->get_state(); + const int backup_state = dbb->dbb_backup_manager->get_state(); if (bdb->bdb_page >= 0) { fb_assert(backup_state != nbak_state_unknown);