From: Otto Moerbeek Date: Wed, 10 Jul 2024 14:05:28 +0000 (+0200) Subject: Tidy X-Git-Tag: rec-5.2.0-alpha1~155^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b4fd9d0b08eb7a312f59b68e0af00e9c3854a4c6;p=thirdparty%2Fpdns.git Tidy --- diff --git a/.not-formatted b/.not-formatted index 88b9ab05c6..4d48f339e6 100644 --- a/.not-formatted +++ b/.not-formatted @@ -229,8 +229,6 @@ ./pdns/uuid-utils.cc ./pdns/validate.cc ./pdns/validate.hh -./pdns/version.cc -./pdns/version.hh ./pdns/webserver.cc ./pdns/webserver.hh ./pdns/zone2json.cc diff --git a/pdns/version.cc b/pdns/version.cc index 56aa8f3bcd..d17ac15f18 100644 --- a/pdns/version.cc +++ b/pdns/version.cc @@ -19,9 +19,9 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifdef HAVE_CONFIG_H + #include "config.h" -#endif + #include "logger.hh" #include "version.hh" #include "dnsbackend.hh" @@ -33,11 +33,11 @@ static ProductType productType; string compilerVersion() { #if defined(__clang__) - return string("clang " __clang_version__); + return "clang " __clang_version__; #elif defined(__GNUC__) - return string("gcc " __VERSION__); + return "gcc " __VERSION__; #else // add other compilers here - return string("Unknown compiler"); + return "Unknown compiler"; #endif } @@ -188,9 +188,11 @@ void showBuildConfiguration() const auto& modules = BackendMakers().getModules(); g_log << Logger::Warning << "Loaded modules: " << boost::join(modules, " ") << endl; #endif +// NOLINTBEGIN(cppcoreguidelines-macro-usage) #ifdef PDNS_CONFIG_ARGS #define double_escape(s) #s #define escape_quotes(s) double_escape(s) +// NOLINTEND(cppcoreguidelines-macro-usage) g_log << Logger::Warning << "Configured with: " << escape_quotes(PDNS_CONFIG_ARGS) << endl; #undef escape_quotes #undef double_escape @@ -199,17 +201,17 @@ void showBuildConfiguration() string fullVersionString() { - ostringstream s; - s << productName() << " " VERSION; + ostringstream ret; + ret << productName() << " " VERSION; #ifndef REPRODUCIBLE - s << " (built " __DATE__ " " __TIME__ " by " BUILD_HOST ")"; + ret << " (built " __DATE__ " " __TIME__ " by " BUILD_HOST ")"; #endif - return s.str(); + return ret.str(); } -void versionSetProduct(ProductType pt) +void versionSetProduct(ProductType productType_) { - productType = pt; + productType = productType_; } ProductType versionGetProduct() diff --git a/pdns/version.hh b/pdns/version.hh index 36361a5fbe..9d5ef1966a 100644 --- a/pdns/version.hh +++ b/pdns/version.hh @@ -20,7 +20,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #pragma once -#include "namespaces.hh" +#include enum ProductType { @@ -28,12 +28,12 @@ enum ProductType ProductRecursor }; -string compilerVersion(); +std::string compilerVersion(); void showProductVersion(); void showBuildConfiguration(); -string fullVersionString(); -string getPDNSVersion(); -string productName(); -string productTypeApiType(); -void versionSetProduct(ProductType pt); +std::string fullVersionString(); +std::string getPDNSVersion(); +std::string productName(); +std::string productTypeApiType(); +void versionSetProduct(ProductType productType_); ProductType versionGetProduct();