From 17233e945f1cdabe5cd04a044edec81fec01fe8e Mon Sep 17 00:00:00 2001 From: Thomas Fischer <thomas.fischer@ufz.de> Date: Thu, 16 Apr 2020 09:05:42 +0200 Subject: [PATCH] [BL] Fix clang-tidy google-readability-braces-around-statements. --- BaseLib/DateTools.cpp | 8 ++++++++ BaseLib/FileTools.h | 2 ++ BaseLib/IO/XmlIO/Qt/XMLQtInterface.cpp | 2 ++ 3 files changed, 12 insertions(+) diff --git a/BaseLib/DateTools.cpp b/BaseLib/DateTools.cpp index 973244a4307..0c90124691f 100644 --- a/BaseLib/DateTools.cpp +++ b/BaseLib/DateTools.cpp @@ -75,11 +75,15 @@ std::string date2string(double ddate) rest = rest % (y * 10000); auto m = static_cast<int>(std::floor(rest / 100.0)); if (m < 1 || m > 12) + { WARN("date2String(): month not in [1:12]."); + } rest = rest % (m * 100); int d = rest; if (d < 1 || d > 31) + { WARN("date2String(): day not in [1:31]."); + } std::string day = std::to_string(d); if (d < 10) @@ -116,10 +120,14 @@ int xmlDate2int(const std::string &s) { int d = atoi(s.substr(8,2).c_str()); if (d < 1 || d > 31) + { WARN("xmlDate2double(): day not in [1:31]."); + } int m = atoi(s.substr(5,2).c_str()); if (m < 1 || m > 12) + { WARN("xmlDate2double(): month not in [1:12]."); + } int y = atoi(s.substr(0,4).c_str()); return date2int(y, m, d); } diff --git a/BaseLib/FileTools.h b/BaseLib/FileTools.h index 7240acef54c..4f47d5b1d0d 100644 --- a/BaseLib/FileTools.h +++ b/BaseLib/FileTools.h @@ -101,7 +101,9 @@ std::vector<T> readBinaryArray(std::string const& filename, std::size_t const n) result.size()); if (!in.eof()) + { ERR("EOF reached.\n"); + } return std::vector<T>(); } diff --git a/BaseLib/IO/XmlIO/Qt/XMLQtInterface.cpp b/BaseLib/IO/XmlIO/Qt/XMLQtInterface.cpp index 95ed78d9f94..702d446337b 100644 --- a/BaseLib/IO/XmlIO/Qt/XMLQtInterface.cpp +++ b/BaseLib/IO/XmlIO/Qt/XMLQtInterface.cpp @@ -125,7 +125,9 @@ bool XMLQtInterface::checkHash() const INFO("File is valid, hashfile written."); } else + { WARN("File is valid but could not write hashfile!"); + } return true; } } // namespace IO -- GitLab