6767// #define COMPRESS_DEBUG 1
6868#endif // WIRE_COMPRESS_SUPPORT
6969
70- const int GDS_NAME_LEN = METADATA_IDENTIFIER_CHAR_LEN * 4 /* max bytes per char */ + 1 ;
71- typedef TEXT GDS_NAME[GDS_NAME_LEN];
70+ inline constexpr int GDS_NAME_LEN = METADATA_IDENTIFIER_CHAR_LEN * 4 /* max bytes per char */ + 1 ;
71+ typedef TEXT GDS_NAME[GDS_NAME_LEN];
7272
7373enum redirect_vals {
7474 NOREDIRECT = 0 ,
7575 REDIRECT = 1 ,
7676 NOOUTPUT = 2
7777};
7878
79- static const int burp_msg_fac = 12 ;
79+ static inline constexpr int burp_msg_fac = FB_IMPL_MSG_FACILITY_GBAK ;
8080
8181// Record types in backup file
8282
@@ -213,15 +213,15 @@ Version 12: FB6.0.
213213 Schemas.
214214*/
215215
216- const int ATT_BACKUP_FORMAT = 12 ;
216+ inline constexpr int ATT_BACKUP_FORMAT = 12 ;
217217
218218// max array dimension
219219
220- const int MAX_DIMENSION = 16 ;
220+ inline constexpr int MAX_DIMENSION = 16 ;
221221
222- const int SERIES = 1 ;
222+ inline constexpr int SERIES = 1 ;
223223
224- const USHORT MAX_UPDATE_DBKEY_RECURSION_DEPTH = 16 ;
224+ inline constexpr USHORT MAX_UPDATE_DBKEY_RECURSION_DEPTH = 16 ;
225225
226226
227227enum att_type {
@@ -715,13 +715,13 @@ enum trig_t {
715715// these types to go away when recognized by gpre as
716716// <relation>.<field>.<type> some time in the future
717717
718- const int TRIG_TYPE_PRE_STORE = 1 ;
719- const int TRIG_TYPE_PRE_MODIFY = 3 ;
720- const int TRIG_TYPE_POST_ERASE = 6 ;
718+ inline constexpr int TRIG_TYPE_PRE_STORE = 1 ;
719+ inline constexpr int TRIG_TYPE_PRE_MODIFY = 3 ;
720+ inline constexpr int TRIG_TYPE_POST_ERASE = 6 ;
721721
722722// default trigger name templates
723723
724- const int TRIGGER_SEQUENCE_DEFAULT = 0 ;
724+ inline constexpr int TRIGGER_SEQUENCE_DEFAULT = 0 ;
725725
726726// common structure definitions
727727
@@ -852,7 +852,7 @@ struct burp_meta_obj
852852
853853// CVC: Could use MAXPATHLEN, but what about restoring in a different system?
854854// I need to review if we tolerate different lengths for different OS's here.
855- const unsigned int MAX_FILE_NAME_SIZE = 256 ;
855+ inline constexpr unsigned int MAX_FILE_NAME_SIZE = 256 ;
856856
857857#include " ../burp/std_desc.h"
858858
@@ -936,9 +936,9 @@ struct burp_act
936936 act_t act_action;
937937};
938938
939- const size_t ACT_LEN = sizeof (burp_act);
939+ inline constexpr size_t ACT_LEN = sizeof (burp_act);
940940
941- const ULONG MAX_LENGTH = ~FB_CONST64 (0 ); // Keep in sync with burp_fil.fil_length
941+ inline constexpr ULONG MAX_LENGTH = ~FB_CONST64 (0 ); // Keep in sync with burp_fil.fil_length
942942
943943// This structure has been cloned from spit.cpp
944944
@@ -958,12 +958,12 @@ struct hdr_split
958958// NOTE: size of the hdr_split_tag and HDR_SPLIT_TAG must be the same and equal
959959// to 18. Otherwise we will not be able to join the gbk files v5.x
960960
961- const size_t HDR_SPLIT_SIZE = sizeof (hdr_split);
962- static const char HDR_SPLIT_TAG5[] = " InterBase/gsplit, " ;
963- static const char HDR_SPLIT_TAG6[] = " InterBase/gbak, " ;
961+ inline constexpr size_t HDR_SPLIT_SIZE = sizeof (hdr_split);
962+ static inline constexpr char HDR_SPLIT_TAG5[] = " InterBase/gsplit, " ;
963+ static inline constexpr char HDR_SPLIT_TAG6[] = " InterBase/gbak, " ;
964964// CVC: Don't convert to const char* or you will have to fix the sizeof()'s!!!
965965#define HDR_SPLIT_TAG HDR_SPLIT_TAG6
966- const FB_UINT64 MIN_SPLIT_SIZE = FB_CONST64(2048 ); // bytes
966+ inline constexpr FB_UINT64 MIN_SPLIT_SIZE = FB_CONST64(2048 ); // bytes
967967
968968
969969// Global switches and data
@@ -1285,7 +1285,7 @@ class BurpGlobals : public Firebird::ThreadData, public GblPool
12851285void BURP_exit_local (int code, BurpGlobals* tdgbl);
12861286
12871287// database is not on-line due to failure to activate one or more indices
1288- const int FINI_DB_NOT_ONLINE = 2 ;
1288+ inline constexpr int FINI_DB_NOT_ONLINE = 2 ;
12891289
12901290/* Burp will always write a backup in multiples of the following number
12911291 * of bytes. The initial value is the smallest which ensures that writes
@@ -1296,8 +1296,8 @@ const int FINI_DB_NOT_ONLINE = 2;
12961296 * bit masking.
12971297 */
12981298
1299- const int BURP_BLOCK = 512 ;
1300- inline static ULONG BURP_UP_TO_BLOCK (const ULONG size)
1299+ inline constexpr int BURP_BLOCK = 512 ;
1300+ static inline constexpr ULONG BURP_UP_TO_BLOCK (const ULONG size)
13011301{
13021302 return (((size) + BURP_BLOCK - 1 ) & ~(BURP_BLOCK - 1 ));
13031303}
@@ -1306,11 +1306,11 @@ inline static ULONG BURP_UP_TO_BLOCK(const ULONG size)
13061306// so that other files can see them for multivolume opens
13071307
13081308#ifdef WIN_NT
1309- static const ULONG MODE_READ = GENERIC_READ;
1310- static const ULONG MODE_WRITE = GENERIC_WRITE;
1309+ static inline constexpr ULONG MODE_READ = GENERIC_READ;
1310+ static inline constexpr ULONG MODE_WRITE = GENERIC_WRITE;
13111311#else
1312- static const ULONG MODE_READ = O_RDONLY;
1313- static const ULONG MODE_WRITE = O_WRONLY | O_CREAT;
1312+ static inline constexpr ULONG MODE_READ = O_RDONLY;
1313+ static inline constexpr ULONG MODE_WRITE = O_WRONLY | O_CREAT;
13141314#endif
13151315
13161316
0 commit comments