]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#3212] remove redundant specifier
authorPiotrek Zadroga <piotrek@isc.org>
Mon, 26 Feb 2024 11:27:52 +0000 (12:27 +0100)
committerPiotrek Zadroga <piotrek@isc.org>
Wed, 20 Mar 2024 15:17:29 +0000 (15:17 +0000)
src/lib/dns/time_utils.cc
src/lib/dns/time_utils.h

index 0bccd68608d31a35e06320d0fa110af3fcba5e99..2a34afeb891da9e5d012c1e5d94354dc51bc0ca2 100644 (file)
@@ -23,7 +23,7 @@ using namespace std;
 namespace {
 int days[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
 
-inline bool
+bool
 isLeap(const int y) {
     return ((((y) % 4) == 0 && ((y) % 100) != 0) || ((y) % 400) == 0);
 }
@@ -42,14 +42,14 @@ monthSecs(const int month, const int year) {
 namespace isc {
 namespace util {
 namespace {
-const size_t DATE_LEN = 14;  // YYYYMMDDHHmmSS
+constexpr size_t DATE_LEN = 14;  // YYYYMMDDHHmmSS
 
-inline uint64_t
+uint64_t
 ull(const int c) {
     return (static_cast<uint64_t>(c));
 }
 
-inline void
+void
 checkRange(const unsigned min, const unsigned max, const unsigned value, const string& valname) {
     if ((value >= min) && (value <= max)) {
         return;
@@ -74,7 +74,7 @@ getTimeWrapper() {
         return (getTimeFunction());
     }
 
-    struct timeval now;
+    struct timeval now{};
     gettimeofday(&now, 0);
 
     return (static_cast<int64_t>(now.tv_sec));
@@ -83,7 +83,7 @@ getTimeWrapper() {
 
 string
 timeToText64(uint64_t value) {
-    struct tm tm;
+    struct tm tm{};
     unsigned int secs;
 
     // We cannot rely on gmtime() because time_t may not be of 64 bit
index af61554e34758495130d3fa07afa70f0f529266a..283710d5d3f3db6795d6c68da96cc824e44f9817 100644 (file)
@@ -112,7 +112,7 @@ timeFromText64(const std::string& time_txt);
 ///
 /// @param time_txt
 ///
-/// @return
+/// @return Seconds since epoch corresponding to @c time_txt as uint_32
 uint32_t
 timeFromText32(const std::string& time_txt);
 
@@ -125,6 +125,7 @@ timeFromText32(const std::string& time_txt);
 /// YYYY... form, an exception of class @c InvalidTime will be thrown.
 ///
 /// @param value Seconds since epoch to be converted.
+///
 /// @return Textual representation of @c value in the form of YYYYMMDDHHmmSS.
 ///
 /// @throw InvalidTime The given time specifies on or after year 10,000.
@@ -153,9 +154,9 @@ timeToText64(uint64_t value);
 /// 2^32-1 (the highest value in 32-bit unsigned integers) will be converted
 /// to "21060207062815", instead of "19691231235959".
 ///
-/// @param value
+/// @param value Seconds since epoch to be converted.
 ///
-/// @return
+/// @return Textual representation of @c value in the form of YYYYMMDDHHmmSS.
 std::string
 timeToText32(uint32_t value);
 ///@}