2727
2828// switch definitions
2929
30- const SINT64 sw_list = 0x0000000000000001L ; // Byte 0, Bit 0
31- const SINT64 sw_prompt = 0x0000000000000002L ;
32- const SINT64 sw_commit = 0x0000000000000004L ;
33- const SINT64 sw_rollback = 0x0000000000000008L ;
34- const SINT64 sw_sweep = 0x0000000000000010L ;
35- const SINT64 sw_validate = 0x0000000000000020L ;
36- const SINT64 sw_no_update = 0x0000000000000040L ;
37- const SINT64 sw_full = 0x0000000000000080L ;
38- const SINT64 sw_mend = 0x0000000000000100L ; // Byte 1, Bit 0
39- const SINT64 sw_all = 0x0000000000000200L ;
40- const SINT64 sw_enable = 0x0000000000000400L ;
41- const SINT64 sw_disable = 0x0000000000000800L ;
42- const SINT64 sw_ignore = 0x0000000000001000L ;
43- const SINT64 sw_activate = 0x0000000000002000L ;
44- const SINT64 sw_two_phase = 0x0000000000004000L ;
45- const SINT64 sw_housekeeping = 0x0000000000008000L ;
46- const SINT64 sw_kill = 0x0000000000010000L ; // Byte 2, Bit 0
47- //const SINT64 sw_begin_log = 0x0000000000020000L;
48- //const SINT64 sw_quit_log = 0x0000000000040000L;
49- const SINT64 sw_write = 0x0000000000080000L ;
50- const SINT64 sw_no_reserve = 0x0000000000100000L ;
51- const SINT64 sw_user = 0x0000000000200000L ;
52- const SINT64 sw_password = 0x0000000000400000L ;
53- const SINT64 sw_shut = 0x0000000000800000L ;
54- const SINT64 sw_online = 0x0000000001000000L ; // Byte 3, Bit 0
55- //const SINT64 sw_cache = 0x0000000002000000L;
56- const SINT64 sw_attach = 0x0000000004000000L ;
57- const SINT64 sw_force = 0x0000000008000000L ;
58- const SINT64 sw_tran = 0x0000000010000000L ;
59- const SINT64 sw_buffers = 0x0000000020000000L ;
60- const SINT64 sw_mode = 0x0000000040000000L ;
61- const SINT64 sw_set_db_dialect = 0x0000000080000000L ;
62- const SINT64 sw_trusted_auth = QUADCONST (0x0000000100000000 ); // Byte 4, Bit 0
63- const SINT64 sw_parallel_workers = QUADCONST (0x0000000200000000 );
64- const SINT64 sw_fetch_password = QUADCONST (0x0000000800000000 );
65- const SINT64 sw_nolinger = QUADCONST (0x0000001000000000 );
66- const SINT64 sw_icu = QUADCONST (0x0000002000000000 );
67- const SINT64 sw_role = QUADCONST (0x0000004000000000 );
68- const SINT64 sw_replica = QUADCONST (0x0000008000000000 );
69- const SINT64 sw_upgrade = QUADCONST (0x0000010000000000 );
30+ inline constexpr SINT64 sw_list = 0x0000000000000001L ; // Byte 0, Bit 0
31+ inline constexpr SINT64 sw_prompt = 0x0000000000000002L ;
32+ inline constexpr SINT64 sw_commit = 0x0000000000000004L ;
33+ inline constexpr SINT64 sw_rollback = 0x0000000000000008L ;
34+ inline constexpr SINT64 sw_sweep = 0x0000000000000010L ;
35+ inline constexpr SINT64 sw_validate = 0x0000000000000020L ;
36+ inline constexpr SINT64 sw_no_update = 0x0000000000000040L ;
37+ inline constexpr SINT64 sw_full = 0x0000000000000080L ;
38+ inline constexpr SINT64 sw_mend = 0x0000000000000100L ; // Byte 1, Bit 0
39+ inline constexpr SINT64 sw_all = 0x0000000000000200L ;
40+ inline constexpr SINT64 sw_enable = 0x0000000000000400L ;
41+ inline constexpr SINT64 sw_disable = 0x0000000000000800L ;
42+ inline constexpr SINT64 sw_ignore = 0x0000000000001000L ;
43+ inline constexpr SINT64 sw_activate = 0x0000000000002000L ;
44+ inline constexpr SINT64 sw_two_phase = 0x0000000000004000L ;
45+ inline constexpr SINT64 sw_housekeeping = 0x0000000000008000L ;
46+ inline constexpr SINT64 sw_kill = 0x0000000000010000L ; // Byte 2, Bit 0
47+ //inline constexpr SINT64 sw_begin_log = 0x0000000000020000L;
48+ //inline constexpr SINT64 sw_quit_log = 0x0000000000040000L;
49+ inline constexpr SINT64 sw_write = 0x0000000000080000L ;
50+ inline constexpr SINT64 sw_no_reserve = 0x0000000000100000L ;
51+ inline constexpr SINT64 sw_user = 0x0000000000200000L ;
52+ inline constexpr SINT64 sw_password = 0x0000000000400000L ;
53+ inline constexpr SINT64 sw_shut = 0x0000000000800000L ;
54+ inline constexpr SINT64 sw_online = 0x0000000001000000L ; // Byte 3, Bit 0
55+ //inline constexpr SINT64 sw_cache = 0x0000000002000000L;
56+ inline constexpr SINT64 sw_attach = 0x0000000004000000L ;
57+ inline constexpr SINT64 sw_force = 0x0000000008000000L ;
58+ inline constexpr SINT64 sw_tran = 0x0000000010000000L ;
59+ inline constexpr SINT64 sw_buffers = 0x0000000020000000L ;
60+ inline constexpr SINT64 sw_mode = 0x0000000040000000L ;
61+ inline constexpr SINT64 sw_set_db_dialect = 0x0000000080000000L ;
62+ inline constexpr SINT64 sw_trusted_auth = QUADCONST (0x0000000100000000 ); // Byte 4, Bit 0
63+ inline constexpr SINT64 sw_parallel_workers = QUADCONST (0x0000000200000000 );
64+ inline constexpr SINT64 sw_fetch_password = QUADCONST (0x0000000800000000 );
65+ inline constexpr SINT64 sw_nolinger = QUADCONST (0x0000001000000000 );
66+ inline constexpr SINT64 sw_icu = QUADCONST (0x0000002000000000 );
67+ inline constexpr SINT64 sw_role = QUADCONST (0x0000004000000000 );
68+ inline constexpr SINT64 sw_replica = QUADCONST (0x0000008000000000 );
69+ inline constexpr SINT64 sw_upgrade = QUADCONST (0x0000010000000000 );
7070
7171// Popular combination of compatible switches
72- const SINT64 sw_auth_set = sw_user | sw_password | sw_role | sw_fetch_password | sw_trusted_auth ;
72+ inline constexpr SINT64 sw_auth_set = sw_user | sw_password | sw_role | sw_fetch_password | sw_trusted_auth ;
7373
7474
7575enum alice_switches
@@ -86,7 +86,7 @@ enum alice_switches
8686 IN_SW_ALICE_MEND = 9 ,
8787 IN_SW_ALICE_ALL = 10 ,
8888 IN_SW_ALICE_ENABLE = 11 ,
89- //IN_SW_ALICE_DISABLE = 12,
89+ //IN_SW_ALICE_DISABLE = 12,
9090 IN_SW_ALICE_IGNORE = 13 ,
9191 IN_SW_ALICE_ACTIVATE = 14 ,
9292 IN_SW_ALICE_TWO_PHASE = 15 ,
@@ -131,20 +131,20 @@ enum alice_switches
131131 IN_SW_ALICE_UPGRADE = 52
132132};
133133
134- static const char * const ALICE_SW_ASYNC = "ASYNC" ;
135- static const char * const ALICE_SW_SYNC = "SYNC" ;
134+ static inline constexpr const char * ALICE_SW_ASYNC = "ASYNC" ;
135+ static inline constexpr const char * ALICE_SW_SYNC = "SYNC" ;
136136
137- static const char * const ALICE_SW_MODE_NONE = "NONE" ;
138- static const char * const ALICE_SW_MODE_RO = "READ_ONLY" ;
139- static const char * const ALICE_SW_MODE_RW = "READ_WRITE" ;
137+ static inline constexpr const char * ALICE_SW_MODE_NONE = "NONE" ;
138+ static inline constexpr const char * ALICE_SW_MODE_RO = "READ_ONLY" ;
139+ static inline constexpr const char * ALICE_SW_MODE_RW = "READ_WRITE" ;
140140
141- static const char * const ALICE_SW_SHUT_NORMAL = "NORMAL" ;
142- static const char * const ALICE_SW_SHUT_MULTI = "MULTI" ;
143- static const char * const ALICE_SW_SHUT_SINGLE = "SINGLE" ;
144- static const char * const ALICE_SW_SHUT_FULL = "FULL" ;
141+ static inline constexpr const char * ALICE_SW_SHUT_NORMAL = "NORMAL" ;
142+ static inline constexpr const char * ALICE_SW_SHUT_MULTI = "MULTI" ;
143+ static inline constexpr const char * ALICE_SW_SHUT_SINGLE = "SINGLE" ;
144+ static inline constexpr const char * ALICE_SW_SHUT_FULL = "FULL" ;
145145
146146// Switch table
147- static const Switches ::in_sw_tab_t alice_in_sw_table [] =
147+ static inline constexpr Switches ::in_sw_tab_t alice_in_sw_table [] =
148148{
149149 {IN_SW_ALICE_ACTIVATE , isc_spb_prp_activate , "ACTIVATE_SHADOW" , sw_activate ,
150150 0 , ~(sw_activate | sw_auth_set | sw_nolinger ), false, true, 25 , 2 , NULL },
@@ -321,12 +321,12 @@ static const Switches::in_sw_tab_t alice_in_sw_table[] =
321321 0 , 0 , false, false, 0 , 0 , NULL }
322322};
323323
324- static const char * alice_shut_mode_sw_table [] =
324+ static inline constexpr const char * alice_shut_mode_sw_table [] =
325325{
326326 ALICE_SW_SHUT_NORMAL , ALICE_SW_SHUT_MULTI , ALICE_SW_SHUT_SINGLE , ALICE_SW_SHUT_FULL
327327};
328328
329- static const char * alice_repl_mode_sw_table [] =
329+ static inline constexpr const char * alice_repl_mode_sw_table [] =
330330{
331331 ALICE_SW_MODE_NONE , ALICE_SW_MODE_RO , ALICE_SW_MODE_RW
332332};
0 commit comments