4040using namespace Jrd ;
4141using namespace Firebird ;
4242
43- const SSHORT SHUT_WAIT_TIME = 5 ;
43+ constexpr SSHORT SHUT_WAIT_TIME = 5 ;
4444
4545// Shutdown lock data
4646union shutdown_data
@@ -55,20 +55,20 @@ union shutdown_data
5555// Low byte of shutdown_data::flag used by shutdown modes, see isc_dpb_shut_XXX
5656// High byte used for additional flags
5757
58- const SSHORT SHUT_flag_restoring = 0x0100 ; // database restore is in progress
58+ constexpr SSHORT SHUT_flag_restoring = 0x0100 ; // database restore is in progress
5959
6060// Define this to true if you need to allow no-op behavior when requested shutdown mode
6161// matches current. Logic of jrd8_create_database may need attention in this case too
62- const bool IGNORE_SAME_MODE = false ;
62+ constexpr bool IGNORE_SAME_MODE = false ;
6363
64- static void bad_mode (Database* dbb)
64+ [[noreturn]] static void bad_mode (const Database* dbb)
6565{
6666 ERR_post (Arg::Gds (isc_bad_shutdown_mode) << Arg::Str (dbb->dbb_database_name ));
6767}
6868
69- static void same_mode (Database* dbb)
69+ static void same_mode (const Database* dbb)
7070{
71- if (!IGNORE_SAME_MODE)
71+ if constexpr (!IGNORE_SAME_MODE)
7272 bad_mode (dbb);
7373}
7474
@@ -344,8 +344,8 @@ void SHUT_online(thread_db* tdbb, SSHORT flag, Sync* guard)
344344 *
345345 **************************************/
346346 SET_TDBB (tdbb);
347- Database* const dbb = tdbb->getDatabase ();
348- Jrd::Attachment* const attachment = tdbb->getAttachment ();
347+ const Database* const dbb = tdbb->getDatabase ();
348+ const Jrd::Attachment* const attachment = tdbb->getAttachment ();
349349
350350 // Only platform's user locksmith can shutdown or bring online a database
351351
@@ -447,7 +447,7 @@ void SHUT_online(thread_db* tdbb, SSHORT flag, Sync* guard)
447447
448448static void check_backup_state (thread_db* tdbb)
449449{
450- const auto dbb = tdbb->getDatabase ();
450+ const auto * dbb = tdbb->getDatabase ();
451451
452452 BackupManager::StateReadGuard stateGuard (tdbb);
453453
0 commit comments