@@ -39,7 +39,7 @@ namespace Jrd {
3939
4040class thread_db ;
4141
42- const size_t ACL_BLOB_BUFFER_SIZE = MAX_USHORT; // used to read/write acl blob
42+ inline constexpr size_t ACL_BLOB_BUFFER_SIZE = MAX_USHORT; // used to read/write acl blob
4343
4444// Security class definition
4545
@@ -66,31 +66,31 @@ class SecurityClass
6666typedef Firebird::BePlusTree<SecurityClass*, MetaNamePair, SecurityClass> SecurityClassList;
6767
6868
69- const SecurityClass::flags_t SCL_select = 1 ; // SELECT access
70- const SecurityClass::flags_t SCL_drop = 2 ; // DROP access
71- const SecurityClass::flags_t SCL_control = 4 ; // Control access
72- const SecurityClass::flags_t SCL_exists = 8 ; // At least ACL exists
73- const SecurityClass::flags_t SCL_alter = 16 ; // ALTER access
74- const SecurityClass::flags_t SCL_corrupt = 32 ; // ACL does look too good
75- const SecurityClass::flags_t SCL_insert = 64 ; // INSERT access
76- const SecurityClass::flags_t SCL_delete = 128 ; // DELETE access
77- const SecurityClass::flags_t SCL_update = 256 ; // UPDATE access
78- const SecurityClass::flags_t SCL_references = 512 ; // REFERENCES access
79- const SecurityClass::flags_t SCL_execute = 1024 ; // EXECUTE access
80- const SecurityClass::flags_t SCL_usage = 2048 ; // USAGE access
81- const SecurityClass::flags_t SCL_create = 4096 ;
82-
83- const SecurityClass::flags_t SCL_SELECT_ANY = SCL_select | SCL_references;
84- const SecurityClass::flags_t SCL_ACCESS_ANY = SCL_insert | SCL_update | SCL_delete |
69+ inline constexpr SecurityClass::flags_t SCL_select = 1 ; // SELECT access
70+ inline constexpr SecurityClass::flags_t SCL_drop = 2 ; // DROP access
71+ inline constexpr SecurityClass::flags_t SCL_control = 4 ; // Control access
72+ inline constexpr SecurityClass::flags_t SCL_exists = 8 ; // At least ACL exists
73+ inline constexpr SecurityClass::flags_t SCL_alter = 16 ; // ALTER access
74+ inline constexpr SecurityClass::flags_t SCL_corrupt = 32 ; // ACL does look too good
75+ inline constexpr SecurityClass::flags_t SCL_insert = 64 ; // INSERT access
76+ inline constexpr SecurityClass::flags_t SCL_delete = 128 ; // DELETE access
77+ inline constexpr SecurityClass::flags_t SCL_update = 256 ; // UPDATE access
78+ inline constexpr SecurityClass::flags_t SCL_references = 512 ; // REFERENCES access
79+ inline constexpr SecurityClass::flags_t SCL_execute = 1024 ; // EXECUTE access
80+ inline constexpr SecurityClass::flags_t SCL_usage = 2048 ; // USAGE access
81+ inline constexpr SecurityClass::flags_t SCL_create = 4096 ;
82+
83+ inline constexpr SecurityClass::flags_t SCL_SELECT_ANY = SCL_select | SCL_references;
84+ inline constexpr SecurityClass::flags_t SCL_ACCESS_ANY = SCL_insert | SCL_update | SCL_delete |
8585 SCL_execute | SCL_usage | SCL_SELECT_ANY;
86- const SecurityClass::flags_t SCL_MODIFY_ANY = SCL_create | SCL_alter | SCL_control | SCL_drop;
86+ inline constexpr SecurityClass::flags_t SCL_MODIFY_ANY = SCL_create | SCL_alter | SCL_control | SCL_drop;
8787
8888
8989// information about the user
9090
91- const USHORT USR_mapdown = 1 ; // Mapping failed when getting context
92- const USHORT USR_newrole = 2 ; // usr_granted_roles array needs refresh
93- const USHORT USR_sysdba = 4 ; // User detected as SYSDBA
91+ inline constexpr USHORT USR_mapdown = 1 ; // Mapping failed when getting context
92+ inline constexpr USHORT USR_newrole = 2 ; // usr_granted_roles array needs refresh
93+ inline constexpr USHORT USR_sysdba = 4 ; // User detected as SYSDBA
9494
9595class UserId
9696{
@@ -99,13 +99,13 @@ class UserId
9999 template <unsigned N>
100100 class Bits
101101 {
102- static const unsigned shift = 3 ;
103- static const unsigned bitmask = (1 << shift) - 1 ;
102+ static inline constexpr unsigned shift = 3 ;
103+ static inline constexpr unsigned bitmask = (1 << shift) - 1 ;
104104
105- static const unsigned L = (N >> shift) + (N & bitmask ? 1 : 0 );
105+ static inline constexpr unsigned L = (N >> shift) + (N & bitmask ? 1 : 0 );
106106
107107 public:
108- static const unsigned BYTES_COUNT = L;
108+ static inline constexpr unsigned BYTES_COUNT = L;
109109
110110 Bits ()
111111 {
@@ -254,7 +254,10 @@ class UserId
254254 usr_project_name(p),
255255 usr_org_name(p),
256256 usr_auth_method(p),
257- usr_auth_block(p)
257+ usr_auth_block(p),
258+ usr_user_id(0 ),
259+ usr_group_id(0 ),
260+ usr_flags(0 )
258261 {
259262 }
260263
0 commit comments