[svn] commit: r1665 - /trunk/src/lib/cc/data.cc
BIND 10 source code commits
bind10-changes at lists.isc.org
Wed Mar 31 19:35:21 UTC 2010
Author: jinmei
Date: Wed Mar 31 19:35:20 2010
New Revision: 1665
Log:
cleanup: reduced unused function parameters, constified variables when possible.
Modified:
trunk/src/lib/cc/data.cc
Modified: trunk/src/lib/cc/data.cc
==============================================================================
--- trunk/src/lib/cc/data.cc (original)
+++ trunk/src/lib/cc/data.cc Wed Mar 31 19:35:20 2010
@@ -324,7 +324,8 @@
}
std::string
-str_from_stringstream(std::istream &in, const std::string& file, int& line, int& pos) throw (ParseError)
+str_from_stringstream(std::istream &in, const std::string& file, const int line,
+ int& pos) throw (ParseError)
{
char c = 0;
std::stringstream ss;
@@ -349,7 +350,7 @@
}
std::string
-word_from_stringstream(std::istream &in, int& line UNUSED_PARAM, int& pos) {
+word_from_stringstream(std::istream &in, int& pos) {
std::stringstream ss;
while (isalpha(in.peek())) {
ss << (char) in.get();
@@ -379,9 +380,7 @@
}
ElementPtr
-from_stringstream_int_or_double(std::istream &in, int &line UNUSED_PARAM,
- int &pos)
-{
+from_stringstream_int_or_double(std::istream &in, int &pos) {
int i;
in >> i;
pos += count_chars_i(i);
@@ -397,9 +396,10 @@
}
ElementPtr
-from_stringstream_bool(std::istream &in, const std::string& file, int& line, int& pos)
-{
- const std::string word = word_from_stringstream(in, line, pos);
+from_stringstream_bool(std::istream &in, const std::string& file,
+ const int line, int& pos)
+{
+ const std::string word = word_from_stringstream(in, pos);
if (boost::iequals(word, "True")) {
return Element::create(true);
} else if (boost::iequals(word, "False")) {
@@ -503,7 +503,7 @@
case '9':
case '0':
in.putback(c);
- element = from_stringstream_int_or_double(in, line, pos);
+ element = from_stringstream_int_or_double(in, pos);
el_read = true;
break;
case 't':
@@ -680,7 +680,7 @@
}
ElementPtr
-decode_bool(std::stringstream& in, int& item_length UNUSED_PARAM) {
+decode_bool(std::stringstream& in) {
const char c = in.get();
if (c == '1') {
@@ -691,15 +691,15 @@
}
ElementPtr
-decode_int(std::stringstream& in, int& item_length UNUSED_PARAM) {
- int skip, me;
- return from_stringstream_int_or_double(in, skip, me);
-}
-
-ElementPtr
-decode_real(std::stringstream& in, int& item_length UNUSED_PARAM) {
- int skip, me;
- return from_stringstream_int_or_double(in, skip, me);
+decode_int(std::stringstream& in) {
+ int me;
+ return from_stringstream_int_or_double(in, me);
+}
+
+ElementPtr
+decode_real(std::stringstream& in) {
+ int me;
+ return from_stringstream_int_or_double(in, me);
}
ElementPtr
@@ -716,7 +716,7 @@
}
ElementPtr
-decode_hash(std::stringstream& in, int& item_length) {
+decode_hash(std::stringstream& in, int item_length) {
std::map<std::string, ElementPtr> m;
std::pair<std::string, ElementPtr> p;
@@ -730,7 +730,7 @@
}
ElementPtr
-decode_list(std::stringstream& in, int& item_length) {
+decode_list(std::stringstream& in, int item_length) {
std::vector<ElementPtr> v;
while (item_length > 0) {
@@ -740,7 +740,7 @@
}
ElementPtr
-decode_null(std::stringstream& in UNUSED_PARAM, int& item_length UNUSED_PARAM) {
+decode_null() {
return Element::create("NULL");
}
@@ -774,13 +774,13 @@
switch (type) {
case ITEM_BOOL:
- element = decode_bool(in, item_length);
+ element = decode_bool(in);
break;
case ITEM_INT:
- element = decode_int(in, item_length);
+ element = decode_int(in);
break;
case ITEM_REAL:
- element = decode_real(in, item_length);
+ element = decode_real(in);
break;
case ITEM_BLOB:
element = decode_blob(in, item_length);
@@ -796,7 +796,7 @@
element = decode_list(in, item_length);
break;
case ITEM_NULL:
- element = decode_null(in, item_length);
+ element = decode_null();
break;
}
More information about the bind10-changes
mailing list