From: Claudio V. C. <ro...@us...> - 2009-06-24 13:12:04
|
Build Version : T2.5.0.24350 Firebird 2.5 Beta 1 (writeBuildNum.sh,v 1.24514 2009/06/24 12:11:18 robocop Exp ) Update of /cvsroot/firebird/firebird2/src/alice In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv18958/src/alice Modified Files: alice.cpp alice_meta.epp exe.cpp tdr.cpp Log Message: Style. Index: alice.cpp =================================================================== RCS file: /cvsroot/firebird/firebird2/src/alice/alice.cpp,v retrieving revision 1.116 retrieving revision 1.117 diff -b -U3 -r1.116 -r1.117 --- alice.cpp 24 Jun 2009 11:47:08 -0000 1.116 +++ alice.cpp 24 Jun 2009 12:11:16 -0000 1.117 @@ -173,7 +173,8 @@ for (table = alice_in_sw_table; true; ++table) { const TEXT* p = (TEXT*) table->in_sw_name; - if (!p) { + if (!p) + { ALICE_print(2, SafeArg() << (*--argv)); // msg 2: invalid switch %s error = true; break; @@ -193,7 +194,8 @@ if (*table->in_sw_name == 'x') { tdgbl->ALICE_data.ua_debug++; } - if (table->in_sw_value & sw_trusted_svc) { + if (table->in_sw_value & sw_trusted_svc) + { uSvc->checkService(); if (--argc <= 0) { ALICE_error(13); // msg 13: user name required @@ -201,13 +203,15 @@ tdgbl->ALICE_data.ua_tr_user = *argv++; continue; } - if (table->in_sw_value & sw_trusted_role) { + if (table->in_sw_value & sw_trusted_role) + { uSvc->checkService(); tdgbl->ALICE_data.ua_tr_role = true; continue; } #ifdef TRUSTED_AUTH - if (table->in_sw_value & sw_trusted_auth) { + if (table->in_sw_value & sw_trusted_auth) + { tdgbl->ALICE_data.ua_trusted = true; continue; } @@ -240,7 +244,8 @@ found = false; // Consume argument only if we identified mode // Let's hope that database with names of modes above are unusual - if (found) { + if (found) + { argv++; argc--; } @@ -248,7 +253,8 @@ #ifdef DEV_BUILD /* - if (table->in_sw_value & sw_begin_log) { + if (table->in_sw_value & sw_begin_log) + { if (--argc <= 0) { ALICE_error(5); // msg 5: replay log pathname required } @@ -257,7 +263,8 @@ */ #endif - if (table->in_sw_value & sw_buffers) { + if (table->in_sw_value & sw_buffers) + { if (--argc <= 0) { ALICE_error(6); // msg 6: number of page buffers for cache required } @@ -271,7 +278,8 @@ } } - if (table->in_sw_value & sw_housekeeping) { + if (table->in_sw_value & sw_housekeeping) + { if (--argc <= 0) { ALICE_error(9); // msg 9: number of transactions per sweep required } @@ -285,15 +293,15 @@ } } - if (table->in_sw_value & sw_set_db_dialect) { + if (table->in_sw_value & sw_set_db_dialect) + { if (--argc <= 0) { ALICE_error(113); // msg 113: dialect number required } ALICE_down_case(*argv++, string, sizeof(string)); - if ((!(tdgbl->ALICE_data.ua_db_SQL_dialect = atoi(string))) && - (strcmp(string, "0"))) + if ((!(tdgbl->ALICE_data.ua_db_SQL_dialect = atoi(string))) && (strcmp(string, "0"))) { ALICE_error(7); // msg 7: numeric value required } @@ -306,12 +314,14 @@ // } } - if (table->in_sw_value & (sw_commit | sw_rollback | sw_two_phase)) { + if (table->in_sw_value & (sw_commit | sw_rollback | sw_two_phase)) + { if (--argc <= 0) { ALICE_error(10); // msg 10: transaction number or "all" required } ALICE_down_case(*argv++, string, sizeof(string)); - if (!(tdgbl->ALICE_data.ua_transaction = atoi(string))) { + if (!(tdgbl->ALICE_data.ua_transaction = atoi(string))) + { if (strcmp(string, "all")) { ALICE_error(10); // msg 10: transaction number or "all" required } @@ -321,7 +331,8 @@ } } - if (table->in_sw_value & sw_write) { + if (table->in_sw_value & sw_write) + { if (--argc <= 0) { ALICE_error(11); // msg 11: "sync" or "async" required } @@ -337,7 +348,8 @@ } } - if (table->in_sw_value & sw_no_reserve) { + if (table->in_sw_value & sw_no_reserve) + { if (--argc <= 0) { ALICE_error(12); // msg 12: "full" or "reserve" required } @@ -353,14 +365,16 @@ } } - if (table->in_sw_value & sw_user) { + if (table->in_sw_value & sw_user) + { if (--argc <= 0) { ALICE_error(13); // msg 13: user name required } tdgbl->ALICE_data.ua_user = *argv++; } - if (table->in_sw_value & sw_password) { + if (table->in_sw_value & sw_password) + { if (--argc <= 0) { ALICE_error(14); // msg 14: password required } @@ -393,7 +407,8 @@ ++argv; } - if (table->in_sw_value & sw_disable) { + if (table->in_sw_value & sw_disable) + { if (--argc <= 0) { ALICE_error(15); // msg 15: subsystem name } @@ -403,7 +418,8 @@ } } - if (table->in_sw_value & (sw_attach | sw_force | sw_tran | sw_cache)) { + if (table->in_sw_value & (sw_attach | sw_force | sw_tran | sw_cache)) + { if (--argc <= 0) { ALICE_error(17); // msg 17: number of seconds required } @@ -419,7 +435,8 @@ } } - if (table->in_sw_value & sw_mode) { + if (table->in_sw_value & sw_mode) + { if (--argc <= 0) { ALICE_error(110); // msg 110: "read_only" or "read_write" required } @@ -503,17 +520,21 @@ { bool any_error = false; - for (int i = 0; i < MAX_VAL_ERRORS; ++i) { - if (ua_val_errors[i]) { + for (int i = 0; i < MAX_VAL_ERRORS; ++i) + { + if (ua_val_errors[i]) + { any_error = true; break; } } - if (any_error) { + if (any_error) + { ALICE_print(24); // msg 24: Summary of validation errors\n - for (int i = 0; i < MAX_VAL_ERRORS; ++i) { + for (int i = 0; i < MAX_VAL_ERRORS; ++i) + { if (ua_val_errors[i]) { ALICE_print(val_err_table[i], SafeArg() << ua_val_errors[i]); } @@ -522,7 +543,8 @@ } } - if (ret == FINI_ERROR) { + if (ret == FINI_ERROR) + { ALICE_print_status(tdgbl->status); ALICE_exit(FINI_ERROR, tdgbl); } Index: alice_meta.epp =================================================================== RCS file: /cvsroot/firebird/firebird2/src/alice/alice_meta.epp,v retrieving revision 1.57 retrieving revision 1.58 diff -b -U3 -r1.57 -r1.58 --- alice_meta.epp 26 Apr 2009 10:24:13 -0000 1.57 +++ alice_meta.epp 24 Jun 2009 12:11:16 -0000 1.58 @@ -177,7 +177,8 @@ const USHORT capabilities = get_capabilities(user_status); - if (capabilities & CAP_transactions) { + if (capabilities & CAP_transactions) + { FOR(REQUEST_HANDLE request) TRA IN RDB$TRANSACTIONS WITH TRA.RDB$TRANSACTION_ID = id AND @@ -305,9 +306,11 @@ const TEXT* p = buffer; const USHORT length = snarf_blob(blob_id, (USHORT) sizeof(buffer), buffer); - if (length) { + if (length) + { p = bigger_buffer = (TEXT *) gds__alloc((SLONG) length); - if (!p) { + if (!p) + { tdgbl->status[0] = isc_arg_gds; tdgbl->status[1] = isc_virmemexh; tdgbl->status[2] = isc_arg_end; @@ -347,7 +350,8 @@ if (!trans) { trans = ptr = FB_NEW(*tdgbl->getDefaultPool()) tdr; } - else { + else + { ptr->tdr_next = FB_NEW(*tdgbl->getDefaultPool()) tdr; ptr = ptr->tdr_next; } @@ -409,7 +413,8 @@ while (*q && *q != '/' && *q != '\\') q++; - if (*q) { + if (*q) + { trans->tdr_filename = q + 1; trans->tdr_remote_site = FB_NEW_RPT(*tdgbl->getDefaultPool(), q - p + 1) alice_str; @@ -443,7 +448,8 @@ --p; ++p; - if (length) { + if (length) + { trans->tdr_remote_site = FB_NEW_RPT(*tdgbl->getDefaultPool(), length + 1) alice_str; TEXT* q = (TEXT *) trans->tdr_remote_site->str_data; while (length--) @@ -481,7 +487,8 @@ TEXT* ptr = buffer; const TEXT* const end = buffer + buffer_length; - for (;;) { + for (;;) + { if (ptr >= end) break; if (!(buffer_length = end - ptr)) @@ -497,7 +504,8 @@ if (!buffer_length) { - for (;;) { + for (;;) + { USHORT returned_length; ISC_STATUS status = isc_get_segment(gds_status, &blob, &returned_length, buffer_length, buffer); Index: exe.cpp =================================================================== RCS file: /cvsroot/firebird/firebird2/src/alice/exe.cpp,v retrieving revision 1.60 retrieving revision 1.61 diff -b -U3 -r1.60 -r1.61 --- exe.cpp 17 Apr 2009 14:10:05 -0000 1.60 +++ exe.cpp 24 Jun 2009 12:11:16 -0000 1.61 @@ -207,7 +207,8 @@ else if (switches & sw_activate) { dpb.insertTag(isc_dpb_activate_shadow); } - else if (switches & sw_validate) { + else if (switches & sw_validate) + { UCHAR b = isc_dpb_pages; if (switches & sw_full) b |= isc_dpb_records; @@ -223,7 +224,8 @@ dpb.insertInt(isc_dpb_sweep_interval, tdgbl->ALICE_data.ua_sweep_interval); } /* - else if (switches & sw_begin_log) { + else if (switches & sw_begin_log) + { dpb.insertString(isc_dpb_begin_log, tdgbl->ALICE_data.ua_log_file, strlen(tdgbl->ALICE_data.ua_log_file)); @@ -318,25 +320,30 @@ dpb.insertInt(isc_dpb_set_db_sql_dialect, tdgbl->ALICE_data.ua_db_SQL_dialect); } - if (tdgbl->ALICE_data.ua_user) { + if (tdgbl->ALICE_data.ua_user) + { dpb.insertString(isc_dpb_user_name, tdgbl->ALICE_data.ua_user, strlen(tdgbl->ALICE_data.ua_user)); } - if (tdgbl->ALICE_data.ua_password) { + if (tdgbl->ALICE_data.ua_password) + { dpb.insertString(tdgbl->uSvc->isService() ? isc_dpb_password_enc : isc_dpb_password, tdgbl->ALICE_data.ua_password, strlen(tdgbl->ALICE_data.ua_password)); } - if (tdgbl->ALICE_data.ua_tr_user) { + if (tdgbl->ALICE_data.ua_tr_user) + { tdgbl->uSvc->checkService(); dpb.insertString(isc_dpb_trusted_auth, tdgbl->ALICE_data.ua_tr_user, strlen(tdgbl->ALICE_data.ua_tr_user)); } - if (tdgbl->ALICE_data.ua_tr_role) { + if (tdgbl->ALICE_data.ua_tr_role) + { tdgbl->uSvc->checkService(); dpb.insertString(isc_dpb_trusted_role, ADMIN_ROLE, strlen(ADMIN_ROLE)); } #ifdef TRUSTED_AUTH - if (tdgbl->ALICE_data.ua_trusted) { + if (tdgbl->ALICE_data.ua_trusted) + { if (!dpb.find(isc_dpb_trusted_auth)) { dpb.insertTag(isc_dpb_trusted_auth); } Index: tdr.cpp =================================================================== RCS file: /cvsroot/firebird/firebird2/src/alice/tdr.cpp,v retrieving revision 1.62 retrieving revision 1.63 diff -b -U3 -r1.62 -r1.63 --- tdr.cpp 21 Jun 2009 10:35:21 -0000 1.62 +++ tdr.cpp 24 Jun 2009 12:11:16 -0000 1.63 @@ -102,7 +102,8 @@ // perverse case of a rollback, otherwise a commit if at all possible case TRA_commit: - if (state == TRA_rollback) { + if (state == TRA_rollback) + { ALICE_print(105); // msg 105: Warning: Multidatabase transaction is in inconsistent state for recovery. ALICE_print(106, SafeArg() << trans->tdr_id); @@ -134,7 +135,8 @@ // transaction has committed or is assumed committed case TRA_rollback: - if ((state == TRA_commit) || (state == TRA_none)) { + if ((state == TRA_commit) || (state == TRA_none)) + { ALICE_print(105); // msg 105: Warning: Multidatabase transaction is in inconsistent state for recovery. ALICE_print(107, SafeArg() << trans->tdr_id); @@ -196,17 +198,20 @@ if (tdgbl->ALICE_data.ua_user) { dpb.insertString(isc_dpb_user_name, tdgbl->ALICE_data.ua_user, strlen(tdgbl->ALICE_data.ua_user)); } - if (tdgbl->ALICE_data.ua_password) { + if (tdgbl->ALICE_data.ua_password) + { dpb.insertString(tdgbl->uSvc->isService() ? isc_dpb_password_enc : isc_dpb_password, tdgbl->ALICE_data.ua_password, strlen(tdgbl->ALICE_data.ua_password)); } - if (tdgbl->ALICE_data.ua_tr_user) { + if (tdgbl->ALICE_data.ua_tr_user) + { tdgbl->uSvc->checkService(); dpb.insertString(isc_dpb_trusted_auth, tdgbl->ALICE_data.ua_tr_user, strlen(reinterpret_cast<const char*>(tdgbl->ALICE_data.ua_tr_user))); } - if (tdgbl->ALICE_data.ua_tr_role) { + if (tdgbl->ALICE_data.ua_tr_role) + { tdgbl->uSvc->checkService(); dpb.insertString(isc_dpb_trusted_role, ADMIN_ROLE, strlen(ADMIN_ROLE)); } @@ -217,8 +222,10 @@ &trans->tdr_db_handle, dpb.getBufferLength(), reinterpret_cast<const char*>(dpb.getBuffer())); - if (status_vector[1]) { - if (tdgbl->ALICE_data.ua_debug) { + if (status_vector[1]) + { + if (tdgbl->ALICE_data.ua_debug) + { ALICE_print(69); // msg 69: failed ALICE_print_status(status_vector); } @@ -389,7 +396,8 @@ const USHORT advice = TDR_analyze(trans); - if (!advice) { + if (!advice) + { print_description(trans); switches = ask(); } @@ -398,7 +406,8 @@ switch (advice) { case TRA_rollback: - if (switches & sw_commit) { + if (switches & sw_commit) + { ALICE_print(74, SafeArg() << trans->tdr_id); // msg 74: A commit of transaction %ld will violate two-phase commit. print_description(trans); @@ -408,7 +417,8 @@ switches |= sw_rollback; else if (switches & sw_two_phase) switches |= sw_rollback; - else if (switches & sw_prompt) { + else if (switches & sw_prompt) + { ALICE_print(75, SafeArg() << trans->tdr_id); // msg 75: A rollback of transaction %ld is needed to preserve two-phase commit. print_description(trans); @@ -417,7 +427,8 @@ break; case TRA_commit: - if (switches & sw_rollback) { + if (switches & sw_rollback) + { ALICE_print(76, SafeArg() << trans->tdr_id); // msg 76: Transaction %ld has already been partially committed. ALICE_print(77); @@ -732,7 +743,8 @@ // attaching using the old method didn't work; // try attaching to the remote node directly - if (trans->tdr_remote_site) { + if (trans->tdr_remote_site) + { char* p = buffer; const UCHAR* q = trans->tdr_remote_site->str_data; while (*q && p < end) @@ -823,11 +835,13 @@ return true; } - if (!(switches & (sw_commit | sw_rollback))) { + if (!(switches & (sw_commit | sw_rollback))) + { ALICE_print(91, SafeArg() << number); // msg 91: Transaction %ld: switches = ask(); - if (switches == ULONG(~0)) { + if (switches == ULONG(~0)) + { ALICE_print(84); // msg 84: unexpected end of input return true; @@ -841,7 +855,8 @@ else return false; - if (status_vector[1]) { + if (status_vector[1]) + { ALICE_print_status(status_vector); return true; } |