diff options
author | Alon Zakai <alonzakai@gmail.com> | 2018-02-05 15:55:21 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-05 15:55:21 -0800 |
commit | d322b4f3ce429de5215fd52db24735b8f85ab878 (patch) | |
tree | 2e9ccead3d61d2dce7950eadb1a22de7d1c544b0 /src/support | |
parent | e33d487206e79b5e2fd1382627255a1ea39dad75 (diff) | |
download | binaryen-d322b4f3ce429de5215fd52db24735b8f85ab878.tar.gz binaryen-d322b4f3ce429de5215fd52db24735b8f85ab878.tar.bz2 binaryen-d322b4f3ce429de5215fd52db24735b8f85ab878.zip |
'std::string &' => 'std::string& ' (#1403)
The & on the type is the proper convention.
Diffstat (limited to 'src/support')
-rw-r--r-- | src/support/command-line.h | 10 | ||||
-rw-r--r-- | src/support/file.cpp | 8 | ||||
-rw-r--r-- | src/support/file.h | 8 |
3 files changed, 13 insertions, 13 deletions
diff --git a/src/support/command-line.h b/src/support/command-line.h index 7c3ae528f..89bf72070 100644 --- a/src/support/command-line.h +++ b/src/support/command-line.h @@ -34,18 +34,18 @@ namespace wasm { class Options { public: - typedef std::function<void(Options *, const std::string &)> Action; + typedef std::function<void(Options *, const std::string& )> Action; enum class Arguments { Zero, One, N, Optional }; bool debug; std::map<std::string, std::string> extra; - Options(const std::string &command, const std::string &description); + Options(const std::string& command, const std::string& description); ~Options(); - Options &add(const std::string &longName, const std::string &shortName, - const std::string &description, Arguments arguments, + Options &add(const std::string& longName, const std::string& shortName, + const std::string& description, Arguments arguments, const Action &action); - Options &add_positional(const std::string &name, Arguments arguments, + Options &add_positional(const std::string& name, Arguments arguments, const Action &action); void parse(int argc, const char *argv[]); diff --git a/src/support/file.cpp b/src/support/file.cpp index bd6f2d4bd..382b94e4d 100644 --- a/src/support/file.cpp +++ b/src/support/file.cpp @@ -22,7 +22,7 @@ #include <limits> template <typename T> -T wasm::read_file(const std::string &filename, Flags::BinaryOption binary, Flags::DebugOption debug) { +T wasm::read_file(const std::string& filename, Flags::BinaryOption binary, Flags::DebugOption debug) { if (debug == Flags::Debug) std::cerr << "Loading '" << filename << "'..." << std::endl; std::ifstream infile; std::ios_base::openmode flags = std::ifstream::in; @@ -52,10 +52,10 @@ T wasm::read_file(const std::string &filename, Flags::BinaryOption binary, Flags } // Explicit instantiations for the explicit specializations. -template std::string wasm::read_file<>(const std::string &, Flags::BinaryOption, Flags::DebugOption); -template std::vector<char> wasm::read_file<>(const std::string &, Flags::BinaryOption, Flags::DebugOption); +template std::string wasm::read_file<>(const std::string& , Flags::BinaryOption, Flags::DebugOption); +template std::vector<char> wasm::read_file<>(const std::string& , Flags::BinaryOption, Flags::DebugOption); -wasm::Output::Output(const std::string &filename, Flags::BinaryOption binary, Flags::DebugOption debug) +wasm::Output::Output(const std::string& filename, Flags::BinaryOption binary, Flags::DebugOption debug) : outfile(), out([this, filename, binary, debug]() { std::streambuf *buffer; if (filename.size()) { diff --git a/src/support/file.h b/src/support/file.h index b0df8fd06..c15e3f6ce 100644 --- a/src/support/file.h +++ b/src/support/file.h @@ -40,15 +40,15 @@ namespace Flags { } template <typename T> -T read_file(const std::string &filename, Flags::BinaryOption binary, Flags::DebugOption debug); +T read_file(const std::string& filename, Flags::BinaryOption binary, Flags::DebugOption debug); // Declare the valid explicit specializations. -extern template std::string read_file<>(const std::string &, Flags::BinaryOption, Flags::DebugOption); -extern template std::vector<char> read_file<>(const std::string &, Flags::BinaryOption, Flags::DebugOption); +extern template std::string read_file<>(const std::string& , Flags::BinaryOption, Flags::DebugOption); +extern template std::vector<char> read_file<>(const std::string& , Flags::BinaryOption, Flags::DebugOption); class Output { public: // An empty filename will open stdout instead. - Output(const std::string &filename, Flags::BinaryOption binary, Flags::DebugOption debug); + Output(const std::string& filename, Flags::BinaryOption binary, Flags::DebugOption debug); ~Output() = default; template <typename T> std::ostream &operator<<(const T &v) { |