From 7ca490f0b57a4a4dcc5f7f86d88cbe5c7ae24ca0 Mon Sep 17 00:00:00 2001 From: Otto Date: Wed, 31 Mar 2021 11:57:32 +0200 Subject: [PATCH] AlignAfterOpenBracket: Align --- .clang-format | 1 + modules/bindbackend/bindbackend2.hh | 4 ++-- modules/geoipbackend/geoipbackend.cc | 2 +- modules/geoipbackend/geoipinterface-dat.cc | 8 ++++---- modules/geoipbackend/geoipinterface-mmdb.cc | 8 ++++---- modules/geoipbackend/geoipinterface.hh | 8 ++++---- modules/gmysqlbackend/gmysqlbackend.cc | 20 ++++++++++---------- modules/gmysqlbackend/smysql.cc | 14 +++++++------- modules/gmysqlbackend/smysql.hh | 8 ++++---- modules/godbcbackend/sodbc.cc | 8 ++++---- modules/gpgsqlbackend/gpgsqlbackend.cc | 12 ++++++------ modules/gpgsqlbackend/spgsql.cc | 2 +- modules/gpgsqlbackend/spgsql.hh | 4 ++-- modules/ldapbackend/ldapauthenticator.cc | 4 ++-- modules/lmdbbackend/lmdbbackend.cc | 8 ++++---- modules/lmdbbackend/lmdbbackend.hh | 8 ++++---- pdns/recursordist/aggressive_nsec.hh | 6 +++--- pdns/recursordist/negcache.hh | 14 +++++++------- pdns/recursordist/taskqueue.hh | 8 ++++---- pdns/recursordist/test-filterpo_cc.cc | 12 ++++++------ pdns/recursordist/test-mtasker.cc | 2 +- pdns/recursordist/test-syncres_cc3.cc | 4 ++-- 22 files changed, 83 insertions(+), 82 deletions(-) diff --git a/.clang-format b/.clang-format index e2bab20af9..1d681f062e 100644 --- a/.clang-format +++ b/.clang-format @@ -6,6 +6,7 @@ ConstructorInitializerIndentWidth: 2 ContinuationIndentWidth: 2 IndentWidth: 2 ObjCBlockIndentWidth: 2 +AlignAfterOpenBracket: Align SortIncludes: false diff --git a/modules/bindbackend/bindbackend2.hh b/modules/bindbackend/bindbackend2.hh index 70fc4640fb..93c1fe85e1 100644 --- a/modules/bindbackend/bindbackend2.hh +++ b/modules/bindbackend/bindbackend2.hh @@ -227,8 +227,8 @@ public: // end of DNSSEC typedef multi_index_container>, - ordered_unique, member>>> + indexed_by>, + ordered_unique, member>>> state_t; static state_t s_state; static ReadWriteLock s_state_lock; diff --git a/modules/geoipbackend/geoipbackend.cc b/modules/geoipbackend/geoipbackend.cc index bf1a89e33d..980c0643d5 100644 --- a/modules/geoipbackend/geoipbackend.cc +++ b/modules/geoipbackend/geoipbackend.cc @@ -629,7 +629,7 @@ string getGeoForLua(const std::string& ip, int qaint) } static bool queryGeoLocation(const Netmask& addr, GeoIPNetmask& gl, double& lat, double& lon, - boost::optional& alt, boost::optional& prec) + boost::optional& alt, boost::optional& prec) { for (auto const& gi : s_geoip_files) { string val; diff --git a/modules/geoipbackend/geoipinterface-dat.cc b/modules/geoipbackend/geoipinterface-dat.cc index 584ae94bce..5a5a05dac4 100644 --- a/modules/geoipbackend/geoipinterface-dat.cc +++ b/modules/geoipbackend/geoipinterface-dat.cc @@ -432,8 +432,8 @@ public: } bool queryLocationV6(GeoIPNetmask& gl, const string& ip, - double& latitude, double& longitude, - boost::optional& alt, boost::optional& prec) override + double& latitude, double& longitude, + boost::optional& alt, boost::optional& prec) override { if (d_db_type == GEOIP_REGION_EDITION_REV0 || d_db_type == GEOIP_REGION_EDITION_REV1 || d_db_type == GEOIP_CITY_EDITION_REV0_V6 || d_db_type == GEOIP_CITY_EDITION_REV1_V6) { std::unique_ptr gir(GeoIP_record_by_addr_v6(d_gi.get(), ip.c_str())); @@ -448,8 +448,8 @@ public: } bool queryLocation(GeoIPNetmask& gl, const string& ip, - double& latitude, double& longitude, - boost::optional& alt, boost::optional& prec) override + double& latitude, double& longitude, + boost::optional& alt, boost::optional& prec) override { if (d_db_type == GEOIP_REGION_EDITION_REV0 || d_db_type == GEOIP_REGION_EDITION_REV1 || d_db_type == GEOIP_CITY_EDITION_REV0 || d_db_type == GEOIP_CITY_EDITION_REV1) { std::unique_ptr gir(GeoIP_record_by_addr(d_gi.get(), ip.c_str())); diff --git a/modules/geoipbackend/geoipinterface-mmdb.cc b/modules/geoipbackend/geoipinterface-mmdb.cc index 47cf776555..b8a11ef806 100644 --- a/modules/geoipbackend/geoipinterface-mmdb.cc +++ b/modules/geoipbackend/geoipinterface-mmdb.cc @@ -207,8 +207,8 @@ public: } bool queryLocation(GeoIPNetmask& gl, const string& ip, - double& latitude, double& longitude, - boost::optional& alt, boost::optional& prec) override + double& latitude, double& longitude, + boost::optional& alt, boost::optional& prec) override { MMDB_entry_data_s data; MMDB_lookup_result_s res; @@ -227,8 +227,8 @@ public: } bool queryLocationV6(GeoIPNetmask& gl, const string& ip, - double& latitude, double& longitude, - boost::optional& alt, boost::optional& prec) override + double& latitude, double& longitude, + boost::optional& alt, boost::optional& prec) override { MMDB_entry_data_s data; MMDB_lookup_result_s res; diff --git a/modules/geoipbackend/geoipinterface.hh b/modules/geoipbackend/geoipinterface.hh index 1681d0d944..3ac8d8bcf7 100644 --- a/modules/geoipbackend/geoipinterface.hh +++ b/modules/geoipbackend/geoipinterface.hh @@ -54,12 +54,12 @@ public: virtual bool queryCity(string& ret, GeoIPNetmask& gl, const string& ip) = 0; virtual bool queryCityV6(string& ret, GeoIPNetmask& gl, const string& ip) = 0; virtual bool queryLocation(GeoIPNetmask& gl, const string& ip, - double& latitude, double& longitude, - boost::optional& alt, boost::optional& prec) + double& latitude, double& longitude, + boost::optional& alt, boost::optional& prec) = 0; virtual bool queryLocationV6(GeoIPNetmask& gl, const string& ip, - double& latitude, double& longitude, - boost::optional& alt, boost::optional& prec) + double& latitude, double& longitude, + boost::optional& alt, boost::optional& prec) = 0; virtual ~GeoIPInterface() {} diff --git a/modules/gmysqlbackend/gmysqlbackend.cc b/modules/gmysqlbackend/gmysqlbackend.cc index f1c10f7b4b..e47f370616 100644 --- a/modules/gmysqlbackend/gmysqlbackend.cc +++ b/modules/gmysqlbackend/gmysqlbackend.cc @@ -53,16 +53,16 @@ gMySQLBackend::gMySQLBackend(const string& mode, const string& suffix) : void gMySQLBackend::reconnect() { setDB(new SMySQL(getArg("dbname"), - getArg("host"), - getArgAsNum("port"), - getArg("socket"), - getArg("user"), - getArg("password"), - getArg("group"), - mustDo("innodb-read-committed"), - getArgAsNum("timeout"), - mustDo("thread-cleanup"), - mustDo("ssl"))); + getArg("host"), + getArgAsNum("port"), + getArg("socket"), + getArg("user"), + getArg("password"), + getArg("group"), + mustDo("innodb-read-committed"), + getArgAsNum("timeout"), + mustDo("thread-cleanup"), + mustDo("ssl"))); allocateStatements(); } diff --git a/modules/gmysqlbackend/smysql.cc b/modules/gmysqlbackend/smysql.cc index d05c1eec9d..35267c9e58 100644 --- a/modules/gmysqlbackend/smysql.cc +++ b/modules/gmysqlbackend/smysql.cc @@ -504,12 +504,12 @@ void SMySQL::connect() mysql_options(&d_db, MYSQL_READ_DEFAULT_GROUP, d_group.c_str()); if (!mysql_real_connect(&d_db, d_host.empty() ? nullptr : d_host.c_str(), - d_user.empty() ? nullptr : d_user.c_str(), - d_password.empty() ? nullptr : d_password.c_str(), - d_database.empty() ? nullptr : d_database.c_str(), - d_port, - d_msocket.empty() ? nullptr : d_msocket.c_str(), - (d_clientSSL ? CLIENT_SSL : 0) | CLIENT_MULTI_RESULTS)) { + d_user.empty() ? nullptr : d_user.c_str(), + d_password.empty() ? nullptr : d_password.c_str(), + d_database.empty() ? nullptr : d_database.c_str(), + d_port, + d_msocket.empty() ? nullptr : d_msocket.c_str(), + (d_clientSSL ? CLIENT_SSL : 0) | CLIENT_MULTI_RESULTS)) { if (retry == 0) throw sPerrorException("Unable to connect to database"); @@ -526,7 +526,7 @@ void SMySQL::connect() } SMySQL::SMySQL(string database, string host, uint16_t port, string msocket, string user, - string password, string group, bool setIsolation, unsigned int timeout, bool threadCleanup, bool clientSSL) : + string password, string group, bool setIsolation, unsigned int timeout, bool threadCleanup, bool clientSSL) : d_database(std::move(database)), d_host(std::move(host)), d_msocket(std::move(msocket)), d_user(std::move(user)), d_password(std::move(password)), d_group(std::move(group)), d_timeout(timeout), d_port(port), d_setIsolation(setIsolation), d_threadCleanup(threadCleanup), d_clientSSL(clientSSL) { connect(); diff --git a/modules/gmysqlbackend/smysql.hh b/modules/gmysqlbackend/smysql.hh index e389146062..255649ca1a 100644 --- a/modules/gmysqlbackend/smysql.hh +++ b/modules/gmysqlbackend/smysql.hh @@ -30,10 +30,10 @@ class SMySQL : public SSql { public: SMySQL(string database, string host = "", uint16_t port = 0, - string msocket = "", string user = "", - string password = "", string group = "", - bool setIsolation = false, unsigned int timeout = 10, - bool threadCleanup = false, bool clientSSL = false); + string msocket = "", string user = "", + string password = "", string group = "", + bool setIsolation = false, unsigned int timeout = 10, + bool threadCleanup = false, bool clientSSL = false); ~SMySQL(); diff --git a/modules/godbcbackend/sodbc.cc b/modules/godbcbackend/sodbc.cc index 690ea69397..2985557a77 100644 --- a/modules/godbcbackend/sodbc.cc +++ b/modules/godbcbackend/sodbc.cc @@ -52,7 +52,7 @@ static bool realTestResult(SQLRETURN result, SQLSMALLINT type, SQLHANDLE handle, do { // cerr<<"getting sql diag record "<(l_dsn), dsn.length(), - reinterpret_cast(l_username), username.length(), - reinterpret_cast(l_password), password.length()); + reinterpret_cast(l_dsn), dsn.length(), + reinterpret_cast(l_username), username.length(), + reinterpret_cast(l_password), password.length()); free(l_dsn); free(l_username); diff --git a/modules/gpgsqlbackend/gpgsqlbackend.cc b/modules/gpgsqlbackend/gpgsqlbackend.cc index 7a2ad91ab7..29d59df6c9 100644 --- a/modules/gpgsqlbackend/gpgsqlbackend.cc +++ b/modules/gpgsqlbackend/gpgsqlbackend.cc @@ -41,12 +41,12 @@ gPgSQLBackend::gPgSQLBackend(const string& mode, const string& suffix) : { try { setDB(new SPgSQL(getArg("dbname"), - getArg("host"), - getArg("port"), - getArg("user"), - getArg("password"), - getArg("extra-connection-parameters"), - mustDo("prepared-statements"))); + getArg("host"), + getArg("port"), + getArg("user"), + getArg("password"), + getArg("extra-connection-parameters"), + mustDo("prepared-statements"))); } catch (SSqlException& e) { diff --git a/modules/gpgsqlbackend/spgsql.cc b/modules/gpgsqlbackend/spgsql.cc index 19cb3cef77..5ebc6ff653 100644 --- a/modules/gpgsqlbackend/spgsql.cc +++ b/modules/gpgsqlbackend/spgsql.cc @@ -317,7 +317,7 @@ static string escapeForPQparam(const string& v) } SPgSQL::SPgSQL(const string& database, const string& host, const string& port, const string& user, - const string& password, const string& extra_connection_parameters, const bool use_prepared) + const string& password, const string& extra_connection_parameters, const bool use_prepared) { d_db = nullptr; d_in_trx = false; diff --git a/modules/gpgsqlbackend/spgsql.hh b/modules/gpgsqlbackend/spgsql.hh index 7e6dd5b696..a1fd64f3d2 100644 --- a/modules/gpgsqlbackend/spgsql.hh +++ b/modules/gpgsqlbackend/spgsql.hh @@ -28,8 +28,8 @@ class SPgSQL : public SSql { public: SPgSQL(const string& database, const string& host = "", const string& port = "", - const string& user = "", const string& password = "", - const string& extra_connection_parameters = "", const bool use_prepared = true); + const string& user = "", const string& password = "", + const string& extra_connection_parameters = "", const bool use_prepared = true); ~SPgSQL(); diff --git a/modules/ldapbackend/ldapauthenticator.cc b/modules/ldapbackend/ldapauthenticator.cc index 79c8429851..9a4ddb91bf 100644 --- a/modules/ldapbackend/ldapauthenticator.cc +++ b/modules/ldapbackend/ldapauthenticator.cc @@ -166,8 +166,8 @@ int LdapGssapiAuthenticator::attemptAuth(LDAP* conn) // And now try to bind int rc = ldap_sasl_interactive_bind_s(conn, "", defaults.mech.c_str(), - NULL, NULL, LDAP_SASL_QUIET, - ldapGssapiAuthenticatorSaslInteractCallback, &defaults); + NULL, NULL, LDAP_SASL_QUIET, + ldapGssapiAuthenticatorSaslInteractCallback, &defaults); g_log << Logger::Debug << d_logPrefix << "ldap_sasl_interactive_bind_s returned " << rc << std::endl; if (rc == LDAP_LOCAL_ERROR) { diff --git a/modules/lmdbbackend/lmdbbackend.cc b/modules/lmdbbackend/lmdbbackend.cc index 7196d954e9..03b0d5438a 100644 --- a/modules/lmdbbackend/lmdbbackend.cc +++ b/modules/lmdbbackend/lmdbbackend.cc @@ -531,7 +531,7 @@ std::shared_ptr LMDBBackend::getRecordsRWTran auto& shard = d_trecords[id % s_shards]; if (!shard.env) { shard.env = getMDBEnv((getArg("filename") + "-" + std::to_string(id % s_shards)).c_str(), - MDB_NOSUBDIR | d_asyncFlag, 0600); + MDB_NOSUBDIR | d_asyncFlag, 0600); shard.dbi = shard.env->openDB("records", MDB_CREATE); } auto ret = std::make_shared(shard.env->getRWTransaction()); @@ -548,7 +548,7 @@ std::shared_ptr LMDBBackend::getRecordsROTran throw DBException("attempting to start nested transaction without open parent env"); } shard.env = getMDBEnv((getArg("filename") + "-" + std::to_string(id % s_shards)).c_str(), - MDB_NOSUBDIR | d_asyncFlag, 0600); + MDB_NOSUBDIR | d_asyncFlag, 0600); shard.dbi = shard.env->openDB("records", MDB_CREATE); } @@ -581,13 +581,13 @@ bool LMDBBackend::upgradeToSchemav3() LMDBBackend::RecordsDB oldShard, newShard; oldShard.env = getMDBEnv((filename + "-old").c_str(), - MDB_NOSUBDIR | d_asyncFlag, 0600); + MDB_NOSUBDIR | d_asyncFlag, 0600); oldShard.dbi = oldShard.env->openDB("records", MDB_CREATE | MDB_DUPSORT); auto txn = oldShard.env->getROTransaction(); auto cursor = txn->getROCursor(oldShard.dbi); newShard.env = getMDBEnv((filename).c_str(), - MDB_NOSUBDIR | d_asyncFlag, 0600); + MDB_NOSUBDIR | d_asyncFlag, 0600); newShard.dbi = newShard.env->openDB("records", MDB_CREATE); auto newTxn = newShard.env->getRWTransaction(); diff --git a/modules/lmdbbackend/lmdbbackend.hh b/modules/lmdbbackend/lmdbbackend.hh index 39b55111ac..9951841d09 100644 --- a/modules/lmdbbackend/lmdbbackend.hh +++ b/modules/lmdbbackend/lmdbbackend.hh @@ -228,19 +228,19 @@ public: private: typedef TypedDBI> + index_on> tdomains_t; typedef TypedDBI> + index_on> tmeta_t; typedef TypedDBI> + index_on> tkdb_t; typedef TypedDBI> + index_on> ttsig_t; int d_asyncFlag; diff --git a/pdns/recursordist/aggressive_nsec.hh b/pdns/recursordist/aggressive_nsec.hh index 1773f73aab..2a067b81b4 100644 --- a/pdns/recursordist/aggressive_nsec.hh +++ b/pdns/recursordist/aggressive_nsec.hh @@ -112,11 +112,11 @@ private: CacheEntry, indexed_by< ordered_unique, - member, - CanonDNSNameCompare>, + member, + CanonDNSNameCompare>, sequenced>, hashed_non_unique, - member>>> + member>>> cache_t; cache_t d_entries; diff --git a/pdns/recursordist/negcache.hh b/pdns/recursordist/negcache.hh index 2f37d421f3..db360eb47e 100644 --- a/pdns/recursordist/negcache.hh +++ b/pdns/recursordist/negcache.hh @@ -95,15 +95,15 @@ private: NegCacheEntry, indexed_by< ordered_unique, - composite_key< - NegCacheEntry, - member, - member>, - composite_key_compare< - CanonDNSNameCompare, std::less>>, + composite_key< + NegCacheEntry, + member, + member>, + composite_key_compare< + CanonDNSNameCompare, std::less>>, sequenced>, hashed_non_unique, - member>>> + member>>> negcache_t; struct MapCombo diff --git a/pdns/recursordist/taskqueue.hh b/pdns/recursordist/taskqueue.hh index 0fe61428f9..5ebb3aece3 100644 --- a/pdns/recursordist/taskqueue.hh +++ b/pdns/recursordist/taskqueue.hh @@ -58,10 +58,10 @@ typedef multi_index_container< ResolveTask, indexed_by< hashed_unique, - composite_key, - member, - member>>, + composite_key, + member, + member>>, sequenced>>> queue_t; diff --git a/pdns/recursordist/test-filterpo_cc.cc b/pdns/recursordist/test-filterpo_cc.cc index 181f0981e1..aa2fb17f0c 100644 --- a/pdns/recursordist/test-filterpo_cc.cc +++ b/pdns/recursordist/test-filterpo_cc.cc @@ -231,14 +231,14 @@ BOOST_AUTO_TEST_CASE(test_filter_policies_wildcard_with_enc) zone->setRefresh(99); zone->addQNameTrigger(DNSName("bcbsks.com.102.112.2o7.net."), - DNSFilterEngine::Policy(DNSFilterEngine::PolicyKind::NoAction, - DNSFilterEngine::PolicyType::QName)); + DNSFilterEngine::Policy(DNSFilterEngine::PolicyKind::NoAction, + DNSFilterEngine::PolicyType::QName)); zone->addQNameTrigger(DNSName("2o7.net."), - DNSFilterEngine::Policy(DNSFilterEngine::PolicyKind::Drop, - DNSFilterEngine::PolicyType::QName)); + DNSFilterEngine::Policy(DNSFilterEngine::PolicyKind::Drop, + DNSFilterEngine::PolicyType::QName)); zone->addQNameTrigger(DNSName("*.2o7.net."), - DNSFilterEngine::Policy(DNSFilterEngine::PolicyKind::Drop, - DNSFilterEngine::PolicyType::QName)); + DNSFilterEngine::Policy(DNSFilterEngine::PolicyKind::Drop, + DNSFilterEngine::PolicyType::QName)); dfe.addZone(zone); diff --git a/pdns/recursordist/test-mtasker.cc b/pdns/recursordist/test-mtasker.cc index 372badc437..f2f74ca662 100644 --- a/pdns/recursordist/test-mtasker.cc +++ b/pdns/recursordist/test-mtasker.cc @@ -56,6 +56,6 @@ BOOST_AUTO_TEST_CASE(test_MtaskerException) mt.schedule(&now); } }, - std::exception); + std::exception); } BOOST_AUTO_TEST_SUITE_END() diff --git a/pdns/recursordist/test-syncres_cc3.cc b/pdns/recursordist/test-syncres_cc3.cc index 699d52b2ac..856efffd19 100644 --- a/pdns/recursordist/test-syncres_cc3.cc +++ b/pdns/recursordist/test-syncres_cc3.cc @@ -123,8 +123,8 @@ static void test_no_data_f(bool qmin) sr->setAsyncCallback( [target](const ComboAddress& ip, const DNSName& domain, int type, bool doTCP, bool sendRDQuery, int EDNS0Level, - struct timeval* now, boost::optional& srcmask, boost::optional context, - LWResult* res, bool* chained) { + struct timeval* now, boost::optional& srcmask, boost::optional context, + LWResult* res, bool* chained) { setLWResult(res, 0, true, false, true); return LWResult::Result::Success; }); -- 2.47.2