@@ -84,22 +84,21 @@ class SecDbContext
8484struct BlobIndex
8585{
8686 ULONG bli_temp_id;
87- bool bli_materialized;
88- Request* bli_request;
87+ bool bli_materialized = false ;
88+ Request* bli_request = nullptr ;
8989 union
9090 {
9191 bid bli_blob_id; // ID of materialized blob
9292 blb* bli_blob_object; // Blob object
9393 };
94- static const ULONG& generate (const void * /* sender*/ , const BlobIndex& item)
94+ static const ULONG& generate (const void * /* sender*/ , const BlobIndex& item) noexcept
9595 {
9696 return item.bli_temp_id ;
9797 }
9898 // Empty default constructor to make it behave like POD structure
99- BlobIndex () {}
100- BlobIndex (ULONG temp_id, blb* blob_object) :
101- bli_temp_id (temp_id), bli_materialized(false ), bli_request(NULL ),
102- bli_blob_object (blob_object)
99+ BlobIndex () noexcept : bli_temp_id(0 ), bli_blob_object(nullptr ) {}
100+ BlobIndex (ULONG temp_id, blb* blob_object) noexcept :
101+ bli_temp_id (temp_id), bli_blob_object(blob_object)
103102 { }
104103};
105104
@@ -147,10 +146,10 @@ struct CallerName
147146typedef Firebird::GenericMap<Firebird::Pair<Firebird::NonPooled<SINT64, ULONG> > > ReplBlobMap;
148147typedef Firebird::GenericMap<Firebird::Pair<Firebird::NonPooled<SLONG, blb*> > > BlobUtilMap;
149148
150- const int DEFAULT_LOCK_TIMEOUT = -1 ; // infinite
151- const char * const TRA_BLOB_SPACE = " fb_blob_" ;
152- const char * const TRA_UNDO_SPACE = " fb_undo_" ;
153- const int MAX_TEMP_BLOBS = 1000 ;
149+ inline constexpr int DEFAULT_LOCK_TIMEOUT = -1 ; // infinite
150+ inline constexpr const char * TRA_BLOB_SPACE = " fb_blob_" ;
151+ inline constexpr const char * TRA_UNDO_SPACE = " fb_undo_" ;
152+ inline constexpr ULONG MAX_TEMP_BLOBS = 1000 ;
154153
155154class jrd_tra : public pool_alloc <type_tra>
156155{
@@ -243,12 +242,12 @@ class jrd_tra : public pool_alloc<type_tra>
243242 }
244243 }
245244
246- Attachment* getAttachment ()
245+ Attachment* getAttachment () noexcept
247246 {
248247 return tra_attachment;
249248 }
250249
251- dsql_dbb* getDsqlAttachment ()
250+ dsql_dbb* getDsqlAttachment () noexcept
252251 {
253252 return tra_attachment->att_dsql_instance ;
254253 }
@@ -329,7 +328,7 @@ class jrd_tra : public pool_alloc<type_tra>
329328 void releaseAutonomousPool (MemoryPool* toRelease);
330329 jrd_tra* getOuter ();
331330
332- SSHORT getLockWait () const
331+ SSHORT getLockWait () const noexcept
333332 {
334333 return -tra_lock_timeout;
335334 }
@@ -409,42 +408,42 @@ class jrd_tra : public pool_alloc<type_tra>
409408};
410409
411410// System transaction is always transaction 0.
412- const TraNumber TRA_system_transaction = 0 ;
411+ inline constexpr TraNumber TRA_system_transaction = 0 ;
413412
414413// Flag definitions for tra_flags.
415414
416- const ULONG TRA_system = 0x1L ; // system transaction
417- const ULONG TRA_prepared = 0x2L ; // transaction is in limbo
418- const ULONG TRA_reconnected = 0x4L ; // reconnect in progress
419- const ULONG TRA_degree3 = 0x8L ; // serializeable transaction
420- const ULONG TRA_write = 0x10L ; // transaction has written
421- const ULONG TRA_readonly = 0x20L ; // transaction is readonly
422- const ULONG TRA_prepare2 = 0x40L ; // transaction has updated RDB$TRANSACTIONS
423- const ULONG TRA_ignore_limbo = 0x80L ; // ignore transactions in limbo
424- const ULONG TRA_invalidated = 0x100L ; // transaction invalidated by failed write
425- const ULONG TRA_deferred_meta = 0x200L ; // deferred meta work posted
426- const ULONG TRA_read_committed = 0x400L ; // can see latest committed records
427- const ULONG TRA_autocommit = 0x800L ; // autocommits all updates
428- const ULONG TRA_perform_autocommit = 0x1000L ; // indicates autocommit is necessary
429- const ULONG TRA_rec_version = 0x2000L ; // don't wait for uncommitted versions
430- const ULONG TRA_restart_requests = 0x4000L ; // restart all requests in attachment
431- const ULONG TRA_no_auto_undo = 0x8000L ; // don't start a savepoint in TRA_start
432- const ULONG TRA_precommitted = 0x10000L ; // transaction committed at startup
433- const ULONG TRA_own_interface = 0x20000L ; // tra_interface was created for internal needs
434- const ULONG TRA_read_consistency = 0x40000L ; // ensure read consistency in this transaction
435- const ULONG TRA_ex_restart = 0x80000L ; // Exception was raised to restart request
436- const ULONG TRA_replicating = 0x100000L ; // transaction is allowed to be replicated
437- const ULONG TRA_no_blob_check = 0x200000L ; // disable blob access checking
438- const ULONG TRA_auto_release_temp_blobid = 0x400000L ; // remove temp ids of materialized user blobs from tra_blobs
415+ inline constexpr ULONG TRA_system = 0x1L ; // system transaction
416+ inline constexpr ULONG TRA_prepared = 0x2L ; // transaction is in limbo
417+ inline constexpr ULONG TRA_reconnected = 0x4L ; // reconnect in progress
418+ inline constexpr ULONG TRA_degree3 = 0x8L ; // serializeable transaction
419+ inline constexpr ULONG TRA_write = 0x10L ; // transaction has written
420+ inline constexpr ULONG TRA_readonly = 0x20L ; // transaction is readonly
421+ inline constexpr ULONG TRA_prepare2 = 0x40L ; // transaction has updated RDB$TRANSACTIONS
422+ inline constexpr ULONG TRA_ignore_limbo = 0x80L ; // ignore transactions in limbo
423+ inline constexpr ULONG TRA_invalidated = 0x100L ; // transaction invalidated by failed write
424+ inline constexpr ULONG TRA_deferred_meta = 0x200L ; // deferred meta work posted
425+ inline constexpr ULONG TRA_read_committed = 0x400L ; // can see latest committed records
426+ inline constexpr ULONG TRA_autocommit = 0x800L ; // autocommits all updates
427+ inline constexpr ULONG TRA_perform_autocommit = 0x1000L ; // indicates autocommit is necessary
428+ inline constexpr ULONG TRA_rec_version = 0x2000L ; // don't wait for uncommitted versions
429+ inline constexpr ULONG TRA_restart_requests = 0x4000L ; // restart all requests in attachment
430+ inline constexpr ULONG TRA_no_auto_undo = 0x8000L ; // don't start a savepoint in TRA_start
431+ inline constexpr ULONG TRA_precommitted = 0x10000L ; // transaction committed at startup
432+ inline constexpr ULONG TRA_own_interface = 0x20000L ; // tra_interface was created for internal needs
433+ inline constexpr ULONG TRA_read_consistency = 0x40000L ; // ensure read consistency in this transaction
434+ inline constexpr ULONG TRA_ex_restart = 0x80000L ; // Exception was raised to restart request
435+ inline constexpr ULONG TRA_replicating = 0x100000L ; // transaction is allowed to be replicated
436+ inline constexpr ULONG TRA_no_blob_check = 0x200000L ; // disable blob access checking
437+ inline constexpr ULONG TRA_auto_release_temp_blobid = 0x400000L ;// remove temp ids of materialized user blobs from tra_blobs
439438
440439// flags derived from TPB, see also transaction_options() at tra.cpp
441- const ULONG TRA_OPTIONS_MASK = (TRA_degree3 | TRA_readonly | TRA_ignore_limbo | TRA_read_committed |
440+ inline constexpr ULONG TRA_OPTIONS_MASK = (TRA_degree3 | TRA_readonly | TRA_ignore_limbo | TRA_read_committed |
442441 TRA_autocommit | TRA_rec_version | TRA_read_consistency | TRA_no_auto_undo | TRA_restart_requests | TRA_auto_release_temp_blobid);
443442
444- const int TRA_MASK = 3 ;
445- // const int TRA_BITS_PER_TRANS = 2;
446- // const int TRA_TRANS_PER_BYTE = 4;
447- const int TRA_SHIFT = 2 ;
443+ inline constexpr int TRA_MASK = 3 ;
444+ // inline constexpr int TRA_BITS_PER_TRANS = 2;
445+ // inline constexpr int TRA_TRANS_PER_BYTE = 4;
446+ inline constexpr int TRA_SHIFT = 2 ;
448447
449448#define TRANS_SHIFT (number ) (((number) & TRA_MASK) << 1 )
450449#define TRANS_OFFSET (number ) ((number) >> TRA_SHIFT)
@@ -453,18 +452,18 @@ const int TRA_SHIFT = 2;
453452// for "dead" active transactions every so often at transaction
454453// startup
455454
456- const int TRA_ACTIVE_CLEANUP = 100 ;
455+ inline constexpr int TRA_ACTIVE_CLEANUP = 100 ;
457456
458457// Transaction states. The first four are states found
459458// in the transaction inventory page; the last two are
460459// returned internally
461460
462- const int tra_active = 0 ; // Transaction is active
463- const int tra_limbo = 1 ;
464- const int tra_dead = 2 ;
465- const int tra_committed = 3 ;
466- const int tra_us = 4 ; // Transaction is us
467- const int tra_precommitted = 5 ; // Transaction is precommitted
461+ inline constexpr int tra_active = 0 ; // Transaction is active
462+ inline constexpr int tra_limbo = 1 ;
463+ inline constexpr int tra_dead = 2 ;
464+ inline constexpr int tra_committed = 3 ;
465+ inline constexpr int tra_us = 4 ; // Transaction is us
466+ inline constexpr int tra_precommitted = 5 ; // Transaction is precommitted
468467
469468// Deferred work blocks are used by the meta data handler to keep track
470469// of work deferred to commit time. This are usually used to perform
0 commit comments