From: Marcin Siodelski Date: Wed, 24 Jul 2019 10:47:43 +0000 (+0200) Subject: [#174,!414] Corrected whitespaces and copyright dates. X-Git-Tag: Kea-1.6.1~10^2~112 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b7483950cc3a76cd8133aa9721e09f3ab3dfa84e;p=thirdparty%2Fkea.git [#174,!414] Corrected whitespaces and copyright dates. As a result of the review. --- diff --git a/src/lib/http/date_time.cc b/src/lib/http/date_time.cc index e118bf3fec..cd7824a5bd 100644 --- a/src/lib/http/date_time.cc +++ b/src/lib/http/date_time.cc @@ -1,4 +1,4 @@ -// Copyright (C) 2016-2018 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2016-2019 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/src/lib/http/date_time.h b/src/lib/http/date_time.h index 309f5a1903..ba96ba3415 100644 --- a/src/lib/http/date_time.h +++ b/src/lib/http/date_time.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016-2017 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2016-2019 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -43,8 +43,8 @@ public: /// @brief Default constructor. /// - /// Sets current universal time as time value. - /// Time resolution is to seconds (i.e no fractional seconds). + /// Sets current universal time as time value. + /// Time resolution is to seconds (i.e no fractional seconds). HttpDateTime(); /// @brief Construct from @c boost::posix_time::ptime object. diff --git a/src/lib/util/boost_time_utils.cc b/src/lib/util/boost_time_utils.cc index e35f3a1f75..d0fb870d37 100644 --- a/src/lib/util/boost_time_utils.cc +++ b/src/lib/util/boost_time_utils.cc @@ -1,4 +1,4 @@ -// Copyright (C) 2015 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2015-2019 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -37,9 +37,9 @@ isc::util::durationToText(boost::posix_time::time_duration dur, size_t fsecs_pre } width = fsecs_precision; - } + } - s << "." << std::setw(width) + s << "." << std::setw(width) << std::setfill('0') << fsecs; } diff --git a/src/lib/util/boost_time_utils.h b/src/lib/util/boost_time_utils.h index 74ed36d392..d069af5346 100644 --- a/src/lib/util/boost_time_utils.h +++ b/src/lib/util/boost_time_utils.h @@ -1,4 +1,4 @@ -// Copyright (C) 2015 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2015-2019 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -32,7 +32,7 @@ const size_t DEFAULT_FRAC_SECS=boost::posix_time::time_duration::num_fractional_ /// Zero omits the value. /// /// @return a string representing time -std::string ptimeToText(boost::posix_time::ptime t, +std::string ptimeToText(boost::posix_time::ptime t, size_t fsecs_precision = DEFAULT_FRAC_SECS); /// @brief Converts StatsDuration to text diff --git a/src/lib/util/tests/boost_time_utils_unittest.cc b/src/lib/util/tests/boost_time_utils_unittest.cc index db80d7f912..ee981cce7b 100644 --- a/src/lib/util/tests/boost_time_utils_unittest.cc +++ b/src/lib/util/tests/boost_time_utils_unittest.cc @@ -1,4 +1,4 @@ -// Copyright (C) 2015-2016 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2015-2019 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -30,9 +30,9 @@ TEST(BoostTimeUtilsTest, epoch) { for (int precision = 0; precision <= DEFAULT_FRAC_SECS; ++precision) { if (precision == 1) { expected.push_back('.'); - } + } - if (precision >= 1) { + if (precision >= 1) { expected.push_back('0'); } @@ -42,7 +42,7 @@ TEST(BoostTimeUtilsTest, epoch) { // Expected string should have same precision as default, so // test the default. - sepoch = ptimeToText(pepoch); + sepoch = ptimeToText(pepoch); EXPECT_EQ(expected, sepoch); // Now test a requested precision beyond default. We should @@ -64,7 +64,7 @@ TEST(BoostTimeUtilsTest, bastilleDay) { if (precision == 1) { expected.push_back('.'); expected.push_back('5'); - } else if (precision > 1) { + } else if (precision > 1) { expected.push_back('0'); } @@ -74,7 +74,7 @@ TEST(BoostTimeUtilsTest, bastilleDay) { // Expected string should have same precision as default, so // test the default. - sbast = ptimeToText(pbast); + sbast = ptimeToText(pbast); EXPECT_EQ(expected, sbast); // Now test a requested precision beyond default. We should