@@ -88,24 +88,24 @@ DEFINE_TRACE_ROUTINE(remote_trace);
8888
8989#endif
9090
91- const int BLOB_LENGTH = 16384 ;
91+ constexpr int BLOB_LENGTH = 16384 ;
9292
9393#include " ../remote/protocol.h"
9494#include " fb_blk.h"
9595
9696// Prefetch constants
9797
98- const ULONG MAX_PACKETS_PER_BATCH = 16 ;
98+ constexpr ULONG MAX_PACKETS_PER_BATCH = 16 ;
9999
100- const ULONG MIN_ROWS_PER_BATCH = 10 ;
101- const ULONG MAX_ROWS_PER_BATCH = 1000 ;
100+ constexpr ULONG MIN_ROWS_PER_BATCH = 10 ;
101+ constexpr ULONG MAX_ROWS_PER_BATCH = 1000 ;
102102
103- const ULONG MAX_BATCH_CACHE_SIZE = 1024 * 1024 ; // 1 MB
103+ constexpr ULONG MAX_BATCH_CACHE_SIZE = 1024 * 1024 ; // 1 MB
104104
105- const ULONG DEFAULT_BLOBS_CACHE_SIZE = 10 * 1024 * 1024 ; // 10 MB
105+ constexpr ULONG DEFAULT_BLOBS_CACHE_SIZE = 10 * 1024 * 1024 ; // 10 MB
106106
107- const ULONG MAX_INLINE_BLOB_SIZE = MAX_USHORT;
108- const ULONG DEFAULT_INLINE_BLOB_SIZE = MAX_USHORT;
107+ constexpr ULONG MAX_INLINE_BLOB_SIZE = MAX_USHORT;
108+ constexpr ULONG DEFAULT_INLINE_BLOB_SIZE = MAX_USHORT;
109109
110110// fwd. decl.
111111namespace Firebird {
@@ -591,7 +591,7 @@ struct Rsr : public Firebird::GlobalStorage, public TypedHandle<rem_type_rsr>
591591 : curBpb(*getDefaultMemoryPool ()), hdrPrevious(0 ), segmented(false )
592592 { }
593593
594- static const ULONG SIZEOF_BLOB_HEAD = sizeof (ISC_QUAD) + 2 * sizeof (ULONG);
594+ static constexpr ULONG SIZEOF_BLOB_HEAD = sizeof (ISC_QUAD) + 2 * sizeof (ULONG);
595595
596596 typedef Firebird::HalfStaticArray<UCHAR, 64 > Bpb;
597597 Bpb curBpb;
@@ -626,8 +626,8 @@ struct Rsr : public Firebird::GlobalStorage, public TypedHandle<rem_type_rsr>
626626 PAST_BOF = 256 // BOF was returned by fetch from this statement
627627 };
628628
629- static const auto STREAM_END = (BOF_SET | EOF_SET);
630- static const auto PAST_END = (PAST_BOF | PAST_EOF);
629+ static constexpr auto STREAM_END = (BOF_SET | EOF_SET);
630+ static constexpr auto PAST_END = (PAST_BOF | PAST_EOF);
631631
632632public:
633633 Rsr () :
@@ -789,8 +789,8 @@ typedef Firebird::Array<rem_que_packet> PacketQueue;
789789class ServerAuthBase
790790{
791791public:
792- static const unsigned AUTH_CONTINUE = 0x01 ;
793- static const unsigned AUTH_COND_ACCEPT = 0x02 ;
792+ static constexpr unsigned AUTH_CONTINUE = 0x01 ;
793+ static constexpr unsigned AUTH_COND_ACCEPT = 0x02 ;
794794
795795 virtual ~ServerAuthBase ();
796796 virtual bool authenticate (PACKET* send, unsigned flags = 0 ) = 0;
@@ -899,10 +899,10 @@ class KnownServerKey : public Firebird::AutoStorage
899899};
900900
901901// Tags for clumplets, passed from server to client
902- const UCHAR TAG_KEY_TYPE = 0 ;
903- const UCHAR TAG_KEY_PLUGINS = 1 ;
904- const UCHAR TAG_KNOWN_PLUGINS = 2 ;
905- const UCHAR TAG_PLUGIN_SPECIFIC = 3 ;
902+ constexpr UCHAR TAG_KEY_TYPE = 0 ;
903+ constexpr UCHAR TAG_KEY_PLUGINS = 1 ;
904+ constexpr UCHAR TAG_KNOWN_PLUGINS = 2 ;
905+ constexpr UCHAR TAG_PLUGIN_SPECIFIC = 3 ;
906906
907907
908908typedef Firebird::GetPlugins<Firebird::IClient> AuthClientPlugins;
@@ -1090,8 +1090,8 @@ class SrvAuthBlock final :
10901090 Auth::WriterImplementation authBlockWriter;
10911091
10921092 // extractNewKeys flags
1093- static const ULONG EXTRACT_PLUGINS_LIST = 0x1 ;
1094- static const ULONG ONLY_CLEANUP = 0x2 ;
1093+ static constexpr ULONG EXTRACT_PLUGINS_LIST = 0x1 ;
1094+ static constexpr ULONG ONLY_CLEANUP = 0x2 ;
10951095
10961096 explicit SrvAuthBlock (rem_port* p_port)
10971097 : port(p_port),
@@ -1136,26 +1136,26 @@ class SrvAuthBlock final :
11361136};
11371137
11381138
1139- const signed char WIRECRYPT_BROKEN = -1 ;
1140- const signed char WIRECRYPT_DISABLED = 0 ;
1141- const signed char WIRECRYPT_ENABLED = 1 ;
1142- const signed char WIRECRYPT_REQUIRED = 2 ;
1139+ constexpr signed char WIRECRYPT_BROKEN = -1 ;
1140+ constexpr signed char WIRECRYPT_DISABLED = 0 ;
1141+ constexpr signed char WIRECRYPT_ENABLED = 1 ;
1142+ constexpr signed char WIRECRYPT_REQUIRED = 2 ;
11431143
11441144// port_flags
1145- const USHORT PORT_symmetric = 0x0001 ; // Server/client architectures are symmetic
1146- const USHORT PORT_async = 0x0002 ; // Port is asynchronous channel for events
1147- const USHORT PORT_no_oob = 0x0004 ; // Don't send out of band data
1148- const USHORT PORT_disconnect = 0x0008 ; // Disconnect is in progress
1149- const USHORT PORT_dummy_pckt_set= 0x0010 ; // A dummy packet interval is set
1150- // const USHORT PORT_partial_data = 0x0020; // Physical packet doesn't contain all API packet
1151- const USHORT PORT_lazy = 0x0040 ; // Deferred operations are allowed
1152- const USHORT PORT_server = 0x0080 ; // Server (not client) port
1153- const USHORT PORT_detached = 0x0100 ; // op_detach, op_drop_database or op_service_detach was processed
1154- const USHORT PORT_rdb_shutdown = 0x0200 ; // Database is shut down
1155- const USHORT PORT_connecting = 0x0400 ; // Aux connection waits for a channel to be activated by client
1156- // const USHORT PORT_z_data = 0x0800; // Zlib incoming buffer has data left after decompression
1157- const USHORT PORT_compressed = 0x1000 ; // Compress outgoing stream (does not affect incoming)
1158- const USHORT PORT_released = 0x2000 ; // release(), complementary to the first addRef() in constructor, was called
1145+ constexpr USHORT PORT_symmetric = 0x0001 ; // Server/client architectures are symmetic
1146+ constexpr USHORT PORT_async = 0x0002 ; // Port is asynchronous channel for events
1147+ constexpr USHORT PORT_no_oob = 0x0004 ; // Don't send out of band data
1148+ constexpr USHORT PORT_disconnect = 0x0008 ; // Disconnect is in progress
1149+ constexpr USHORT PORT_dummy_pckt_set= 0x0010 ; // A dummy packet interval is set
1150+ // constexpr USHORT PORT_partial_data = 0x0020; // Physical packet doesn't contain all API packet
1151+ constexpr USHORT PORT_lazy = 0x0040 ; // Deferred operations are allowed
1152+ constexpr USHORT PORT_server = 0x0080 ; // Server (not client) port
1153+ constexpr USHORT PORT_detached = 0x0100 ; // op_detach, op_drop_database or op_service_detach was processed
1154+ constexpr USHORT PORT_rdb_shutdown = 0x0200 ; // Database is shut down
1155+ constexpr USHORT PORT_connecting = 0x0400 ; // Aux connection waits for a channel to be activated by client
1156+ // constexpr USHORT PORT_z_data = 0x0800; // Zlib incoming buffer has data left after decompression
1157+ constexpr USHORT PORT_compressed = 0x1000 ; // Compress outgoing stream (does not affect incoming)
1158+ constexpr USHORT PORT_released = 0x2000 ; // release(), complementary to the first addRef() in constructor, was called
11591159
11601160// forward decl
11611161class RemotePortGuard ;
0 commit comments