summaryrefslogtreecommitdiffstats
path: root/src/lib/dns/rrttl.cc
diff options
context:
space:
mode:
authorJINMEI Tatuya <jinmei@isc.org>2012-11-06 08:13:10 +0100
committerJINMEI Tatuya <jinmei@isc.org>2012-11-06 08:13:10 +0100
commit4e410c83e9fb78be7c548c1184769f5a8a584b2c (patch)
tree71b1cac900c7b3d8b8ed91744ffda3ed668ef0b2 /src/lib/dns/rrttl.cc
parent[2384] Provide a note about used data type (diff)
downloadkea-4e410c83e9fb78be7c548c1184769f5a8a584b2c.tar.xz
kea-4e410c83e9fb78be7c548c1184769f5a8a584b2c.zip
[2384] style nits: typo, folded short lines, unnecessary ;, paren for sizeof
Diffstat (limited to 'src/lib/dns/rrttl.cc')
-rw-r--r--src/lib/dns/rrttl.cc9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/lib/dns/rrttl.cc b/src/lib/dns/rrttl.cc
index 667b634912..e8a3de4df9 100644
--- a/src/lib/dns/rrttl.cc
+++ b/src/lib/dns/rrttl.cc
@@ -60,7 +60,7 @@ namespace dns {
RRTTL::RRTTL(const std::string& ttlstr) {
// We use a larger data type during the computation. This is because
// some compilers don't fail when out of range, so we check the range
- // ourself later.
+ // ourselves later.
int64_t val = 0;
const string::const_iterator end = ttlstr.end();
@@ -69,14 +69,13 @@ RRTTL::RRTTL(const std::string& ttlstr) {
try {
while (pos != end) {
// Find the first unit, if there's any.
- const string::const_iterator unit = find_if(pos, end,
- myIsalpha);
+ const string::const_iterator unit = find_if(pos, end, myIsalpha);
// Default multiplication if no unit.
uint32_t multiply = 1;
if (unit != end) {
// Find the unit and get the size.
bool found = false;
- for (size_t i = 0; i < sizeof units / sizeof *units; ++i) {
+ for (size_t i = 0; i < sizeof(units) / sizeof(*units); ++i) {
if (toupper(*unit) == units[i].unit) {
found = true;
multiply = units[i].multiply;
@@ -99,7 +98,7 @@ RRTTL::RRTTL(const std::string& ttlstr) {
if (pos != end) {
++pos;
}
- };
+ }
} catch (const boost::bad_lexical_cast&) {
isc_throw(InvalidRRTTL, "invalid TTL");
}