From: Mukund Sivaraman Date: Tue, 18 Dec 2012 09:50:51 +0000 (+0530) Subject: [master] Rename RRTTL::MAX() to MAX_TTL() to avoid shadowing X-Git-Tag: bind10-1.0.0-beta-release~13^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=55e0fb24720f98d51eeff77af6bdc0dff8649fa4;p=thirdparty%2Fkea.git [master] Rename RRTTL::MAX() to MAX_TTL() to avoid shadowing OpenBSD, NetBSD and some builds on MacOS don't like it. --- diff --git a/src/lib/dns/master_loader.cc b/src/lib/dns/master_loader.cc index 5ee09f59f3..247b4c1b9e 100644 --- a/src/lib/dns/master_loader.cc +++ b/src/lib/dns/master_loader.cc @@ -208,7 +208,7 @@ private: // RR and the lexer is positioned at the next line. It's just for // calculating the accurate source line when callback is necessary. void limitTTL(RRTTL& ttl, bool post_parsing) { - if (ttl > RRTTL::MAX()) { + if (ttl > RRTTL::MAX_TTL()) { const size_t src_line = lexer_.getSourceLine() - (post_parsing ? 1 : 0); callbacks_.warning(lexer_.getSourceName(), src_line, diff --git a/src/lib/dns/rrttl.h b/src/lib/dns/rrttl.h index e160a1e1a7..7904d84871 100644 --- a/src/lib/dns/rrttl.h +++ b/src/lib/dns/rrttl.h @@ -293,7 +293,7 @@ public: /// /// \note At the moment an RRTTL object can have a value larger than /// this limit. We may revisit it in a future version. - static const RRTTL& MAX() { + static const RRTTL& MAX_TTL() { static const RRTTL max_ttl(0x7fffffff); return (max_ttl); } diff --git a/src/lib/dns/tests/rrttl_unittest.cc b/src/lib/dns/tests/rrttl_unittest.cc index 916f720e6a..8897102dde 100644 --- a/src/lib/dns/tests/rrttl_unittest.cc +++ b/src/lib/dns/tests/rrttl_unittest.cc @@ -266,7 +266,7 @@ TEST_F(RRTTLTest, gthan) { } TEST_F(RRTTLTest, maxTTL) { - EXPECT_EQ((1u << 31) - 1, RRTTL::MAX().getValue()); + EXPECT_EQ((1u << 31) - 1, RRTTL::MAX_TTL().getValue()); } // test operator<<. We simply confirm it appends the result of toText().