From 0395f3b9fcd1ebd96bc011c2cdd8327b29854019 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Wed, 3 Apr 2013 18:51:40 +0200 Subject: [PATCH] fix compilation with clang++ --- src/command_manager.hh | 2 +- src/commands.cc | 8 +++++--- src/main.cc | 5 +++-- src/parameters_parser.hh | 3 ++- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/command_manager.hh b/src/command_manager.hh index f166f739..a8af72ac 100644 --- a/src/command_manager.hh +++ b/src/command_manager.hh @@ -51,7 +51,7 @@ class CommandManager : public Singleton public: void execute(const String& command_line, Context& context, const memoryview& shell_params = {}, - const EnvVarMap& env_vars = {}); + const EnvVarMap& env_vars = EnvVarMap{}); Completions complete(const Context& context, const String& command_line, ByteCount cursor_pos); diff --git a/src/commands.cc b/src/commands.cc index d8a1e7ed..b4e4f46c 100644 --- a/src/commands.cc +++ b/src/commands.cc @@ -379,7 +379,7 @@ void define_command(const CommandParameters& params, Context& context) if (parser.has_option("shell-params")) { cmd = [=](const CommandParameters& params, Context& context) { - CommandManager::instance().execute(commands, context, params, {}); + CommandManager::instance().execute(commands, context, params); }; } else @@ -708,14 +708,16 @@ void try_catch(const CommandParameters& params, Context& context) void define_color_alias(const CommandParameters& params, Context& context) { - ParametersParser parser(params, {}, ParametersParser::Flags::None, 2, 2); + ParametersParser parser(params, OptionMap{}, + ParametersParser::Flags::None, 2, 2); ColorRegistry::instance().register_alias( parser[0], parser[1], true); } void set_client_name(const CommandParameters& params, Context& context) { - ParametersParser parser(params, {}, ParametersParser::Flags::None, 1, 1); + ParametersParser parser(params, OptionMap{}, + ParametersParser::Flags::None, 1, 1); ClientManager::instance().set_client_name(context, params[0]); } diff --git a/src/main.cc b/src/main.cc index cf2b3f9b..a20a633b 100644 --- a/src/main.cc +++ b/src/main.cc @@ -164,7 +164,8 @@ void do_pipe(Context& context) std::vector strings; for (auto& sel : context.editor().selections()) strings.push_back(ShellManager::instance().pipe({sel.begin(), sel.end()}, - cmdline, context, {}, {})); + cmdline, context, {}, + EnvVarMap{})); editor.insert(strings, InsertMode::Replace); }); } @@ -778,7 +779,7 @@ void create_local_client(const String& init_command) { if (not ClientManager::instance().empty() and fork()) { - this->~NCursesUI(); + this->NCursesUI::~NCursesUI(); puts("detached from terminal\n"); exit(0); } diff --git a/src/parameters_parser.hh b/src/parameters_parser.hh index 98d138b8..ca159922 100644 --- a/src/parameters_parser.hh +++ b/src/parameters_parser.hh @@ -29,6 +29,7 @@ struct wrong_argument_count : runtime_error wrong_argument_count() : runtime_error("wrong argument count") {} }; +using OptionMap = std::unordered_map; // ParameterParser provides tools to parse command parameters. // There are 3 types of parameters: @@ -55,7 +56,7 @@ struct ParametersParser // they are understood as string options, else they are understood as // boolean option. ParametersParser(const ParameterList& params, - std::unordered_map options, + OptionMap options, Flags flags = Flags::None, size_t min_positionals = 0, size_t max_positionals = -1);