]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Tidy
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Wed, 10 Jul 2024 14:05:28 +0000 (16:05 +0200)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Mon, 22 Jul 2024 08:43:04 +0000 (10:43 +0200)
.not-formatted
pdns/version.cc
pdns/version.hh

index 88b9ab05c68ec0c2ba11b90fc99476c7ae2a1280..4d48f339e646d8214170fa2fb630a22b9a3797f8 100644 (file)
 ./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
index 56aa8f3bcd44a8f9ca37e6b24b675cc34510570c..d17ac15f18eebba006c1395783692944f4a3f4c1 100644 (file)
@@ -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()
index 36361a5fbea2aa9ee99acb6b1d37a202c968b541..9d5ef1966af76998c89c6f49ff47620e7953ec9e 100644 (file)
@@ -20,7 +20,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 #pragma once
-#include "namespaces.hh"
+#include <string>
 
 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();