@@ -124,8 +124,8 @@ const ParametersSet connectParam =
124124};
125125
126126
127- const SLONG DUMMY_INTERVAL = 60 ; // seconds
128- const int ATTACH_FAILURE_SPACE = 16 * 1024 ; // bytes
127+ constexpr SLONG DUMMY_INTERVAL = 60 ; // seconds
128+ constexpr int ATTACH_FAILURE_SPACE = 16 * 1024 ; // bytes
129129
130130
131131void REMOTE_cleanup_transaction ( Rtr* transaction)
@@ -172,9 +172,9 @@ void REMOTE_cleanup_transaction( Rtr* transaction)
172172}
173173
174174
175- USHORT REMOTE_compute_batch_size (rem_port* port,
175+ USHORT REMOTE_compute_batch_size (const rem_port* port,
176176 USHORT buffer_used, P_OP op_code,
177- const rem_fmt* format)
177+ const rem_fmt* format) noexcept
178178{
179179/* *************************************
180180 *
@@ -231,9 +231,9 @@ USHORT REMOTE_compute_batch_size(rem_port* port,
231231#endif
232232
233233 const ULONG row_size = op_overhead +
234- (port->port_flags & PORT_symmetric) ?
235- ROUNDUP (format->fmt_length , 4 ) : // Same architecture connection
236- ROUNDUP (format->fmt_net_length , 4 ); // Using XDR for data transfer
234+ (( port->port_flags & PORT_symmetric) ?
235+ ROUNDUP (format->fmt_length , 4 ) : // Same architecture connection
236+ ROUNDUP (format->fmt_net_length , 4 )) ; // Using XDR for data transfer
237237
238238 ULONG result = (port->port_protocol >= PROTOCOL_VERSION13) ?
239239 MAX_ROWS_PER_BATCH : (MAX_PACKETS_PER_BATCH * port->port_buff_size - buffer_used) / row_size;
@@ -309,7 +309,7 @@ Rrq* REMOTE_find_request(Rrq* request, USHORT level)
309309}
310310
311311
312- void REMOTE_free_packet ( rem_port* port, PACKET * packet, bool partial)
312+ void REMOTE_free_packet (rem_port* port, PACKET* packet, bool partial)
313313{
314314/* *************************************
315315 *
@@ -416,7 +416,7 @@ rem_str* REMOTE_make_string(const SCHAR* input)
416416}
417417
418418
419- void REMOTE_release_messages ( RMessage* messages)
419+ void REMOTE_release_messages (RMessage* messages) noexcept
420420{
421421/* *************************************
422422 *
@@ -446,7 +446,7 @@ void REMOTE_release_messages( RMessage* messages)
446446}
447447
448448
449- void REMOTE_release_request ( Rrq* request)
449+ void REMOTE_release_request (Rrq* request) noexcept
450450{
451451/* *************************************
452452 *
@@ -501,7 +501,7 @@ void REMOTE_release_request( Rrq* request)
501501}
502502
503503
504- void REMOTE_reset_request ( Rrq* request, RMessage* active_message)
504+ void REMOTE_reset_request (Rrq* request, const RMessage* active_message)
505505{
506506/* *************************************
507507 *
@@ -537,13 +537,11 @@ void REMOTE_reset_request( Rrq* request, RMessage* active_message)
537537 }
538538
539539 // Initialize the request status to FB_SUCCESS
540-
541- // request->rrq_status_vector[1] = 0;
542540 request->rrqStatus .clear ();
543541}
544542
545543
546- void REMOTE_reset_statement ( Rsr* statement)
544+ void REMOTE_reset_statement (Rsr* statement) noexcept
547545{
548546/* *************************************
549547 *
@@ -613,7 +611,7 @@ RefPtr<const Config> rem_port::getPortConfig()
613611 return port_config.hasData () ? port_config : Config::getDefaultConfig ();
614612}
615613
616- void rem_port::unlinkParent ()
614+ void rem_port::unlinkParent () noexcept
617615{
618616 if (this ->port_parent == NULL )
619617 return ;
@@ -647,7 +645,7 @@ void rem_port::unlinkParent()
647645 this ->port_parent = NULL ;
648646}
649647
650- bool rem_port::accept (p_cnct* cnct)
648+ bool rem_port::accept (const p_cnct* cnct)
651649{
652650 return (*this ->port_accept )(this , cnct);
653651}
@@ -984,7 +982,7 @@ Rbl* Rtr::createInlineBlob()
984982 return blb;
985983};
986984
987- void Rtr::setupInlineBlob (P_INLINE_BLOB* p_blob)
985+ void Rtr::setupInlineBlob (const P_INLINE_BLOB* p_blob)
988986{
989987 fb_assert (p_blob->p_tran_id == this ->rtr_id );
990988 fb_assert (rtr_inline_blob);
@@ -1004,7 +1002,7 @@ void Rtr::setupInlineBlob(P_INLINE_BLOB* p_blob)
10041002 }
10051003
10061004 blb->rbl_blob_id = p_blob->p_blob_id ;
1007- if (Rbl* old = rtr_blobs.locate (blb->rbl_blob_id ))
1005+ if (const Rbl* old = rtr_blobs.locate (blb->rbl_blob_id ))
10081006 {
10091007 // Blob with the same blob id already exists. It could be in use, or it
10101008 // could be opened by user explicitly with custom BPB - thus delete new one.
@@ -1051,16 +1049,16 @@ string rem_port::getRemoteId() const
10511049 return id;
10521050}
10531051
1054- LegacyPlugin REMOTE_legacy_auth (const char * nm, int p)
1052+ LegacyPlugin REMOTE_legacy_auth (const char * nm, int p) noexcept
10551053{
1056- const char * legacyTrusted = " WIN_SSPI" ;
1054+ constexpr const char * legacyTrusted = " WIN_SSPI" ;
10571055 if (fb_utils::stricmp (legacyTrusted, nm) == 0 &&
10581056 (p == PROTOCOL_VERSION11 || p == PROTOCOL_VERSION12))
10591057 {
10601058 return PLUGIN_TRUSTED;
10611059 }
10621060
1063- const char * legacyAuth = " LEGACY_AUTH" ;
1061+ constexpr const char * legacyAuth = " LEGACY_AUTH" ;
10641062 if (fb_utils::stricmp (legacyAuth, nm) == 0 && p < PROTOCOL_VERSION13)
10651063 {
10661064 return PLUGIN_LEGACY;
@@ -1184,7 +1182,7 @@ void ClntAuthBlock::resetClnt(const CSTRING* listStr)
11841182 plugins.set (final .c_str ());
11851183}
11861184
1187- RefPtr<const Config>* ClntAuthBlock::getConfig ()
1185+ RefPtr<const Config>* ClntAuthBlock::getConfig () noexcept
11881186{
11891187 return clntConfig.hasData () ? &clntConfig : NULL ;
11901188}
@@ -1213,7 +1211,7 @@ RefPtr<const Config> REMOTE_get_config(const PathName* dbName,
12131211 return config;
12141212}
12151213
1216- void REMOTE_check_response (IStatus* warning, Rdb* rdb, PACKET* packet, bool checkKeys)
1214+ void REMOTE_check_response (IStatus* warning, Rdb* rdb, const PACKET* packet, bool checkKeys)
12171215{
12181216/* *************************************
12191217 *
@@ -1229,7 +1227,7 @@ void REMOTE_check_response(IStatus* warning, Rdb* rdb, PACKET* packet, bool chec
12291227 rdb->rdb_port ->checkResponse (warning, packet, checkKeys);
12301228}
12311229
1232- void rem_port::checkResponse (IStatus* warning, PACKET* packet, bool checkKeys)
1230+ void rem_port::checkResponse (IStatus* warning, const PACKET* packet, bool checkKeys)
12331231{
12341232/* *************************************
12351233 *
@@ -1244,7 +1242,7 @@ void rem_port::checkResponse(IStatus* warning, PACKET* packet, bool checkKeys)
12441242
12451243 // Get status vector
12461244
1247- const ISC_STATUS success_vector[] = {isc_arg_gds, FB_SUCCESS, isc_arg_end};
1245+ constexpr ISC_STATUS success_vector[] = {isc_arg_gds, FB_SUCCESS, isc_arg_end};
12481246 const ISC_STATUS *vector = success_vector;
12491247 if (packet->p_resp .p_resp_status_vector )
12501248 {
@@ -1269,7 +1267,7 @@ void rem_port::checkResponse(IStatus* warning, PACKET* packet, bool checkKeys)
12691267
12701268 case isc_arg_cstring:
12711269 newVector.push (*vector++);
1272- // fall down
1270+ [[fallthrough]];
12731271
12741272 default :
12751273 newVector.push (*vector++);
@@ -1291,16 +1289,16 @@ void rem_port::checkResponse(IStatus* warning, PACKET* packet, bool checkKeys)
12911289 }
12921290
12931291 if ((packet->p_operation == op_response || packet->p_operation == op_response_piggyback) &&
1294- !vector[ 1 ] )
1292+ !pktErr )
12951293 {
12961294 Arg::StatusVector s (vector);
12971295 s.copyTo (warning);
12981296 return ;
12991297 }
13001298
1301- HANDSHAKE_DEBUG (fprintf (stderr, " Raising exception %d in checkResponse\n " , vector[ 1 ] ? vector[ 1 ] : isc_net_read_err));
1299+ HANDSHAKE_DEBUG (fprintf (stderr, " Raising exception %d in checkResponse\n " , pktErr ? pktErr : isc_net_read_err));
13021300
1303- if (!vector[ 1 ] )
1301+ if (!pktErr )
13041302 {
13051303 Arg::Gds (isc_net_read_err).raise ();
13061304 }
@@ -1451,7 +1449,7 @@ bool rem_port::tryKeyType(const KnownServerKey& srvKey, InternalCryptKey* cryptK
14511449 return false ;
14521450}
14531451
1454- const char * SrvAuthBlock::getLogin ()
1452+ const char * SrvAuthBlock::getLogin () noexcept
14551453{
14561454 return userName.nullStr ();
14571455}
@@ -1823,7 +1821,7 @@ const void* InternalCryptKey::getDecryptKey(unsigned* length)
18231821}
18241822
18251823
1826- signed char wcCompatible[3 ][3 ] = {
1824+ const signed char wcCompatible[3 ][3 ] = {
18271825/* DISABLED ENABLED REQUIRED */
18281826/* DISABLED */ {WIRECRYPT_DISABLED, WIRECRYPT_DISABLED, WIRECRYPT_BROKEN},
18291827/* ENABLED */ {WIRECRYPT_DISABLED, WIRECRYPT_ENABLED, WIRECRYPT_REQUIRED},
0 commit comments