From 63773569409cc270dbc27ccd86e00faf2fa7e212 Mon Sep 17 00:00:00 2001 From: asfernandes Date: Thu, 23 Jul 2009 00:56:28 +0000 Subject: [PATCH] Misc --- .../linux/misc/firebird.init.d.mandrake.in | 2 +- configure.in | 6 ++-- src/alice/alice.cpp | 2 +- src/alice/exe_proto.h | 1 - src/alice/tdr.cpp | 2 -- src/common/classes/ClumpletReader.cpp | 12 +++---- src/common/classes/ClumpletWriter.cpp | 12 +++---- src/common/classes/FpeControl.h | 8 ++--- src/common/classes/fb_atomic.h | 6 ++-- src/common/fb_exception.cpp | 3 +- src/gpre/cme_proto.h | 1 - src/include/fb_exception.h | 1 - src/isql/isql.epp | 36 +++++++++++++++++-- src/isql/isql.h | 1 - src/isql/show.epp | 5 ++- src/jrd/blb.cpp | 5 ++- src/jrd/isc_sync.cpp | 2 +- src/msgs/enter_msgs.epp | 2 +- src/qli/help.epp | 9 ++--- src/remote/os/win32/window.h | 4 +-- src/utilities/install/registry.h | 1 - 21 files changed, 70 insertions(+), 51 deletions(-) diff --git a/builds/install/arch-specific/linux/misc/firebird.init.d.mandrake.in b/builds/install/arch-specific/linux/misc/firebird.init.d.mandrake.in index 123c9f6403..52e3197114 100644 --- a/builds/install/arch-specific/linux/misc/firebird.init.d.mandrake.in +++ b/builds/install/arch-specific/linux/misc/firebird.init.d.mandrake.in @@ -53,7 +53,7 @@ case "$1" in echo -n "$FULLNAME server is stopped" echo fi - [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$name + [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$name ;; status) if [ -f $pidfile ] diff --git a/configure.in b/configure.in index 789876b15c..8696771353 100644 --- a/configure.in +++ b/configure.in @@ -424,8 +424,8 @@ AC_ARG_WITH(system-editline, READLINE=edit # builtin default saveLIBS=$LIBS if test "$STD_EDITLINE" = "true"; then - AC_CHECK_LIB(edit, readline, READLINE=edit, - AC_CHECK_LIB(editline, readline, READLINE=editline, + AC_CHECK_LIB(edit, readline, READLINE=edit, + AC_CHECK_LIB(editline, readline, READLINE=editline, AC_CHECK_LIB(readline, readline, READLINE=readline, STD_EDITLINE=false))) fi if test "$STD_EDITLINE" = "true"; then @@ -802,8 +802,8 @@ case "$PLATFORM" in dnl MOD: Check for /proc/self/exe mainly used on linux systems dnl this is used to determine path to executable file. AC_CHECK_FILES(/proc/self/exe) - ;; + FREEBSD|GENTOOFREEBSD) dnl the AC_CHECK_TYPES for socklen_t doesn't include sys/socket.h dnl so test for socklen_t with sys/socket.h included diff --git a/src/alice/alice.cpp b/src/alice/alice.cpp index bdb050daad..fa1f9c852e 100644 --- a/src/alice/alice.cpp +++ b/src/alice/alice.cpp @@ -475,7 +475,7 @@ int alice(Firebird::UtilSvc* uSvc) } if (!flags || !(flags & ~(sw_user | sw_password | sw_fetch_password | - sw_trusted_auth | sw_trusted_svc | sw_trusted_role))) + sw_trusted_auth | sw_trusted_svc | sw_trusted_role))) { if (!help && !uSvc->isService()) { diff --git a/src/alice/exe_proto.h b/src/alice/exe_proto.h index 07d4abf22b..6cbe6aa230 100644 --- a/src/alice/exe_proto.h +++ b/src/alice/exe_proto.h @@ -28,4 +28,3 @@ int EXE_action(const TEXT*, const SINT64); int EXE_two_phase(const TEXT*, const SINT64); #endif // ALICE_EXE_PROTO_H - diff --git a/src/alice/tdr.cpp b/src/alice/tdr.cpp index b2f2b6717d..8608402533 100644 --- a/src/alice/tdr.cpp +++ b/src/alice/tdr.cpp @@ -863,5 +863,3 @@ static bool reconnect(FB_API_HANDLE handle, SLONG number, const TEXT* name, SINT return false; } - - diff --git a/src/common/classes/ClumpletReader.cpp b/src/common/classes/ClumpletReader.cpp index 73019e8cb8..23cd73595f 100644 --- a/src/common/classes/ClumpletReader.cpp +++ b/src/common/classes/ClumpletReader.cpp @@ -121,14 +121,14 @@ ClumpletReader::ClumpletReader(MemoryPool& pool, Kind k, const UCHAR* buffer, si rewind(); // this will set cur_offset and spbState } -const UCHAR* ClumpletReader::getBuffer() const -{ - return static_buffer; +const UCHAR* ClumpletReader::getBuffer() const +{ + return static_buffer; } -const UCHAR* ClumpletReader::getBufferEnd() const -{ - return static_buffer_end; +const UCHAR* ClumpletReader::getBufferEnd() const +{ + return static_buffer_end; } void ClumpletReader::usage_mistake(const char* what) const diff --git a/src/common/classes/ClumpletWriter.cpp b/src/common/classes/ClumpletWriter.cpp index d99b49cf7c..0431cbb400 100644 --- a/src/common/classes/ClumpletWriter.cpp +++ b/src/common/classes/ClumpletWriter.cpp @@ -50,14 +50,14 @@ ClumpletWriter::ClumpletWriter(MemoryPool& given_pool, Kind k, size_t limit, UCH rewind(); } -const UCHAR* ClumpletWriter::getBuffer() const -{ - return dynamic_buffer.begin(); +const UCHAR* ClumpletWriter::getBuffer() const +{ + return dynamic_buffer.begin(); } -const UCHAR* ClumpletWriter::getBufferEnd() const -{ - return dynamic_buffer.end(); +const UCHAR* ClumpletWriter::getBufferEnd() const +{ + return dynamic_buffer.end(); } void ClumpletWriter::initNewBuffer(UCHAR tag) diff --git a/src/common/classes/FpeControl.h b/src/common/classes/FpeControl.h index 9172f6375e..a4466bb518 100644 --- a/src/common/classes/FpeControl.h +++ b/src/common/classes/FpeControl.h @@ -151,7 +151,7 @@ private: // have to use the Solaris FPE routines. static void maskAll() throw() { - fpsetmask( ~(FP_X_OFL | FP_X_INV | FP_X_UFL | FP_X_DZ | FP_X_IMP)); + fpsetmask(~(FP_X_OFL | FP_X_INV | FP_X_UFL | FP_X_DZ | FP_X_IMP)); } private: @@ -164,7 +164,7 @@ private: { fp_except saved; saved = fpgetmask(); - fpsetmask( ~(FP_X_OFL | FP_X_INV | FP_X_UFL | FP_X_DZ | FP_X_IMP)); + fpsetmask(~(FP_X_OFL | FP_X_INV | FP_X_UFL | FP_X_DZ | FP_X_IMP)); clean = fpgetmask(); fpsetmask(saved); } @@ -187,8 +187,8 @@ private: void restoreMask() throw() { - fpsetsticky (0); // clear exception sticky flags - fpsetmask (savedMask); + fpsetsticky(0); // clear exception sticky flags + fpsetmask(savedMask); } #else diff --git a/src/common/classes/fb_atomic.h b/src/common/classes/fb_atomic.h index c56532798d..99b2b4baa3 100644 --- a/src/common/classes/fb_atomic.h +++ b/src/common/classes/fb_atomic.h @@ -329,9 +329,11 @@ private: // No GNU CC implementation on Solaris 9 is planned! extern "C" { -extern int fetch_and_add_il(volatile unsigned int *word_addr, int value); -extern boolean_t compare_and_swap_il(volatile unsigned int *word_addr, unsigned int *old_val_addr, unsigned int new_val); + extern int fetch_and_add_il(volatile unsigned int* word_addr, int value); + extern boolean_t compare_and_swap_il(volatile unsigned int* word_addr, + unsigned int* old_val_addr, unsigned int new_val); } + namespace Firebird { class AtomicCounter diff --git a/src/common/fb_exception.cpp b/src/common/fb_exception.cpp index eb57dbf921..7a46a40df2 100644 --- a/src/common/fb_exception.cpp +++ b/src/common/fb_exception.cpp @@ -309,7 +309,7 @@ ISC_STATUS LongJump::stuff_exception(ISC_STATUS* const status_vector, StringsBuf return status_vector[1]; } -const char* LongJump::what() const throw() +const char* LongJump::what() const throw() { return "Firebird::LongJump"; } @@ -417,4 +417,3 @@ ISC_STATUS stuff_exception(ISC_STATUS *status_vector, const Firebird::Exception& } } // namespace Firebird - diff --git a/src/gpre/cme_proto.h b/src/gpre/cme_proto.h index 0ec6765e31..cfdca2f4d8 100644 --- a/src/gpre/cme_proto.h +++ b/src/gpre/cme_proto.h @@ -35,4 +35,3 @@ inline void CME_rse(gpre_nod* node, gpre_req* request) } #endif // GPRE_CME_PROTO_H - diff --git a/src/include/fb_exception.h b/src/include/fb_exception.h index 73b9fcf1e9..343cd80327 100644 --- a/src/include/fb_exception.h +++ b/src/include/fb_exception.h @@ -208,4 +208,3 @@ ISC_STATUS stuff_exception(ISC_STATUS *status_vector, const Firebird::Exception& #endif // FB_EXCEPTION_H - diff --git a/src/isql/isql.epp b/src/isql/isql.epp index 741fde6521..9368eeed6e 100644 --- a/src/isql/isql.epp +++ b/src/isql/isql.epp @@ -1172,11 +1172,13 @@ SSHORT ISQL_get_field_length(const TEXT* field_name) // Transaction for all frontend commands if (DB && !gds_trans) + { if (isc_start_transaction(isc_status, &gds_trans, 1, &DB, 0, NULL)) { ISQL_errmsg(isc_status); return 0; } + } SSHORT l = 0; FOR FLD IN RDB$FIELDS WITH @@ -1217,11 +1219,13 @@ void ISQL_get_character_sets(SSHORT char_set_id, SSHORT collation, bool collate_ // Transaction for all frontend commands if (DB && !gds_trans) + { if (isc_start_transaction(isc_status, &gds_trans, 1, &DB, 0, NULL)) { ISQL_errmsg(isc_status); return; } + } //if (collation) { if (collation || collate_only) @@ -1320,11 +1324,13 @@ void ISQL_get_default_source(const TEXT* rel_name, // Transaction for all frontend commands if (DB && !gds_trans) + { if (isc_start_transaction(isc_status, &gds_trans, 1, &DB, 0, NULL)) { ISQL_errmsg(isc_status); return; } + } if (rel_name) { @@ -1385,11 +1391,13 @@ SLONG ISQL_get_index_segments(TEXT* segs, // Transaction for all frontend commands if (DB && !gds_trans) + { if (isc_start_transaction(isc_status, &gds_trans, 1, &DB, 0, NULL)) { ISQL_errmsg(isc_status); return 0; } + } TEXT* const segs_end = segs + buf_size - 1; // Query to get column names @@ -1473,11 +1481,13 @@ bool ISQL_get_base_column_null_flag(const TEXT* view_name, // Transaction for all frontend commands if (DB && !gds_trans) + { if (isc_start_transaction(isc_status, &gds_trans, 1, &DB, 0, NULL)) { ISQL_errmsg(isc_status); return false; } + } /* Using view_name and view_context get the relation name from @@ -1545,11 +1555,13 @@ bool ISQL_get_null_flag(const TEXT* rel_name, // Transaction for all frontend commands if (DB && !gds_trans) + { if (isc_start_transaction(isc_status, &gds_trans, 1, &DB, 0, NULL)) { ISQL_errmsg(isc_status); return false; } + } if (rel_name) { @@ -1575,8 +1587,10 @@ bool ISQL_get_null_flag(const TEXT* rel_name, null_flag = false; } else + { null_flag = ISQL_get_base_column_null_flag (rel_name, - RFR.RDB$VIEW_CONTEXT, RFR.RDB$BASE_FIELD); + RFR.RDB$VIEW_CONTEXT, RFR.RDB$BASE_FIELD); + } } END_FOR @@ -1682,11 +1696,13 @@ bool ISQL_is_domain(const TEXT* field_name) // Transaction for all frontend commands if (DB && !gds_trans) + { if (isc_start_transaction(isc_status, &gds_trans, 1, &DB, 0, NULL)) { ISQL_errmsg(isc_status); return false; } + } FOR FLD IN RDB$FIELDS WITH FLD.RDB$FIELD_NAME EQ field_name @@ -1911,19 +1927,23 @@ static processing_state add_row(TEXT* tabname) // There may have been a commit transaction before we got here if (!M__trans) + { if (isc_start_transaction(isc_status, &M__trans, 1, &DB, 0, NULL)) { ISQL_errmsg(isc_status); return FAIL; } + } // Start default transaction for prepare if (!D__trans) + { if (isc_start_transaction(isc_status, &D__trans, 1, &DB, 0, NULL)) { ISQL_errmsg(isc_status); return FAIL; } + } chop_at(tabname, QUOTEDLENGTH); if (tabname[0] != DBL_QUOTE) @@ -4738,6 +4758,7 @@ static processing_state frontend(const TEXT* statement) case FrontOptions::show: // Transaction for all frontend commands if (DB && !gds_trans) + { if (isc_start_transaction(isc_status, &gds_trans, 1, &DB, 0, NULL)) { ISQL_errmsg(isc_status); @@ -4745,6 +4766,8 @@ static processing_state frontend(const TEXT* statement) frontend_free_parms(parms, lparms, parm_defaults); return FAIL; } + } + ret = SHOW_metadata(parms, lparms); if (gds_trans) commit_trans(&gds_trans); @@ -4752,6 +4775,7 @@ static processing_state frontend(const TEXT* statement) case FrontOptions::add: if (DB && !gds_trans) + { if (isc_start_transaction(isc_status, &gds_trans, 1, &DB, 0, NULL)) { ISQL_errmsg(isc_status); @@ -4759,6 +4783,8 @@ static processing_state frontend(const TEXT* statement) frontend_free_parms(parms, lparms, parm_defaults); return FAIL; } + } + ret = add_row(lparms[1]); if (gds_trans) commit_trans(&gds_trans); @@ -4766,6 +4792,7 @@ static processing_state frontend(const TEXT* statement) case FrontOptions::copy: if (DB && !gds_trans) + { if (isc_start_transaction(isc_status, &gds_trans, 1, &DB, 0, NULL)) { ISQL_errmsg(isc_status); @@ -4773,6 +4800,8 @@ static processing_state frontend(const TEXT* statement) frontend_free_parms(parms, lparms, parm_defaults); return FAIL; } + } + ret = copy_table(lparms[1], lparms[2], lparms[3]); if (gds_trans) commit_trans(&gds_trans); @@ -5148,7 +5177,7 @@ static processing_state frontend_set(const char* cmd, const char* const* parms, case SetOptions::planonly: ret = do_set_command (parms[2], &Planonly); - if ( Planonly && !Plan ) + if (Planonly && !Plan) { // turn on plan ret = do_set_command ("ON", &Plan); @@ -6347,7 +6376,8 @@ static bool isyesno(const TEXT* buffer) **********************************************/ if (!have_trans) - { // get the translation if we don't have it already + { + // get the translation if we don't have it already ISQL_msg_get(YES_ANS, sizeof(yesword), yesword); have_trans = true; } diff --git a/src/isql/isql.h b/src/isql/isql.h index 0a2da5701d..e076c3c95a 100644 --- a/src/isql/isql.h +++ b/src/isql/isql.h @@ -393,4 +393,3 @@ const char DBL_QUOTE = '\042'; const char SINGLE_QUOTE = '\''; #endif // ISQL_ISQL_H - diff --git a/src/isql/show.epp b/src/isql/show.epp index cefec960eb..c0794cbdc3 100644 --- a/src/isql/show.epp +++ b/src/isql/show.epp @@ -1077,8 +1077,8 @@ void SHOW_print_metadata_text_blob(FILE* fp, ISC_QUAD* blobid, bool escape_squot while (blob.getSegment(sizeof(buffer) - 1, buffer, length)) { // ASF: In Windows, \n characters are printed as \r\n in text mode. - // If the original string is \r\n, it's printed as \r\r\n, resulting - // in mixed/wrong line endings. So here, we're filtering any \r just + // If the original string has \r\n, they're printed as \r\r\n, resulting + // in mixed/wrong line endings. So here, we filter any \r present just // before \n. bool prevEndedWithCr = endedWithCr; @@ -4643,7 +4643,6 @@ static processing_state show_trigger(const SCHAR* object, bool show_source, bool if (first && !has_dbtrig) return OBJECT_NOT_FOUND; - return (SKIP); } diff --git a/src/jrd/blb.cpp b/src/jrd/blb.cpp index ab08f59af3..9ebafef583 100644 --- a/src/jrd/blb.cpp +++ b/src/jrd/blb.cpp @@ -1416,8 +1416,7 @@ blb* BLB_open2(thread_db* tdbb, if (filter_required) { BlobControl* control = 0; - BLF_open_blob(tdbb, transaction, &control, blob_id, bpb_length, bpb, - blob_filter, filter); + BLF_open_blob(tdbb, transaction, &control, blob_id, bpb_length, bpb, blob_filter, filter); blob->blb_filter = control; blob->blb_max_segment = control->ctl_max_segment; blob->blb_count = control->ctl_number_segments; @@ -1930,7 +1929,7 @@ static ISC_STATUS blob_filter(USHORT action, } #endif - blb* blob = 0; + blb* blob = NULL; switch (action) { diff --git a/src/jrd/isc_sync.cpp b/src/jrd/isc_sync.cpp index 292958a439..297d57393d 100644 --- a/src/jrd/isc_sync.cpp +++ b/src/jrd/isc_sync.cpp @@ -2923,7 +2923,7 @@ int ISC_mutex_init(struct mtx* mutex) if (state #if defined(HAVE_PTHREAD_MUTEXATTR_SETPROTOCOL) || defined(USE_ROBUST_MUTEX) - && (state != ENOTSUP || bugFlag) + && (state != ENOTSUP || bugFlag) #endif ) { diff --git a/src/msgs/enter_msgs.epp b/src/msgs/enter_msgs.epp index aaf2da5c11..063c9b3b93 100644 --- a/src/msgs/enter_msgs.epp +++ b/src/msgs/enter_msgs.epp @@ -48,7 +48,7 @@ static bool get_sql_code(SSHORT *); static bool get_sql_subclass(char*); static bool store_sql_msg(); static bool translate(const UCHAR*, UCHAR*, SSHORT); -static bool get_symbol( char*); +static bool get_symbol(char*); const int FAC_SQL_POSITIVE = 14; const int FAC_SQL_NEGATIVE = 13; diff --git a/src/qli/help.epp b/src/qli/help.epp index 4b6cac82de..74573f3643 100644 --- a/src/qli/help.epp +++ b/src/qli/help.epp @@ -44,11 +44,9 @@ const int COLUMN_WIDTH = 20; const int RIGHT_MARGIN = 70; #ifdef UNIX -const char* const TARGET = "help/help.fdb"; -#endif - -#if (defined WIN_NT) -const char* const TARGET = "help\\help.fdb"; +const char* const TARGET = "help/help.fdb"; +#elif defined(WIN_NT) +const char* const TARGET = "help\\help.fdb"; #endif DATABASE HELP_DB = STATIC "help.fdb" RUNTIME target; @@ -352,4 +350,3 @@ static const TEXT* strip( const TEXT* string) return p; } - diff --git a/src/remote/os/win32/window.h b/src/remote/os/win32/window.h index 6c4dc78164..b3f082f0e9 100644 --- a/src/remote/os/win32/window.h +++ b/src/remote/os/win32/window.h @@ -30,8 +30,8 @@ const int APP_VSIZE = 150; /* This is the title used by the hidden msgs window in the engine. Both fbclient.dll and fbserver.exe should use the same. */ -static const char* const APP_NAME = "Firebird Server"; -static const char* const APP_LABEL = "Firebird Server"; +static const char* const APP_NAME = "Firebird Server"; +static const char* const APP_LABEL = "Firebird Server"; #define ON_NOTIFYICON WM_USER + 2 diff --git a/src/utilities/install/registry.h b/src/utilities/install/registry.h index f1f632334c..8659614db7 100644 --- a/src/utilities/install/registry.h +++ b/src/utilities/install/registry.h @@ -30,4 +30,3 @@ static const char* const REG_KEY_ROOT_PRODUCT = "SOFTWARE\\Firebird Project\\Fir static const char* const REG_KEY_ROOT_INSTANCES = "SOFTWARE\\Firebird Project\\Firebird Server\\Instances"; #endif // REGISTRY_DEFINES_H -