From: JINMEI Tatuya Date: Tue, 6 Nov 2012 07:13:10 +0000 (-0800) Subject: [2384] style nits: typo, folded short lines, unnecessary ;, paren for sizeof X-Git-Tag: trac2487_base~1^2~29^2~2^2~17 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4e410c83e9fb78be7c548c1184769f5a8a584b2c;p=thirdparty%2Fkea.git [2384] style nits: typo, folded short lines, unnecessary ;, paren for sizeof --- 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"); }