summaryrefslogtreecommitdiffstats
path: root/src/lib/dns
diff options
context:
space:
mode:
authorPiotrek Zadroga <piotrek@isc.org>2024-02-26 12:27:52 +0100
committerPiotrek Zadroga <piotrek@isc.org>2024-03-20 16:17:29 +0100
commitf40282956735955d938374040e67d982450ee799 (patch)
tree77daa13c7638a80c84f1c6729b5601d90bb1e985 /src/lib/dns
parent[#3212] reorder namespaces (diff)
downloadkea-f40282956735955d938374040e67d982450ee799.tar.xz
kea-f40282956735955d938374040e67d982450ee799.zip
[#3212] remove redundant specifier
Diffstat (limited to 'src/lib/dns')
-rw-r--r--src/lib/dns/time_utils.cc12
-rw-r--r--src/lib/dns/time_utils.h7
2 files changed, 10 insertions, 9 deletions
diff --git a/src/lib/dns/time_utils.cc b/src/lib/dns/time_utils.cc
index 0bccd68608..2a34afeb89 100644
--- a/src/lib/dns/time_utils.cc
+++ b/src/lib/dns/time_utils.cc
@@ -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
diff --git a/src/lib/dns/time_utils.h b/src/lib/dns/time_utils.h
index af61554e34..283710d5d3 100644
--- a/src/lib/dns/time_utils.h
+++ b/src/lib/dns/time_utils.h
@@ -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);
///@}