Skip to content

Commit fd1c4b7

Browse files
committed
constexpr + noexcept user_dsql
1 parent 69f8975 commit fd1c4b7

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

src/yvalve/user_dsql.cpp

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,7 @@
5252
#include <stdlib.h>
5353

5454
// SQLDA dialects
55-
const USHORT DIALECT_sqlda = 0;
56-
//const USHORT DIALECT_xsqlda = 1; // meaning is same as SQL_DIALECT_V5
55+
constexpr USHORT DIALECT_sqlda = 0;
5756

5857
using namespace Firebird;
5958

@@ -110,9 +109,9 @@ static dsql_name* lookup_name(const SCHAR*, dsql_name*);
110109
static dsql_stmt* lookup_stmt(const SCHAR*, dsql_name*, name_type);
111110
static void init(FB_API_HANDLE*);
112111
static dsql_name* insert_name(const SCHAR*, dsql_name**, dsql_stmt*);
113-
static USHORT name_length(const SCHAR*);
112+
static USHORT name_length(const SCHAR*) noexcept;
114113
static void remove_name(dsql_name*, dsql_name**);
115-
static bool scompare(const SCHAR*, USHORT, const SCHAR*, USHORT);
114+
static bool scompare(const SCHAR*, USHORT, const SCHAR*, USHORT) noexcept;
116115

117116
// declare the private data
118117

@@ -125,7 +124,7 @@ static dsql_dbb* databases = NULL;
125124

126125
Firebird::GlobalPtr<Firebird::RWLock> global_sync;
127126

128-
static inline void set_global_private_status(ISC_STATUS* user_status, ISC_STATUS* local_status)
127+
static inline void set_global_private_status(ISC_STATUS* user_status, ISC_STATUS* local_status) noexcept
129128
{
130129
UDSQL_error->dsql_user_status = user_status;
131130
UDSQL_error->dsql_status = user_status ? user_status : local_status;
@@ -396,7 +395,7 @@ ISC_STATUS API_ROUTINE isc_embed_dsql_fetch_a(ISC_STATUS* user_status,
396395
{
397396
*sqlcode = 0;
398397

399-
ISC_STATUS s = isc_embed_dsql_fetch(user_status, cursor_name, dialect, sqlda);
398+
const ISC_STATUS s = isc_embed_dsql_fetch(user_status, cursor_name, dialect, sqlda);
400399
if (s == 100) {
401400
*sqlcode = 100;
402401
}
@@ -1245,7 +1244,7 @@ static dsql_stmt* lookup_stmt(const TEXT* name, dsql_name* list, name_type type)
12451244
}
12461245

12471246

1248-
static USHORT name_length(const TEXT* name)
1247+
static USHORT name_length(const SCHAR* name) noexcept
12491248
{
12501249
/**************************************
12511250
*
@@ -1259,7 +1258,7 @@ static USHORT name_length(const TEXT* name)
12591258
**************************************/
12601259

12611260
// CVC: Beware, another function that stops at the first blank!!!
1262-
const TEXT* p = name;
1261+
const SCHAR* p = name;
12631262
while (*p && *p != ' ')
12641263
++p;
12651264

@@ -1296,7 +1295,7 @@ static void remove_name(dsql_name* name, dsql_name** list_ptr)
12961295

12971296

12981297
// CVC: It seems I've read at least three versions of this routine.
1299-
static bool scompare(const SCHAR* string1, USHORT length1, const SCHAR* string2, USHORT length2)
1298+
static bool scompare(const SCHAR* string1, USHORT length1, const SCHAR* string2, USHORT length2) noexcept
13001299
{
13011300
/**************************************
13021301
*

0 commit comments

Comments
 (0)