diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2009-10-28 14:29:45 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2009-10-28 14:29:45 +0200 |
commit | ca4c01c87aedc82366ff0d253f5f8eb8d9d00954 (patch) | |
tree | ef52673f3b06d37c8d2ab5293c007193ecdb73b8 | |
parent | 7f089045bce33cf309f807d1cee97a8beb7bb859 (diff) |
Use assignment initialization for fundamental types
-rw-r--r-- | cli/runtime-source.cxx | 6 | ||||
-rw-r--r-- | cli/source.cxx | 8 | ||||
-rw-r--r-- | examples/features/driver.cxx | 2 |
3 files changed, 8 insertions, 8 deletions
diff --git a/cli/runtime-source.cxx b/cli/runtime-source.cxx index 1be8f13..9f96416 100644 --- a/cli/runtime-source.cxx +++ b/cli/runtime-source.cxx @@ -160,7 +160,7 @@ generate_runtime_source (context& ctx) << "parse (std::vector<X>& v, char** argv, int n)" << "{" << "X x;" - << "int i (parser<X>::parse (x, argv, n));" + << "int i = parser<X>::parse (x, argv, n);" << "v.push_back (x);" << "return i;" << "}" @@ -175,7 +175,7 @@ generate_runtime_source (context& ctx) << "parse (std::set<X>& s, char** argv, int n)" << "{" << "X x;" - << "int i (parser<X>::parse (x, argv, n));" + << "int i = parser<X>::parse (x, argv, n);" << "s.insert (x);" << "return i;" << "}" @@ -192,7 +192,7 @@ generate_runtime_source (context& ctx) << "if (n > 1)" << "{" << "std::string s (argv[1]);" - << "std::string::size_type p (s.find ('='));" + << "std::string::size_type p = s.find ('=');" << endl << "if (p == std::string::npos)" << "{" diff --git a/cli/source.cxx b/cli/source.cxx index 991968c..7a23c30 100644 --- a/cli/source.cxx +++ b/cli/source.cxx @@ -77,8 +77,8 @@ namespace for (names::name_iterator i (n.name_begin ()); i != n.name_end (); ++i) { os << "_cli_" << scope << "_map_[\"" << *i << "\"] = " << endl - << "&::cli::thunk<" << scope << ", " << type << ", " << - "&" << scope << "::" << member << ">;"; + << "&::cli::thunk< " << scope << ", " << type << ", " << + "&" << scope << "::" << member << " >;"; } } }; @@ -205,12 +205,12 @@ namespace << "{"; if (sep) - os << "bool opt (true);" // Still recognizing options. + os << "bool opt = true;" // Still recognizing options. << endl; os << "for (; start < argc;)" << "{" - << "const char* s (argv[start]);"; + << "const char* s = argv[start];"; if (sep) os << endl diff --git a/examples/features/driver.cxx b/examples/features/driver.cxx index 339f4c1..3dec252 100644 --- a/examples/features/driver.cxx +++ b/examples/features/driver.cxx @@ -47,7 +47,7 @@ main (int argc, char* argv[]) // --map | -m // typedef map<std::string, std::string> str_map; - const str_map& m (o.map ()); + const str_map& m = o.map (); str_map::const_iterator i (m.find ("a")); if (i != m.end ()) |