Skip to content

Commit fcafa85

Browse files
committed
constexpr + noexcept in DebugInterface
1 parent a4a5df9 commit fcafa85

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

src/jrd/DebugInterface.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ void DBG_parse_debug_info(ULONG length, const UCHAR* data, DbgInfo& dbgInfo)
6262

6363
while (!bad_format && (data < end))
6464
{
65-
UCHAR code = *data++;
65+
const UCHAR code = *data++;
6666

6767
switch (code)
6868
{
@@ -124,7 +124,7 @@ void DBG_parse_debug_info(ULONG length, const UCHAR* data, DbgInfo& dbgInfo)
124124
index |= *data++ << 8;
125125

126126
// variable/cursor name string length
127-
USHORT length = *data++;
127+
const USHORT length = *data++;
128128

129129
if (data + length > end)
130130
{
@@ -158,7 +158,7 @@ void DBG_parse_debug_info(ULONG length, const UCHAR* data, DbgInfo& dbgInfo)
158158
offset |= *data++ << 24;
159159

160160
// variable/cursor name string length
161-
USHORT length = *data++;
161+
const USHORT length = *data++;
162162

163163
if (data + length > end)
164164
{
@@ -191,7 +191,7 @@ void DBG_parse_debug_info(ULONG length, const UCHAR* data, DbgInfo& dbgInfo)
191191
info.index |= *data++ << 8;
192192

193193
// argument name string length
194-
USHORT length = *data++;
194+
const USHORT length = *data++;
195195

196196
if (data + length > end)
197197
{
@@ -224,7 +224,7 @@ void DBG_parse_debug_info(ULONG length, const UCHAR* data, DbgInfo& dbgInfo)
224224
break;
225225
}
226226

227-
MetaName name((const TEXT*) data, length);
227+
const MetaName name((const TEXT*) data, length);
228228
data += length;
229229

230230
if (data + 4 >= end)

src/jrd/DebugInterface.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@
3131
// Version 2 of the debug information replaces 16-bit values
3232
// inside the fb_dbg_map_src2blr tag with 32-bit ones.
3333
// Also, it introduces some new tags.
34-
const UCHAR DBG_INFO_VERSION_1 = UCHAR(1);
35-
const UCHAR DBG_INFO_VERSION_2 = UCHAR(2);
36-
const UCHAR CURRENT_DBG_INFO_VERSION = DBG_INFO_VERSION_2;
34+
inline constexpr UCHAR DBG_INFO_VERSION_1 = UCHAR(1);
35+
inline constexpr UCHAR DBG_INFO_VERSION_2 = UCHAR(2);
36+
inline constexpr UCHAR CURRENT_DBG_INFO_VERSION = DBG_INFO_VERSION_2;
3737

3838
namespace Jrd {
3939
class MetaName;
@@ -48,7 +48,7 @@ class MapBlrToSrcItem
4848
ULONG mbs_src_line;
4949
ULONG mbs_src_col;
5050

51-
static ULONG generate(const MapBlrToSrcItem& Item)
51+
static ULONG generate(const MapBlrToSrcItem& Item) noexcept
5252
{ return Item.mbs_offset; }
5353
};
5454

@@ -60,13 +60,13 @@ typedef Firebird::SortedArray<
6060

6161
struct ArgumentInfo
6262
{
63-
ArgumentInfo(UCHAR aType, USHORT aIndex)
63+
ArgumentInfo(UCHAR aType, USHORT aIndex) noexcept
6464
: type(aType),
6565
index(aIndex)
6666
{
6767
}
6868

69-
ArgumentInfo()
69+
ArgumentInfo() noexcept
7070
: type(0),
7171
index(0)
7272
{
@@ -75,7 +75,7 @@ struct ArgumentInfo
7575
UCHAR type;
7676
USHORT index;
7777

78-
bool operator >(const ArgumentInfo& x) const
78+
bool operator >(const ArgumentInfo& x) const noexcept
7979
{
8080
if (type == x.type)
8181
return index > x.index;

0 commit comments

Comments
 (0)