diff --git a/src/jrd/jrd.cpp b/src/jrd/jrd.cpp index c73dda03c8..dbd4d80628 100644 --- a/src/jrd/jrd.cpp +++ b/src/jrd/jrd.cpp @@ -2844,7 +2844,7 @@ ISC_STATUS GDS_REQUEST_INFO(ISC_STATUS* user_status, // I can't change the GDS_REQUEST_INFO's signature, so I do the casts here. const UCHAR* items2 = reinterpret_cast(items); UCHAR* buffer2 = reinterpret_cast(buffer); - SLONG buffer_length2 = (ULONG) (USHORT) buffer_length; + SLONG buffer_length2 = (ULONG)(USHORT) buffer_length; JRD_request_info(tdbb, request, level, item_length, items2, buffer_length2, buffer2); } catch (const Exception& ex) diff --git a/src/jrd/req.h b/src/jrd/req.h index 3e463351d8..10542389dc 100644 --- a/src/jrd/req.h +++ b/src/jrd/req.h @@ -71,8 +71,8 @@ struct record_param Record* rpb_undo; /* our first version of data if this is a second modification */ USHORT rpb_format_number; /* format number in relation */ - SLONG rpb_page; // page number - USHORT rpb_line; // line number on page + SLONG rpb_page; // page number + USHORT rpb_line; // line number on page SLONG rpb_f_page; /* fragment page number */ USHORT rpb_f_line; /* fragment line number on page */ diff --git a/src/jrd/sqz.cpp b/src/jrd/sqz.cpp index 9673c423fd..3093729837 100644 --- a/src/jrd/sqz.cpp +++ b/src/jrd/sqz.cpp @@ -103,6 +103,7 @@ USHORT SQZ_compress(const DataComprControl* dcc, const SCHAR* input, SCHAR* outp const SCHAR* control = dcc->begin(); const SCHAR* dcc_end = dcc->end(); + while (control < dcc_end) { if (--space <= 0) @@ -143,7 +144,7 @@ USHORT SQZ_compress(const DataComprControl* dcc, const SCHAR* input, SCHAR* outp } } - BUGCHECK(178); /* msg 178 record length inconsistent */ + BUGCHECK(178); // msg 178 record length inconsistent return input - start; // shut up compiler warning } @@ -167,6 +168,7 @@ USHORT SQZ_compress_length(const DataComprControl* dcc, const SCHAR* input, int const SCHAR* control = dcc->begin(); const SCHAR* dcc_end = dcc->end(); + while (control < dcc_end) { if (--space <= 0) @@ -189,7 +191,7 @@ USHORT SQZ_compress_length(const DataComprControl* dcc, const SCHAR* input, int } } - BUGCHECK(178); /* msg 178 record length inconsistent */ + BUGCHECK(178); // msg 178 record length inconsistent return input - start; // shut up compiler warning } @@ -392,6 +394,7 @@ void SQZ_fast(const DataComprControl* dcc, const SCHAR* input, SCHAR* output) **************************************/ const SCHAR* control = dcc->begin(); const SCHAR* dcc_end = dcc->end(); + while (control < dcc_end) { const SSHORT length = *control++; @@ -491,4 +494,3 @@ USHORT SQZ_length(const SCHAR* data, int length, DataComprControl* dcc) return length; } - diff --git a/src/jrd/svc.cpp b/src/jrd/svc.cpp index 2b01f3946a..92a53f1e38 100644 --- a/src/jrd/svc.cpp +++ b/src/jrd/svc.cpp @@ -1038,12 +1038,10 @@ ISC_STATUS Service::query2(thread_db* tdbb, put(items - 3, l + 3); break; case isc_info_svc_timeout: - timeout = - (USHORT) gds__vax_integer(items, l); + timeout = (USHORT) gds__vax_integer(items, l); break; case isc_info_svc_version: - version = - (USHORT) gds__vax_integer(items, l); + version = (USHORT) gds__vax_integer(items, l); break; } } @@ -1067,7 +1065,7 @@ ISC_STATUS Service::query2(thread_db* tdbb, items++; } else { - start_info = 0; + start_info = NULL; } while (items < end_items2 && *items != isc_info_end) @@ -1295,7 +1293,6 @@ ISC_STATUS Service::query2(thread_db* tdbb, } // scope break; - case isc_info_svc_user_dbpath: if (svc_user_flag & SVC_user_dba) { @@ -1348,9 +1345,7 @@ ISC_STATUS Service::query2(thread_db* tdbb, case isc_info_svc_response_more: if ( (l = length = svc_resp_len) ) length = MIN(end - (info + 5), l); - if (! - (info = - INF_put_item(item, length, svc_resp_ptr, info, end))) + if (!(info = INF_put_item(item, length, svc_resp_ptr, info, end))) { return 0; } @@ -1446,10 +1441,8 @@ ISC_STATUS Service::query2(thread_db* tdbb, if (svc_trace_manager->needs().event_service_query) { TraceServiceImpl service(this); - svc_trace_manager->event_service_query(&service, - send_item_length, send_items, - recv_item_length, recv_items, - res_successful); + svc_trace_manager->event_service_query(&service, send_item_length, send_items, + recv_item_length, recv_items, res_successful); } } // try @@ -1464,10 +1457,8 @@ ISC_STATUS Service::query2(thread_db* tdbb, exc == isc_insufficient_svc_privileges); TraceServiceImpl service(this); - svc_trace_manager->event_service_query(&service, - send_item_length, send_items, - recv_item_length, recv_items, - no_priv ? res_unauthorized : res_failed); + svc_trace_manager->event_service_query(&service, send_item_length, send_items, + recv_item_length, recv_items, (no_priv ? res_unauthorized : res_failed)); } throw; } @@ -1851,10 +1842,8 @@ void Service::query(USHORT send_item_length, // Report to Trace API that query failed TraceServiceImpl service(this); - svc_trace_manager->event_service_query(&service, - send_item_length, send_items, - recv_item_length, recv_items, - no_priv ? res_unauthorized : res_failed); + svc_trace_manager->event_service_query(&service, send_item_length, send_items, + recv_item_length, recv_items, (no_priv ? res_unauthorized : res_failed)); } throw; } @@ -1865,10 +1854,8 @@ void Service::query(USHORT send_item_length, svc_trace_manager->needs().event_service_query) { TraceServiceImpl service(this); - svc_trace_manager->event_service_query(&service, - send_item_length, send_items, - recv_item_length, recv_items, - res_successful); + svc_trace_manager->event_service_query(&service, send_item_length, send_items, + recv_item_length, recv_items, res_successful); } finish(SVC_finished); diff --git a/src/jrd/vio.cpp b/src/jrd/vio.cpp index 79e8af29c9..77419c71f0 100644 --- a/src/jrd/vio.cpp +++ b/src/jrd/vio.cpp @@ -3974,6 +3974,7 @@ static THREAD_ENTRY_DECLARE garbage_collector(THREAD_ENTRY_PARAM arg) rpb.rpb_relation = relation; if (relation->rel_gc_bitmap) + { while (relation->rel_gc_bitmap->getFirst()) { const ULONG dp_sequence = relation->rel_gc_bitmap->current(); @@ -4030,6 +4031,7 @@ static THREAD_ENTRY_DECLARE garbage_collector(THREAD_ENTRY_PARAM arg) } } } + } rel_exit: if (relation->rel_gc_bitmap) diff --git a/src/msgs/messages2.sql b/src/msgs/messages2.sql index 2d4d752b91..39347e693e 100644 --- a/src/msgs/messages2.sql +++ b/src/msgs/messages2.sql @@ -764,7 +764,7 @@ Data source : @4', NULL, NULL) -- More extras for isc_expression_eval_err ('sysf_argmustbe_nonzero', 'evlStdMath', 'SysFunction.cpp', NULL, 0, 656, NULL, 'Argument for @1 must be different than zero', NULL, NULL); ('sysf_argmustbe_range_inc1_1', 'evlStdMath', 'SysFunction.cpp', NULL, 0, 657, NULL, 'Argument for @1 must be in the range [-1, 1]', NULL, NULL); -('sysf_argmustbe_gteq_one', 'evlStdMath', 'SysFunction.cpp', NULL, 0, 658, NULL, 'Argument for @1 must be greater o equal than one', NULL, NULL); +('sysf_argmustbe_gteq_one', 'evlStdMath', 'SysFunction.cpp', NULL, 0, 658, NULL, 'Argument for @1 must be greater or equal than one', NULL, NULL); ('sysf_argmustbe_range_exc1_1', 'evlStdMath', 'SysFunction.cpp', NULL, 0, 659, NULL, 'Argument for @1 must be in the range ]-1, 1[', NULL, NULL); -- End of extras for isc_expression_eval_err -- QLI diff --git a/src/qli/gener.cpp b/src/qli/gener.cpp index b5b10b93b4..5ae732e0c2 100644 --- a/src/qli/gener.cpp +++ b/src/qli/gener.cpp @@ -208,7 +208,7 @@ static void explain(qli_dbb* db, const UCHAR* explain_buffer) return; int buffer_length = (unsigned int) *explain_buffer++; - buffer_length += (unsigned int)(*explain_buffer++) << 8; + buffer_length += (unsigned int) (*explain_buffer++) << 8; while (buffer_length > 0) { diff --git a/src/remote/server.cpp b/src/remote/server.cpp index f2037d00f0..ed08029619 100644 --- a/src/remote/server.cpp +++ b/src/remote/server.cpp @@ -83,10 +83,10 @@ public: struct srvr : public Firebird::GlobalStorage { - srvr* const srvr_next; - const rem_port* const srvr_parent_port; - const rem_port::rem_port_t srvr_port_type; - const USHORT srvr_flags; + srvr* const srvr_next; + const rem_port* const srvr_parent_port; + const rem_port::rem_port_t srvr_port_type; + const USHORT srvr_flags; public: srvr(srvr* servers, rem_port* port, USHORT flags) : @@ -263,8 +263,6 @@ static THREAD_ENTRY_DECLARE loopThread(THREAD_ENTRY_PARAM); static void zap_packet(PACKET*, bool); - - inline bool bad_db(ISC_STATUS* status_vector, Rdb* rdb) { return bad_port_context(status_vector, rdb, isc_bad_db_handle); @@ -332,7 +330,7 @@ static server_req_t* free_requests = NULL; static server_req_t* active_requests = NULL; static Firebird::GlobalPtr servers_mutex; -static srvr* servers; +static srvr* servers = NULL; static Firebird::AtomicCounter cntServers; static bool server_shutdown = false;