BIND 10 trac2371, updated. 430b6e2f075a64df9e22d1a63dcf2ecade935cdc [2371] move the definition of END_OF_STREAM from test to the main impl .cc.
BIND 10 source code commits
bind10-changes at lists.isc.org
Tue Nov 6 16:58:16 UTC 2012
The branch, trac2371 has been updated
via 430b6e2f075a64df9e22d1a63dcf2ecade935cdc (commit)
from f5c629c8fa3da5089a4260187901b2d36799a2f2 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 430b6e2f075a64df9e22d1a63dcf2ecade935cdc
Author: JINMEI Tatuya <jinmei at isc.org>
Date: Tue Nov 6 08:56:50 2012 -0800
[2371] move the definition of END_OF_STREAM from test to the main impl .cc.
based on review discussions. it makes sense as we cannot assume its address
is never needed in non test applications.
-----------------------------------------------------------------------
Summary of changes:
src/lib/dns/master_lexer_inputsource.cc | 4 ++++
src/lib/dns/master_lexer_inputsource.h | 5 +++++
.../dns/tests/master_lexer_inputsource_unittest.cc | 4 ----
3 files changed, 9 insertions(+), 4 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/lib/dns/master_lexer_inputsource.cc b/src/lib/dns/master_lexer_inputsource.cc
index f38d6c3..ea249cf 100644
--- a/src/lib/dns/master_lexer_inputsource.cc
+++ b/src/lib/dns/master_lexer_inputsource.cc
@@ -29,6 +29,10 @@ createStreamName(std::istream& input_stream) {
} // end of unnamed namespace
+// Explicit definition of class static constant. The value is given in the
+// declaration so it's not needed here.
+const int InputSource::END_OF_STREAM;
+
InputSource::InputSource(std::istream& input_stream) :
at_eof_(false),
line_(1),
diff --git a/src/lib/dns/master_lexer_inputsource.h b/src/lib/dns/master_lexer_inputsource.h
index 9251bca..37d0b78 100644
--- a/src/lib/dns/master_lexer_inputsource.h
+++ b/src/lib/dns/master_lexer_inputsource.h
@@ -38,6 +38,11 @@ namespace master_lexer_internal {
class InputSource {
public:
/// \brief Returned by getChar() when end of stream is reached.
+ ///
+ /// \note C++ allows a static const class member of an integral type to
+ /// be used without explicit definition as long as its address isn't
+ /// required. But, since this is a public member variable and we cannot
+ /// assume how it's used, we give a definition in the implementation.
static const int END_OF_STREAM = -1;
/// \brief Exception thrown when ungetChar() is made to go before
diff --git a/src/lib/dns/tests/master_lexer_inputsource_unittest.cc b/src/lib/dns/tests/master_lexer_inputsource_unittest.cc
index f78edb5..8e0cf62 100644
--- a/src/lib/dns/tests/master_lexer_inputsource_unittest.cc
+++ b/src/lib/dns/tests/master_lexer_inputsource_unittest.cc
@@ -27,10 +27,6 @@ using namespace std;
using namespace isc::dns;
using namespace isc::dns::master_lexer_internal;
-// Some compilers cannot find symbols of class constants when used in the
-// EXPECT_xxx macros, so we need explicit declaration.
-const int InputSource::END_OF_STREAM;
-
namespace {
class InputSourceTest : public ::testing::Test {
More information about the bind10-changes
mailing list