@@ -85,11 +85,11 @@ class FileExtendLockGuard
8585 }
8686 }
8787
88- private:
8988 // copying is prohibited
90- FileExtendLockGuard (const FileExtendLockGuard&);
91- FileExtendLockGuard& operator =(const FileExtendLockGuard&);
89+ FileExtendLockGuard (const FileExtendLockGuard&) = delete ;
90+ FileExtendLockGuard& operator =(const FileExtendLockGuard&) = delete ;
9291
92+ private:
9393 Firebird::RWLock* const m_lock;
9494 const bool m_exclusive;
9595};
@@ -106,19 +106,18 @@ using namespace Firebird;
106106#define TEXT SCHAR
107107
108108static bool maybeCloseFile (HANDLE&);
109- static bool seek_file (jrd_file*, BufferDesc*, OVERLAPPED*);
109+ static bool seek_file (jrd_file*, const BufferDesc*, OVERLAPPED*);
110110static jrd_file* setup_file (Database*, const Firebird::PathName&, HANDLE, USHORT);
111111static bool nt_error (const TEXT*, const jrd_file*, ISC_STATUS, FbStatusVector* const );
112112
113- inline static DWORD getShareFlags (const bool shared_access, bool temporary = false )
113+ inline static DWORD getShareFlags (const bool shared_access, bool temporary = false ) noexcept
114114{
115115 return FILE_SHARE_READ | ((!temporary && shared_access) ? FILE_SHARE_WRITE : 0 );
116116}
117117
118- static const DWORD g_dwExtraFlags = FILE_FLAG_OVERLAPPED;
118+ static constexpr DWORD g_dwExtraFlags = FILE_FLAG_OVERLAPPED;
119119
120- static const DWORD g_dwExtraTempFlags = FILE_ATTRIBUTE_TEMPORARY |
121- FILE_FLAG_DELETE_ON_CLOSE;
120+ static constexpr DWORD g_dwExtraTempFlags = FILE_ATTRIBUTE_TEMPORARY | FILE_FLAG_DELETE_ON_CLOSE;
122121
123122
124123void PIO_close (jrd_file* file)
@@ -345,7 +344,7 @@ bool PIO_header(thread_db* tdbb, UCHAR* address, unsigned length)
345344 * callers should not rely on this behavior
346345 *
347346 **************************************/
348- const auto dbb = tdbb->getDatabase ();
347+ const auto * dbb = tdbb->getDatabase ();
349348
350349 PageSpace* const pageSpace = dbb->dbb_page_manager .findPageSpace (DB_PAGE_SPACE);
351350 jrd_file* const file = pageSpace->file ;
@@ -507,7 +506,7 @@ jrd_file* PIO_open(thread_db* tdbb,
507506 // being opened ReadOnly. This flag will be used later to compare with
508507 // the Header Page flag setting to make sure that the database is set ReadOnly.
509508 readOnly = true ;
510- PageSpace* pageSpace = dbb->dbb_page_manager .findPageSpace (DB_PAGE_SPACE);
509+ const PageSpace* pageSpace = dbb->dbb_page_manager .findPageSpace (DB_PAGE_SPACE);
511510 if (!pageSpace->file )
512511 dbb->dbb_flags |= DBB_being_opened_read_only;
513512 }
@@ -537,7 +536,7 @@ bool PIO_read(thread_db* tdbb, jrd_file* file, BufferDesc* bdb, Ods::pag* page,
537536 * Read a data page.
538537 *
539538 **************************************/
540- Database* const dbb = tdbb->getDatabase ();
539+ const Database* const dbb = tdbb->getDatabase ();
541540
542541 const DWORD size = dbb->dbb_page_size ;
543542
@@ -696,8 +695,7 @@ bool PIO_write(thread_db* tdbb, jrd_file* file, BufferDesc* bdb, Ods::pag* page,
696695 * Write a data page.
697696 *
698697 **************************************/
699-
700- Database* const dbb = tdbb->getDatabase ();
698+ const Database* const dbb = tdbb->getDatabase ();
701699
702700 const DWORD size = dbb->dbb_page_size ;
703701
@@ -750,7 +748,7 @@ ULONG PIO_get_number_of_pages(const jrd_file* file, const USHORT pagesize)
750748}
751749
752750
753- static bool seek_file (jrd_file* file, BufferDesc* bdb, OVERLAPPED* overlapped)
751+ static bool seek_file (jrd_file* file, const BufferDesc* bdb, OVERLAPPED* overlapped)
754752{
755753/* *************************************
756754 *
@@ -762,7 +760,7 @@ static bool seek_file(jrd_file* file, BufferDesc* bdb, OVERLAPPED* overlapped)
762760 * Given a buffer descriptor block, seek to the proper page in that file.
763761 *
764762 **************************************/
765- BufferControl* const bcb = bdb->bdb_bcb ;
763+ const BufferControl* const bcb = bdb->bdb_bcb ;
766764 const ULONG page = bdb->bdb_page .getPageNum ();
767765
768766 LARGE_INTEGER liOffset;
@@ -773,7 +771,7 @@ static bool seek_file(jrd_file* file, BufferDesc* bdb, OVERLAPPED* overlapped)
773771 overlapped->Internal = 0 ;
774772 overlapped->InternalHigh = 0 ;
775773
776- ThreadSync* thd = ThreadSync::getThread (FB_FUNCTION);
774+ const ThreadSync* thd = ThreadSync::getThread (FB_FUNCTION);
777775 overlapped->hEvent = thd->getIOEvent ();
778776
779777 return true ;
@@ -803,7 +801,7 @@ static jrd_file* setup_file(Database* dbb, const Firebird::PathName& file_name,
803801
804802 // If this isn't the primary file, we're done
805803
806- const auto pageSpace = dbb->dbb_page_manager .findPageSpace (DB_PAGE_SPACE);
804+ const auto * pageSpace = dbb->dbb_page_manager .findPageSpace (DB_PAGE_SPACE);
807805 if (pageSpace && pageSpace->file )
808806 return file;
809807
0 commit comments