BIND 10 trac2572-fix, updated. 5eeb4b30cbea6d0f5588cf0ad542cdccd49510c1 [2572] avoid direct comparison between size_t and streampos
BIND 10 source code commits
bind10-changes at lists.isc.org
Tue Jan 15 02:30:50 UTC 2013
The branch, trac2572-fix has been updated
via 5eeb4b30cbea6d0f5588cf0ad542cdccd49510c1 (commit)
from 84ba4a728f827325e262bb91c2517f45efef5d7e (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 5eeb4b30cbea6d0f5588cf0ad542cdccd49510c1
Author: JINMEI Tatuya <jinmei at isc.org>
Date: Mon Jan 14 18:30:32 2013 -0800
[2572] avoid direct comparison between size_t and streampos
-----------------------------------------------------------------------
Summary of changes:
src/lib/dns/master_lexer_inputsource.cc | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/lib/dns/master_lexer_inputsource.cc b/src/lib/dns/master_lexer_inputsource.cc
index 7157c50..6e5ca18 100644
--- a/src/lib/dns/master_lexer_inputsource.cc
+++ b/src/lib/dns/master_lexer_inputsource.cc
@@ -59,7 +59,8 @@ getStreamSize(std::istream& is) {
is.clear(); // clear this error not to confuse later ops.
return (MasterLexer::SOURCE_SIZE_UNKNOWN);
}
- std::streampos len = is.tellg();
+ const std::streampos len = is.tellg();
+ size_t ret = len;
if (len == static_cast<std::streampos>(-1)) { // cast for some compilers
if (!is.fail()) {
// tellg() returns -1 if istream::fail() would be true, but it's
@@ -67,7 +68,7 @@ getStreamSize(std::istream& is) {
// In fact, with the combination of SunStudio and stlport,
// an stringstream created by the default constructor showed that
// behavior. We treat such cases as an unknown size.
- len = MasterLexer::SOURCE_SIZE_UNKNOWN;
+ ret = MasterLexer::SOURCE_SIZE_UNKNOWN;
} else {
isc_throw(InputSource::OpenError, "failed to get input size");
}
@@ -77,8 +78,8 @@ getStreamSize(std::istream& is) {
isc_throw(InputSource::OpenError,
"failed to seek beginning of input source");
}
- assert(len >= 0 || len == MasterLexer::SOURCE_SIZE_UNKNOWN);
- return (len);
+ assert(len >= 0 || ret == MasterLexer::SOURCE_SIZE_UNKNOWN);
+ return (ret);
}
} // end of unnamed namespace
More information about the bind10-changes
mailing list