diff --git a/libs/libopenfpgashell/src/shell.h b/libs/libopenfpgashell/src/shell.h index 3075a8b75..5a8bb3340 100644 --- a/libs/libopenfpgashell/src/shell.h +++ b/libs/libopenfpgashell/src/shell.h @@ -157,7 +157,7 @@ class Shell { /* Wrapper function, which calls other command thru shell's APIs */ void set_command_execute_function(const ShellCommandId& cmd_id, - std::function&, T&, const Command&, const CommandContext&)> exec_func); + std::function*, T&, const Command&, const CommandContext&)> exec_func); void set_command_dependency( const ShellCommandId& cmd_id, @@ -240,7 +240,7 @@ class Shell { command_builtin_execute_functions_; vtr::vector> command_macro_execute_functions_; - vtr::vector&, T&, const Command&, const CommandContext&)>> + vtr::vector*, T&, const Command&, const CommandContext&)>> command_wrapper_execute_functions_; /* Type of execute functions for each command. diff --git a/libs/libopenfpgashell/src/shell.tpp b/libs/libopenfpgashell/src/shell.tpp index abec58c46..7aef11fe2 100644 --- a/libs/libopenfpgashell/src/shell.tpp +++ b/libs/libopenfpgashell/src/shell.tpp @@ -210,7 +210,7 @@ void Shell::set_command_execute_function(const ShellCommandId& cmd_id, template void Shell::set_command_execute_function(const ShellCommandId& cmd_id, - std::function&, T&, const Command&, const CommandContext&)> exec_func) { + std::function*, T&, const Command&, const CommandContext&)> exec_func) { VTR_ASSERT(true == valid_command_id(cmd_id)); command_execute_function_types_[cmd_id] = WRAPPER; command_wrapper_execute_functions_[cmd_id] = exec_func; @@ -551,7 +551,7 @@ int Shell::execute_command(const char* cmd_line, /* Execute the command depending on the type of function ! */ switch (command_execute_function_types_[cmd_id]) { case WRAPPER: - command_status_[cmd_id] = command_wrapper_execute_functions_[cmd_id](*this, common_context, commands_[cmd_id], command_contexts_[cmd_id]); + command_status_[cmd_id] = command_wrapper_execute_functions_[cmd_id](this, common_context, commands_[cmd_id], command_contexts_[cmd_id]); break; case CONST_STANDARD: command_status_[cmd_id] = command_const_execute_functions_[cmd_id](common_context, commands_[cmd_id], command_contexts_[cmd_id]); diff --git a/openfpga/src/base/basic_command.cpp b/openfpga/src/base/basic_command.cpp index 14d88fbcc..2be871abe 100644 --- a/openfpga/src/base/basic_command.cpp +++ b/openfpga/src/base/basic_command.cpp @@ -12,7 +12,7 @@ /* begin namespace openfpga */ namespace openfpga { -static int source_existing_command(Shell& shell, OpenfpgaContext& openfpga_ctx, const Command& cmd, const CommandContext& cmd_context) { +static int source_existing_command(openfpga::Shell* shell, OpenfpgaContext& openfpga_ctx, const Command& cmd, const CommandContext& cmd_context) { CommandOptionId opt_file = cmd.option("from_file"); CommandOptionId opt_batch_mode = cmd.option("batch_mode"); CommandOptionId opt_ss = cmd.option("command_stream"); @@ -24,7 +24,7 @@ static int source_existing_command(Shell& shell, OpenfpgaContex /* If a file is specified, run script mode of the shell, otherwise, */ if (is_cmd_file) { - shell.run_script_mode(cmd_ss.c_str(), openfpga_ctx, cmd_context.option_enable(cmd, opt_batch_mode)); + shell->run_script_mode(cmd_ss.c_str(), openfpga_ctx, cmd_context.option_enable(cmd, opt_batch_mode)); } else { /* Split the string with ';' and run each command */ /* Remove the space at the end of the line @@ -38,7 +38,7 @@ static int source_existing_command(Shell& shell, OpenfpgaContex std::string single_cmd_line = cmd_part_tokenizer.data(); if (!single_cmd_line.empty()) { - status = shell.execute_command(single_cmd_line.c_str(), openfpga_ctx); + status = shell->execute_command(single_cmd_line.c_str(), openfpga_ctx); /* Check the execution status of the command, * if fatal error happened, we should abort immediately