40
40
using namespace Jrd ;
41
41
using namespace Firebird ;
42
42
43
- const SSHORT SHUT_WAIT_TIME = 5 ;
43
+ constexpr SSHORT SHUT_WAIT_TIME = 5 ;
44
44
45
45
// Shutdown lock data
46
46
union shutdown_data
@@ -55,20 +55,20 @@ union shutdown_data
55
55
// Low byte of shutdown_data::flag used by shutdown modes, see isc_dpb_shut_XXX
56
56
// High byte used for additional flags
57
57
58
- const SSHORT SHUT_flag_restoring = 0x0100 ; // database restore is in progress
58
+ constexpr SSHORT SHUT_flag_restoring = 0x0100 ; // database restore is in progress
59
59
60
60
// Define this to true if you need to allow no-op behavior when requested shutdown mode
61
61
// 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 ;
63
63
64
- static void bad_mode (Database* dbb)
64
+ [[noreturn]] static void bad_mode (const Database* dbb)
65
65
{
66
66
ERR_post (Arg::Gds (isc_bad_shutdown_mode) << Arg::Str (dbb->dbb_database_name ));
67
67
}
68
68
69
- static void same_mode (Database* dbb)
69
+ static void same_mode (const Database* dbb)
70
70
{
71
- if (!IGNORE_SAME_MODE)
71
+ if constexpr (!IGNORE_SAME_MODE)
72
72
bad_mode (dbb);
73
73
}
74
74
@@ -344,8 +344,8 @@ void SHUT_online(thread_db* tdbb, SSHORT flag, Sync* guard)
344
344
*
345
345
**************************************/
346
346
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 ();
349
349
350
350
// Only platform's user locksmith can shutdown or bring online a database
351
351
@@ -447,7 +447,7 @@ void SHUT_online(thread_db* tdbb, SSHORT flag, Sync* guard)
447
447
448
448
static void check_backup_state (thread_db* tdbb)
449
449
{
450
- const auto dbb = tdbb->getDatabase ();
450
+ const auto * dbb = tdbb->getDatabase ();
451
451
452
452
BackupManager::StateReadGuard stateGuard (tdbb);
453
453
0 commit comments