-
-
Notifications
You must be signed in to change notification settings - Fork 262
Fix windows warnings (C4554, C4018) and mark error message constants as constexpr (C26814) #8360
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
2c687ec
f872d55
65d1c7a
2d2ec71
5b1fbdd
d4fc7eb
ad675c4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,32 +17,38 @@ | |
|
|
||
| #ifdef __cplusplus /* c++ definitions */ | ||
|
|
||
| const ISC_STATUS isc_facility = 20; | ||
| const ISC_STATUS isc_base = isc_facility << 24; | ||
| const ISC_STATUS isc_factor = 1; | ||
|
|
||
| const ISC_STATUS isc_arg_end = 0; // end of argument list | ||
| const ISC_STATUS isc_arg_gds = 1; // generic DSRI status value | ||
| const ISC_STATUS isc_arg_string = 2; // string argument | ||
| const ISC_STATUS isc_arg_cstring = 3; // count & string argument | ||
| const ISC_STATUS isc_arg_number = 4; // numeric argument (long) | ||
| const ISC_STATUS isc_arg_interpreted = 5; // interpreted status code (string) | ||
| const ISC_STATUS isc_arg_vms = 6; // VAX/VMS status code (long) | ||
| const ISC_STATUS isc_arg_unix = 7; // UNIX error code | ||
| const ISC_STATUS isc_arg_domain = 8; // Apollo/Domain error code | ||
| const ISC_STATUS isc_arg_dos = 9; // MSDOS/OS2 error code | ||
| const ISC_STATUS isc_arg_mpexl = 10; // HP MPE/XL error code | ||
| const ISC_STATUS isc_arg_mpexl_ipc = 11; // HP MPE/XL IPC error code | ||
| const ISC_STATUS isc_arg_next_mach = 15; // NeXT/Mach error code | ||
| const ISC_STATUS isc_arg_netware = 16; // NetWare error code | ||
| const ISC_STATUS isc_arg_win32 = 17; // Win32 error code | ||
| const ISC_STATUS isc_arg_warning = 18; // warning argument | ||
| const ISC_STATUS isc_arg_sql_state = 19; // SQLSTATE | ||
| #if __cplusplus >= 201703L // C++17 or later | ||
| #define STATUS_EXPR inline constexpr ISC_STATUS | ||
| #else | ||
| #define STATUS_EXPR const ISC_STATUS | ||
| #endif | ||
|
|
||
| STATUS_EXPR isc_facility = 20; | ||
| STATUS_EXPR isc_base = isc_facility << 24; | ||
| STATUS_EXPR isc_factor = 1; | ||
|
|
||
| STATUS_EXPR isc_arg_end = 0; // end of argument list | ||
| STATUS_EXPR isc_arg_gds = 1; // generic DSRI status value | ||
| STATUS_EXPR isc_arg_string = 2; // string argument | ||
| STATUS_EXPR isc_arg_cstring = 3; // count & string argument | ||
| STATUS_EXPR isc_arg_number = 4; // numeric argument (long) | ||
| STATUS_EXPR isc_arg_interpreted = 5; // interpreted status code (string) | ||
| STATUS_EXPR isc_arg_vms = 6; // VAX/VMS status code (long) | ||
| STATUS_EXPR isc_arg_unix = 7; // UNIX error code | ||
| STATUS_EXPR isc_arg_domain = 8; // Apollo/Domain error code | ||
| STATUS_EXPR isc_arg_dos = 9; // MSDOS/OS2 error code | ||
| STATUS_EXPR isc_arg_mpexl = 10; // HP MPE/XL error code | ||
| STATUS_EXPR isc_arg_mpexl_ipc = 11; // HP MPE/XL IPC error code | ||
| STATUS_EXPR isc_arg_next_mach = 15; // NeXT/Mach error code | ||
| STATUS_EXPR isc_arg_netware = 16; // NetWare error code | ||
| STATUS_EXPR isc_arg_win32 = 17; // Win32 error code | ||
| STATUS_EXPR isc_arg_warning = 18; // warning argument | ||
| STATUS_EXPR isc_arg_sql_state = 19; // SQLSTATE | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe name it |
||
|
|
||
| #define FB_IMPL_MSG_NO_SYMBOL(facility, number, text) | ||
|
|
||
| #define FB_IMPL_MSG_SYMBOL(facility, number, symbol, text) \ | ||
| const ISC_STATUS isc_##symbol = FB_IMPL_MSG_ENCODE(number, FB_IMPL_MSG_FACILITY_##facility); | ||
| STATUS_EXPR isc_##symbol = FB_IMPL_MSG_ENCODE(number, FB_IMPL_MSG_FACILITY_##facility); | ||
|
|
||
| #define FB_IMPL_MSG(facility, number, symbol, sqlCode, sqlClass, sqlSubClass, text) \ | ||
| FB_IMPL_MSG_SYMBOL(facility, number, symbol, text) | ||
|
|
@@ -53,7 +59,7 @@ const ISC_STATUS isc_arg_sql_state = 19; // SQLSTATE | |
| #undef FB_IMPL_MSG_SYMBOL | ||
| #undef FB_IMPL_MSG | ||
|
|
||
| const ISC_STATUS isc_err_max = 0 | ||
| STATUS_EXPR isc_err_max = 0 | ||
| #define FB_IMPL_MSG_NO_SYMBOL(facility, number, text) | ||
| #define FB_IMPL_MSG_SYMBOL(facility, number, symbol, text) | ||
| #define FB_IMPL_MSG(facility, number, symbol, sqlCode, sqlClass, sqlSubClass, text) + 1 | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -142,7 +142,7 @@ std::variant<FrontendLexer::SingleStatement, FrontendLexer::IncompleteTokenError | |
|
|
||
| while (pos < end) | ||
| { | ||
| if (end - pos >= term.length() && std::equal(term.begin(), term.end(), pos)) | ||
| if (static_cast<decltype(term.length())>(end - pos) >= term.length() && std::equal(term.begin(), term.end(), pos)) | ||
|
||
| { | ||
| const auto initialStatement = std::string(buffer.cbegin(), pos); | ||
| pos += term.length(); | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.