From: JINMEI Tatuya Date: Tue, 15 May 2012 01:19:46 +0000 (-0700) Subject: [1207] editorial/style nits: indentation/brace pos/constify/() for return X-Git-Tag: trac2351_base~226^2~90^2~17 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=34561bdb8ee2ec934df4ff957839cd4e7d53e7be;p=thirdparty%2Fkea.git [1207] editorial/style nits: indentation/brace pos/constify/() for return --- diff --git a/src/bin/auth/auth_config.cc b/src/bin/auth/auth_config.cc index afb606d25d..f87fe65f98 100644 --- a/src/bin/auth/auth_config.cc +++ b/src/bin/auth/auth_config.cc @@ -109,7 +109,7 @@ DatasourcesConfig::commit() { // data source types, and should eventually be improved. // Currently memory data source for class IN is the only possibility. server_.setInMemoryClient(RRClass::IN(), - isc::datasrc::DataSourceClientContainerPtr()); + isc::datasrc::DataSourceClientContainerPtr()); BOOST_FOREACH(boost::shared_ptr datasrc_config, datasources_) { diff --git a/src/bin/auth/auth_srv.cc b/src/bin/auth/auth_srv.cc index 898a12667b..b64e835992 100644 --- a/src/bin/auth/auth_srv.cc +++ b/src/bin/auth/auth_srv.cc @@ -409,14 +409,14 @@ AuthSrv::getInMemoryClient(const RRClass& rrclass) { } bool -AuthSrv::hasInMemoryClient() { +AuthSrv::hasInMemoryClient() const { return (impl_->memory_client_container_ != isc::datasrc::DataSourceClientContainerPtr()); } void AuthSrv::setInMemoryClient(const isc::dns::RRClass& rrclass, - isc::datasrc::DataSourceClientContainerPtr memory_client) + DataSourceClientContainerPtr memory_client) { if (rrclass != impl_->memory_client_class_) { isc_throw(InvalidParameter, diff --git a/src/bin/auth/auth_srv.h b/src/bin/auth/auth_srv.h index 893421e25b..0f01a1016b 100644 --- a/src/bin/auth/auth_srv.h +++ b/src/bin/auth/auth_srv.h @@ -276,7 +276,7 @@ public: /// multi-data-source framework is completed. /// /// \return True if the in-memory datasource has been set. - bool hasInMemoryClient(); + bool hasInMemoryClient() const; /// Sets or replaces the in-memory data source of the specified RR class. /// diff --git a/src/bin/auth/tests/auth_srv_unittest.cc b/src/bin/auth/tests/auth_srv_unittest.cc index c7f08be993..f731dd1330 100644 --- a/src/bin/auth/tests/auth_srv_unittest.cc +++ b/src/bin/auth/tests/auth_srv_unittest.cc @@ -1256,7 +1256,7 @@ public: } private: - isc::datasrc::DataSourceClientContainerPtr real_client_ptr_; + const isc::datasrc::DataSourceClientContainerPtr real_client_ptr_; ThrowWhen throw_when_; bool isc_exception_; ConstRRsetPtr fake_rrset_; @@ -1286,7 +1286,7 @@ public: } private: - isc::datasrc::DataSourceClient* client_; + isc::datasrc::DataSourceClient* const client_; }; } // end anonymous namespace for throwing proxy classes diff --git a/src/lib/datasrc/memory_datasrc_link.cc b/src/lib/datasrc/memory_datasrc_link.cc index 11e6ef0aa8..d5a3f85277 100644 --- a/src/lib/datasrc/memory_datasrc_link.cc +++ b/src/lib/datasrc/memory_datasrc_link.cc @@ -59,14 +59,14 @@ checkConfigElementString(ConstElementPtr config, const std::string& name, "Config for memory backend does not contain a '" +name+ "' value"); - return false; + return (false); } else if (!config->get(name) || config->get(name)->getType() != Element::string) { addError(errors, "value of " + name + " in memory backend config is not a string"); - return false; + return (false); } else { - return true; + return (true); } } @@ -162,7 +162,8 @@ checkConfig(ConstElementPtr config, ElementPtr errors) { // checked by the caller void applyConfig(isc::datasrc::InMemoryClient* client, - isc::data::ConstElementPtr config_value) { + isc::data::ConstElementPtr config_value) +{ ConstElementPtr zones_config = config_value->get("zones"); if (!zones_config) { // XXX: Like the RR class, we cannot retrieve the default value here, @@ -253,8 +254,8 @@ createInstance(isc::data::ConstElementPtr config, std::string& error) { try { client = new isc::datasrc::InMemoryClient(); applyConfig(client, config); - return client; - } catch (isc::Exception& isce) { + return (client); + } catch (const isc::Exception& isce) { delete client; error = isce.what(); return (NULL);