Skip to content

Commit 0ff6acc

Browse files
committed
constexpr + noexcept xdr
1 parent 6891842 commit 0ff6acc

2 files changed

Lines changed: 10 additions & 10 deletions

File tree

src/common/xdr.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,19 +45,19 @@ inline void XDR_FREEA(void* block)
4545
}
4646

4747
#ifdef DEBUG_XDR_MEMORY
48-
inline void DEBUG_XDR_ALLOC(xdr_t* xdrs, const void* xdrvar, const void* addr, ULONG len)
48+
inline void DEBUG_XDR_ALLOC(xdr_t* xdrs, const void* xdrvar, const void* addr, ULONG len) noexcept
4949
{
5050
xdr_debug_memory(xdrs, XDR_DECODE, xdrvar, addr, len)
5151
}
52-
inline void DEBUG_XDR_FREE(xdr_t* xdrs, const void* xdrvar, const void* addr, ULONG len)
52+
inline void DEBUG_XDR_FREE(xdr_t* xdrs, const void* xdrvar, const void* addr, ULONG len) noexcept
5353
{
54-
xdr_debug_memory (xdrs, XDR_FREE, xdrvar, addr, (ULONG) len);
54+
xdr_debug_memory(xdrs, XDR_FREE, xdrvar, addr, (ULONG) len);
5555
}
5656
#else
57-
inline void DEBUG_XDR_ALLOC(xdr_t*, const void*, const void*, ULONG)
57+
inline void DEBUG_XDR_ALLOC(xdr_t*, const void*, const void*, ULONG) noexcept
5858
{
5959
}
60-
inline void DEBUG_XDR_FREE(xdr_t*, const void*, const void*, ULONG)
60+
inline void DEBUG_XDR_FREE(xdr_t*, const void*, const void*, ULONG) noexcept
6161
{
6262
}
6363
#endif // DEBUG_XDR_MEMORY
@@ -67,7 +67,7 @@ inline void DEBUG_XDR_FREE(xdr_t*, const void*, const void*, ULONG)
6767
// sufficient.
6868
// This setting may be related to our max DSQL statement size.
6969

70-
const unsigned MAXSTRING_FOR_WRAPSTRING = 65535;
70+
constexpr unsigned MAXSTRING_FOR_WRAPSTRING = 65535;
7171

7272

7373
#define GETBYTES xdrs->x_getbytes
@@ -175,7 +175,7 @@ bool_t xdr_datum( xdr_t* xdrs, const dsc* desc, UCHAR* buffer)
175175
case dtype_dbkey:
176176
fb_assert(false); // dbkey should not get outside jrd,
177177
// but in case it happenned in production server treat it as text
178-
// Fall through ...
178+
[[fallthrough]];
179179

180180
case dtype_text:
181181
case dtype_boolean:
@@ -869,7 +869,7 @@ bool_t xdr_wrapstring(xdr_t* xdrs, SCHAR** strp)
869869
}
870870

871871

872-
int xdr_t::create(SCHAR* addr, unsigned len, xdr_op op)
872+
int xdr_t::create(SCHAR* addr, unsigned len, xdr_op op) noexcept
873873
{
874874
/**************************************
875875
*

src/common/xdr.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,11 @@ struct xdr_t
6161
unsigned x_handy; // extra private word
6262
bool x_local; // transmission is known to be local (bytes are in the host order)
6363

64-
xdr_t() :
64+
xdr_t() noexcept :
6565
x_op(XDR_ENCODE), x_private(0), x_base(0), x_handy(0), x_local(false)
6666
{ }
6767

68-
int create(SCHAR* addr, unsigned len, xdr_op op);
68+
int create(SCHAR* addr, unsigned len, xdr_op op) noexcept;
6969
};
7070

7171
#endif // COMMON_XDR_H

0 commit comments

Comments
 (0)