From 24a174c7a45ba8a901f2e0938dc32f42c1c268cb Mon Sep 17 00:00:00 2001 From: tangxifan Date: Wed, 23 Nov 2022 17:06:27 -0800 Subject: [PATCH] [engine] fixed syntax errors --- libs/libopenfpgashell/src/shell.h | 4 +--- libs/libopenfpgashell/test/test_shell.cpp | 3 ++- openfpga/src/base/openfpga_shell.cpp | 4 ++-- openfpga/src/main.cpp | 2 +- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/libs/libopenfpgashell/src/shell.h b/libs/libopenfpgashell/src/shell.h index fe3ddf9c1..b987288a5 100644 --- a/libs/libopenfpgashell/src/shell.h +++ b/libs/libopenfpgashell/src/shell.h @@ -75,7 +75,7 @@ class Shell { }; public: /* Constructor */ - Shell(const char* name); + Shell(); public: /* Public accessors */ std::string name() const; @@ -178,8 +178,6 @@ class Shell { int execution_errors() const; /* Quit the shell */ void exit(const int& init_err = 0) const; - - private: /* Private executors */ /* Execute a command, the command line is the user's input to launch a command * The common_context is the data structure to exchange data between commands */ diff --git a/libs/libopenfpgashell/test/test_shell.cpp b/libs/libopenfpgashell/test/test_shell.cpp index c871848c6..8212f0869 100644 --- a/libs/libopenfpgashell/test/test_shell.cpp +++ b/libs/libopenfpgashell/test/test_shell.cpp @@ -63,7 +63,8 @@ int main(int argc, char** argv) { * 1. help * 2. exit */ - Shell shell("test_shell"); + Shell shell; + shell.set_name("test_shell"); std::string shell_title; shell_title += std::string("The MIT License\n"); diff --git a/openfpga/src/base/openfpga_shell.cpp b/openfpga/src/base/openfpga_shell.cpp index 177397fe7..8d9d501cf 100644 --- a/openfpga/src/base/openfpga_shell.cpp +++ b/openfpga/src/base/openfpga_shell.cpp @@ -105,14 +105,14 @@ int OpenfpgaShell::start(int argc, char** argv) { } /* Start a shell */ if (true == start_cmd_context.option_enable(start_cmd, opt_interactive)) { - shell_.run_interactive_mode(openfpga_context); + shell_.run_interactive_mode(openfpga_ctx_); return shell_.exit_code(); } if (true == start_cmd_context.option_enable(start_cmd, opt_script_mode)) { shell_.run_script_mode( start_cmd_context.option_value(start_cmd, opt_script_mode).c_str(), - openfpga_context, + openfpga_ctx_, start_cmd_context.option_enable(start_cmd, opt_batch_exec)); return shell_.exit_code(); } diff --git a/openfpga/src/main.cpp b/openfpga/src/main.cpp index fb0834c42..9c1592bb8 100644 --- a/openfpga/src/main.cpp +++ b/openfpga/src/main.cpp @@ -8,5 +8,5 @@ *******************************************************************/ int main(int argc, char** argv) { OpenfpgaShell openfpga_shell; - return openfpga_shell.run(argc, argv); + return openfpga_shell.start(argc, argv); }