diff --git a/src/dsql/parse.y b/src/dsql/parse.y index 7c71ab6292..8dbf28ef61 100644 --- a/src/dsql/parse.y +++ b/src/dsql/parse.y @@ -2051,22 +2051,22 @@ trigger_active : ACTIVE trigger_type : trigger_type_prefix trigger_type_suffix - { $$ = MAKE_trigger_type ($1, $2); } + { $$ = MAKE_trigger_type ($1, $2); } | ON trigger_db_type - { $$ = $2; } + { $$ = $2; } ; trigger_db_type : CONNECT - { $$ = MAKE_constant ((dsql_str*) (TRIGGER_TYPE_DB | DB_TRIGGER_CONNECT), CONSTANT_SLONG); } + { $$ = MAKE_constant ((dsql_str*) (TRIGGER_TYPE_DB | DB_TRIGGER_CONNECT), CONSTANT_SLONG); } | DISCONNECT - { $$ = MAKE_constant ((dsql_str*) (TRIGGER_TYPE_DB | DB_TRIGGER_DISCONNECT), CONSTANT_SLONG); } + { $$ = MAKE_constant ((dsql_str*) (TRIGGER_TYPE_DB | DB_TRIGGER_DISCONNECT), CONSTANT_SLONG); } | TRANSACTION START - { $$ = MAKE_constant ((dsql_str*) (TRIGGER_TYPE_DB | DB_TRIGGER_TRANS_START), CONSTANT_SLONG); } + { $$ = MAKE_constant ((dsql_str*) (TRIGGER_TYPE_DB | DB_TRIGGER_TRANS_START), CONSTANT_SLONG); } | TRANSACTION COMMIT - { $$ = MAKE_constant ((dsql_str*) (TRIGGER_TYPE_DB | DB_TRIGGER_TRANS_COMMIT), CONSTANT_SLONG); } + { $$ = MAKE_constant ((dsql_str*) (TRIGGER_TYPE_DB | DB_TRIGGER_TRANS_COMMIT), CONSTANT_SLONG); } | TRANSACTION ROLLBACK - { $$ = MAKE_constant ((dsql_str*) (TRIGGER_TYPE_DB | DB_TRIGGER_TRANS_ROLLBACK), CONSTANT_SLONG); } + { $$ = MAKE_constant ((dsql_str*) (TRIGGER_TYPE_DB | DB_TRIGGER_TRANS_ROLLBACK), CONSTANT_SLONG); } ; trigger_type_prefix : BEFORE diff --git a/src/jrd/alt.cpp b/src/jrd/alt.cpp index 200f6f3850..a8064f7253 100644 --- a/src/jrd/alt.cpp +++ b/src/jrd/alt.cpp @@ -118,8 +118,9 @@ SLONG API_ROUTINE_VARARG isc_event_block(UCHAR** event_buffer, const char* q = va_arg(ptr, SCHAR *); /* Strip the blanks from the ends */ - const char* end; - for (end = q + strlen(q); --end >= q && *end == ' ';); + const char* end = q + strlen(q); + while (--end >= q && *end == ' ') + ; *p++ = end - q + 1; while (q <= end) *p++ = *q++; @@ -164,8 +165,9 @@ const int MAX_NAME_LENGTH = 31; const TEXT* const q = *nb++; /* Strip trailing blanks from string */ - const char* end; - for (end = q + MAX_NAME_LENGTH; --end >= q && *end == ' ';); + const char* end = q + MAX_NAME_LENGTH; + while (--end >= q && *end == ' ') + ; length += end - q + 1 + 5; } @@ -197,8 +199,9 @@ const int MAX_NAME_LENGTH = 31; const TEXT* q = *nb++; /* Strip trailing blanks from string */ - const char* end; - for (end = q + MAX_NAME_LENGTH; --end >= q && *end == ' ';); + const char* end = q + MAX_NAME_LENGTH; + while (--end >= q && *end == ' ') + ; *p++ = end - q + 1; while (q <= end) *p++ = *q++; diff --git a/src/jrd/dfw.epp b/src/jrd/dfw.epp index 331894ec27..49f829c914 100644 --- a/src/jrd/dfw.epp +++ b/src/jrd/dfw.epp @@ -2117,7 +2117,7 @@ static bool create_trigger(thread_db* tdbb, SSHORT phase, DeferredWork* work, case 4: { - DeferredWork* arg = work->dfw_args; + const DeferredWork* arg = work->dfw_args; while (arg && (arg->dfw_type != dfw_arg_rel_name)) arg = arg->dfw_next; @@ -2698,7 +2698,7 @@ static bool delete_parameter( thread_db* tdbb, case 1: /* hvlad: temporary disable procedure parameters dependency check until proper solution (something like dyn_mod_parameter) - will be implemented. This check was never worked properly + will be implemented. This check never worked properly so no harm is done if (MET_lookup_procedure_id(tdbb, work->dfw_id, false, true, 0)) @@ -3255,7 +3255,7 @@ static bool delete_trigger( thread_db* tdbb, case 4: { - DeferredWork* arg = work->dfw_args; + const DeferredWork* arg = work->dfw_args; while (arg && (arg->dfw_type != dfw_arg_rel_name)) arg = arg->dfw_next; @@ -3329,7 +3329,7 @@ static bool find_depend_in_dfw( thread_db* tdbb, /* Look to see if an object of the desired type is being deleted. */ - for (DeferredWork* work = transaction->tra_deferred_work; work; + for (const DeferredWork* work = transaction->tra_deferred_work; work; work = work->dfw_next) { if ((work->dfw_type == dfw_type || @@ -4339,7 +4339,7 @@ static bool modify_trigger(thread_db* tdbb, SSHORT phase, DeferredWork* work, case 3: { - DeferredWork* arg = work->dfw_args; + const DeferredWork* arg = work->dfw_args; while (arg && (arg->dfw_type != dfw_arg_rel_name)) arg = arg->dfw_next; @@ -4681,8 +4681,7 @@ static void release_protect_lock(thread_db* tdbb, jrd_tra* transaction, Lock* re vec* vector = transaction->tra_relation_locks; if (vector) { vec::iterator lock = vector->begin(); - for (ULONG i = 0; i < vector->count(); - ++i, ++lock) + for (ULONG i = 0; i < vector->count(); ++i, ++lock) { if (*lock == relLock) { diff --git a/src/jrd/exe.cpp b/src/jrd/exe.cpp index b9593e2396..724d6e647f 100644 --- a/src/jrd/exe.cpp +++ b/src/jrd/exe.cpp @@ -499,7 +499,7 @@ void EXE_execute_db_triggers(thread_db* tdbb, * Execute database triggers * **************************************/ - // do nothing if user don't want database triggers + // do nothing if user doesn't want database triggers if (tdbb->tdbb_attachment->att_flags & ATT_no_db_triggers) return; diff --git a/src/jrd/jrd.cpp b/src/jrd/jrd.cpp index f6d1beb7e5..4bb86501a7 100644 --- a/src/jrd/jrd.cpp +++ b/src/jrd/jrd.cpp @@ -6173,25 +6173,25 @@ static bool rollback(thread_db* tdbb, check_database(tdbb, transaction->tra_attachment, status_vector); try { - if (!(tdbb->tdbb_attachment->att_flags & ATT_no_db_triggers)) - { - ISC_STATUS_ARRAY temp_status = {0}; - tdbb->tdbb_status_vector = temp_status; - - try + if (!(tdbb->tdbb_attachment->att_flags & ATT_no_db_triggers)) { - EXE_execute_db_triggers(tdbb, transaction, jrd_req::req_trigger_trans_rollback); - } - catch (const Firebird::Exception&) - { - } - } + ISC_STATUS_ARRAY temp_status = {0}; + tdbb->tdbb_status_vector = temp_status; - tdbb->tdbb_status_vector = status_vector; + try + { + EXE_execute_db_triggers(tdbb, transaction, jrd_req::req_trigger_trans_rollback); + } + catch (const Firebird::Exception&) + { + } + } - TRA_rollback(tdbb, transaction, retaining_flag, false); - Database* dbb = tdbb->tdbb_database; - --dbb->dbb_use_count; + tdbb->tdbb_status_vector = status_vector; + + TRA_rollback(tdbb, transaction, retaining_flag, false); + Database* dbb = tdbb->tdbb_database; + --dbb->dbb_use_count; } // try catch (const Firebird::Exception& ex) {