From 3a7d93f65888de3b8442339dabf59159b8c0bf4c Mon Sep 17 00:00:00 2001 From: robocop Date: Sun, 26 Aug 2007 09:53:08 +0000 Subject: [PATCH] Misc tweaks with Firebird::string. --- src/burp/burp.cpp | 2 +- src/jrd/dfw.epp | 3 +-- src/jrd/dyn_def.epp | 2 +- src/jrd/functions.cpp | 4 ++-- src/jrd/intl_builtin.cpp | 2 +- src/jrd/jrd.cpp | 2 +- src/jrd/plugin_manager.cpp | 2 +- src/jrd/svc.cpp | 4 ++-- src/utilities/fbsvcmgr.cpp | 4 ++-- 9 files changed, 12 insertions(+), 13 deletions(-) diff --git a/src/burp/burp.cpp b/src/burp/burp.cpp index 9f2ef0407e..0dbdcb8e0e 100644 --- a/src/burp/burp.cpp +++ b/src/burp/burp.cpp @@ -451,7 +451,7 @@ static int api_gbak(int argc, } - Firebird::string svc_name(service ? service : ""); + const Firebird::string svc_name(service ? service : ""); if (service) { *service = 0; diff --git a/src/jrd/dfw.epp b/src/jrd/dfw.epp index a72b4632c8..91d8ec5e5e 100644 --- a/src/jrd/dfw.epp +++ b/src/jrd/dfw.epp @@ -2249,8 +2249,7 @@ static bool create_collation(thread_db* tdbb, SSHORT phase, DeferredWork* work, length = BLB_get_data(tdbb, blob, buffer.getBuffer(length), length); } - Firebird::string specificAttributes = - Firebird::string((const char*) buffer.begin(), length); + const Firebird::string specificAttributes((const char*) buffer.begin(), length); Firebird::string newSpecificAttributes; // ASF: If setupCollationAttributes fail we store the original diff --git a/src/jrd/dyn_def.epp b/src/jrd/dyn_def.epp index ac8c5d152d..324cb1ed95 100644 --- a/src/jrd/dyn_def.epp +++ b/src/jrd/dyn_def.epp @@ -335,7 +335,7 @@ void DYN_define_collation( Global* gbl, const UCHAR** ptr) // msg: 222: "Invalid collation attributes" } - Firebird::string s = Firebird::IntlUtil::generateSpecificAttributes(cs, map); + const Firebird::string s = Firebird::IntlUtil::generateSpecificAttributes(cs, map); Firebird::string newSpecificAttributes; if (!IntlManager::setupCollationAttributes( diff --git a/src/jrd/functions.cpp b/src/jrd/functions.cpp index 9dc142a991..7e69eb3f03 100644 --- a/src/jrd/functions.cpp +++ b/src/jrd/functions.cpp @@ -173,7 +173,7 @@ vary* get_context(const vary* ns_vary, const vary* name_vary) return NULL; } - Firebird::string ns_str(ns_vary->vary_string, ns_vary->vary_length), + const Firebird::string ns_str(ns_vary->vary_string, ns_vary->vary_length), name_str(name_vary->vary_string, name_vary->vary_length); // Handle system variables @@ -308,7 +308,7 @@ static SLONG set_context(const vary* ns_vary, const vary* name_vary, const vary* return 0; } - Firebird::string ns_str(ns_vary->vary_string, ns_vary->vary_length), + const Firebird::string ns_str(ns_vary->vary_string, ns_vary->vary_length), name_str(name_vary->vary_string, name_vary->vary_length); if (ns_str == USER_SESSION_NAMESPACE) diff --git a/src/jrd/intl_builtin.cpp b/src/jrd/intl_builtin.cpp index b028737519..f6c5b01fa4 100644 --- a/src/jrd/intl_builtin.cpp +++ b/src/jrd/intl_builtin.cpp @@ -1762,7 +1762,7 @@ ULONG INTL_builtin_setup_attributes(const ASCII* textTypeName, const ASCII* char if (!INTL_builtin_lookup_charset(cs, charSetName, configInfo)) return INTL_BAD_STR_LENGTH; - Firebird::string specificAttributes((const char*) src, srcLen); + const Firebird::string specificAttributes((const char*) src, srcLen); Firebird::string newSpecificAttributes = specificAttributes; if (IntlUtil::setupIcuAttributes(cs, specificAttributes, configInfo, newSpecificAttributes)) diff --git a/src/jrd/jrd.cpp b/src/jrd/jrd.cpp index 93e97dedcb..1e750be8fa 100644 --- a/src/jrd/jrd.cpp +++ b/src/jrd/jrd.cpp @@ -7299,7 +7299,7 @@ static void getUserInfo(UserId& user, const DatabaseOptions& options) else #endif { - Firebird::string remote = options.dpb_network_protocol + + const Firebird::string remote = options.dpb_network_protocol + (options.dpb_network_protocol.isEmpty() || options.dpb_remote_address.isEmpty() ? "" : "/") + options.dpb_remote_address; SecurityDatabase::verifyUser(name, diff --git a/src/jrd/plugin_manager.cpp b/src/jrd/plugin_manager.cpp index a21d9b486d..b004f885c5 100644 --- a/src/jrd/plugin_manager.cpp +++ b/src/jrd/plugin_manager.cpp @@ -312,7 +312,7 @@ void PluginManager::load_engine_plugins() enginePluginManager().addSearchPath(ENGINE_PLUGIN_DIR); enginePluginManager().loadAllPlugins(); - Firebird::string entryPoint(ENGINE_PLUGIN_REGISTRATION_ENTRYPOINT); + const Firebird::string entryPoint(ENGINE_PLUGIN_REGISTRATION_ENTRYPOINT); for (PluginManager::iterator itr = enginePluginManager().begin(); itr != enginePluginManager().end(); ++itr) { diff --git a/src/jrd/svc.cpp b/src/jrd/svc.cpp index 8a4cedeca1..00d8c8578a 100644 --- a/src/jrd/svc.cpp +++ b/src/jrd/svc.cpp @@ -530,7 +530,7 @@ Service* SVC_attach(USHORT service_length, /* Find the service by looking for an exact match. */ - Firebird::string misc_buf(service_name, + const Firebird::string misc_buf(service_name, service_length ? service_length : strlen(service_name)); serv_entry* serv; for (serv = services; serv->serv_name; serv++) { @@ -606,7 +606,7 @@ Service* SVC_attach(USHORT service_length, TEXT name[129]; // unused after retrieved int id, group, node_id; - Firebird::string remote = options.spb_network_protocol + + const Firebird::string remote = options.spb_network_protocol + (options.spb_network_protocol.isEmpty() || options.spb_remote_address.isEmpty() ? "" : "/") + options.spb_remote_address; diff --git a/src/utilities/fbsvcmgr.cpp b/src/utilities/fbsvcmgr.cpp index 2cc5b73c79..1d31e2d076 100644 --- a/src/utilities/fbsvcmgr.cpp +++ b/src/utilities/fbsvcmgr.cpp @@ -95,7 +95,7 @@ bool putSpecTag(char**& av, Firebird::ClumpletWriter& spb, unsigned int tag, if (! *av) return false; - Firebird::string s(prepareSwitch(*av++)); + const Firebird::string s(prepareSwitch(*av++)); for (; sw->name; ++sw) { if (s == sw->name) @@ -184,7 +184,7 @@ bool populateSpbFromSwitches(char**& av, if (! *av) return false; - Firebird::string s(prepareSwitch(*av)); + const Firebird::string s(prepareSwitch(*av)); for (; sw->name; ++sw) {