@@ -52,17 +52,17 @@ class ValueExprNode;
52
52
53
53
54
54
// Must be less then MAX_SSHORT. Not used for static arrays.
55
- const unsigned MAX_CONJUNCTS = 32000 ;
55
+ inline constexpr unsigned MAX_CONJUNCTS = 32000 ;
56
56
57
57
// New: MAX_STREAMS should be a multiple of BITS_PER_LONG (32 and hard to believe it will change)
58
58
59
- const StreamType INVALID_STREAM = ~StreamType (0 );
60
- const StreamType MAX_STREAMS = 4096 ;
59
+ inline constexpr StreamType INVALID_STREAM = ~StreamType (0 );
60
+ inline constexpr StreamType MAX_STREAMS = 4096 ;
61
61
62
- const StreamType STREAM_MAP_LENGTH = MAX_STREAMS + 2 ;
62
+ inline constexpr StreamType STREAM_MAP_LENGTH = MAX_STREAMS + 2 ;
63
63
64
64
// New formula is simply MAX_STREAMS / BITS_PER_LONG
65
- const int OPT_STREAM_BITS = MAX_STREAMS / BITS_PER_LONG; // 128 with 4096 streams
65
+ inline constexpr int OPT_STREAM_BITS = MAX_STREAMS / BITS_PER_LONG; // 128 with 4096 streams
66
66
67
67
typedef Firebird::HalfStaticArray<StreamType, OPT_STATIC_STREAMS> StreamList;
68
68
typedef Firebird::SortedArray<StreamType> SortedStreamList;
@@ -538,19 +538,19 @@ class ExprNode : public DmlNode
538
538
};
539
539
540
540
// Generic flags.
541
- static const USHORT FLAG_INVARIANT = 0x01 ; // Node is recognized as being invariant.
542
- static const USHORT FLAG_PATTERN_MATCHER_CACHE = 0x02 ;
541
+ static constexpr USHORT FLAG_INVARIANT = 0x01 ; // Node is recognized as being invariant.
542
+ static constexpr USHORT FLAG_PATTERN_MATCHER_CACHE = 0x02 ;
543
543
544
544
// Boolean flags.
545
- static const USHORT FLAG_DEOPTIMIZE = 0x04 ; // Boolean which requires deoptimization.
546
- static const USHORT FLAG_RESIDUAL = 0x08 ; // Boolean which must remain residual.
547
- static const USHORT FLAG_ANSI_NOT = 0x10 ; // ANY/ALL predicate is prefixed with a NOT one.
545
+ static constexpr USHORT FLAG_DEOPTIMIZE = 0x04 ; // Boolean which requires deoptimization.
546
+ static constexpr USHORT FLAG_RESIDUAL = 0x08 ; // Boolean which must remain residual.
547
+ static constexpr USHORT FLAG_ANSI_NOT = 0x10 ; // ANY/ALL predicate is prefixed with a NOT one.
548
548
549
549
// Value flags.
550
- static const USHORT FLAG_DOUBLE = 0x20 ;
551
- static const USHORT FLAG_DATE = 0x40 ;
552
- static const USHORT FLAG_DECFLOAT = 0x80 ;
553
- static const USHORT FLAG_INT128 = 0x100 ;
550
+ static constexpr USHORT FLAG_DOUBLE = 0x20 ;
551
+ static constexpr USHORT FLAG_DATE = 0x40 ;
552
+ static constexpr USHORT FLAG_DECFLOAT = 0x80 ;
553
+ static constexpr USHORT FLAG_INT128 = 0x100 ;
554
554
555
555
explicit ExprNode (Type aType, MemoryPool& pool)
556
556
: DmlNode(pool),
@@ -934,13 +934,13 @@ class AggNode : public TypedNode<ValueExprNode, ExprNode::TYPE_AGGREGATE>
934
934
public:
935
935
// Capabilities
936
936
// works in a window frame
937
- static const unsigned CAP_SUPPORTS_WINDOW_FRAME = 0x01 ;
937
+ static constexpr unsigned CAP_SUPPORTS_WINDOW_FRAME = 0x01 ;
938
938
// respects window frame boundaries
939
- static const unsigned CAP_RESPECTS_WINDOW_FRAME = 0x02 | CAP_SUPPORTS_WINDOW_FRAME;
939
+ static constexpr unsigned CAP_RESPECTS_WINDOW_FRAME = 0x02 | CAP_SUPPORTS_WINDOW_FRAME;
940
940
// wants aggPass/aggExecute calls in a window
941
- static const unsigned CAP_WANTS_AGG_CALLS = 0x04 ;
941
+ static constexpr unsigned CAP_WANTS_AGG_CALLS = 0x04 ;
942
942
// wants winPass call in a window
943
- static const unsigned CAP_WANTS_WIN_PASS_CALL = 0x08 ;
943
+ static constexpr unsigned CAP_WANTS_WIN_PASS_CALL = 0x08 ;
944
944
945
945
protected:
946
946
struct AggInfo
@@ -1143,16 +1143,16 @@ class WinFuncNode : public AggNode
1143
1143
class RecordSourceNode : public ExprNode
1144
1144
{
1145
1145
public:
1146
- static const USHORT DFLAG_SINGLETON = 0x01 ;
1147
- static const USHORT DFLAG_VALUE = 0x02 ;
1148
- static const USHORT DFLAG_RECURSIVE = 0x04 ; // recursive member of recursive CTE
1149
- static const USHORT DFLAG_DERIVED = 0x08 ;
1150
- static const USHORT DFLAG_DT_IGNORE_COLUMN_CHECK = 0x10 ;
1151
- static const USHORT DFLAG_DT_CTE_USED = 0x20 ;
1152
- static const USHORT DFLAG_CURSOR = 0x40 ;
1153
- static const USHORT DFLAG_LATERAL = 0x80 ;
1154
- static const USHORT DFLAG_PLAN_ITEM = 0x100 ;
1155
- static const USHORT DFLAG_BODY_WRAPPER = 0x200 ;
1146
+ static constexpr USHORT DFLAG_SINGLETON = 0x01 ;
1147
+ static constexpr USHORT DFLAG_VALUE = 0x02 ;
1148
+ static constexpr USHORT DFLAG_RECURSIVE = 0x04 ; // recursive member of recursive CTE
1149
+ static constexpr USHORT DFLAG_DERIVED = 0x08 ;
1150
+ static constexpr USHORT DFLAG_DT_IGNORE_COLUMN_CHECK = 0x10 ;
1151
+ static constexpr USHORT DFLAG_DT_CTE_USED = 0x20 ;
1152
+ static constexpr USHORT DFLAG_CURSOR = 0x40 ;
1153
+ static constexpr USHORT DFLAG_LATERAL = 0x80 ;
1154
+ static constexpr USHORT DFLAG_PLAN_ITEM = 0x100 ;
1155
+ static constexpr USHORT DFLAG_BODY_WRAPPER = 0x200 ;
1156
1156
1157
1157
RecordSourceNode (Type aType, MemoryPool& pool)
1158
1158
: ExprNode(aType, pool),
@@ -1380,7 +1380,7 @@ class ValueListNode : public TypedNode<ListExprNode, ExprNode::TYPE_VALUE_LIST>
1380
1380
NestValueArray items;
1381
1381
1382
1382
private:
1383
- static const unsigned INITIAL_CAPACITY = 4 ;
1383
+ static constexpr unsigned INITIAL_CAPACITY = 4 ;
1384
1384
};
1385
1385
1386
1386
// Container for a list of record source expressions.
@@ -1500,11 +1500,11 @@ class StmtNode : public DmlNode
1500
1500
};
1501
1501
1502
1502
// Marks used by EraseNode, ModifyNode, StoreNode and ForNode
1503
- static const unsigned MARK_POSITIONED = 0x01 ; // Erase|Modify node is positioned at explicit cursor
1504
- static const unsigned MARK_MERGE = 0x02 ; // node is part of MERGE statement
1505
- static const unsigned MARK_FOR_UPDATE = 0x04 ; // implicit cursor used in UPDATE\DELETE\MERGE statement
1506
- static const unsigned MARK_AVOID_COUNTERS = 0x08 ; // do not touch record counters
1507
- static const unsigned MARK_BULK_INSERT = 0x10 ; // StoreNode is used for bulk operation
1503
+ static constexpr unsigned MARK_POSITIONED = 0x01 ; // Erase|Modify node is positioned at explicit cursor
1504
+ static constexpr unsigned MARK_MERGE = 0x02 ; // node is part of MERGE statement
1505
+ static constexpr unsigned MARK_FOR_UPDATE = 0x04 ; // implicit cursor used in UPDATE\DELETE\MERGE statement
1506
+ static constexpr unsigned MARK_AVOID_COUNTERS = 0x08 ; // do not touch record counters
1507
+ static constexpr unsigned MARK_BULK_INSERT = 0x10 ; // StoreNode is used for bulk operation
1508
1508
1509
1509
struct ExeState
1510
1510
{
0 commit comments