提交 6254665c 编写于 作者: B bernard.xiong

reduce finsh shell memory usage.

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@765 bbd45198-f89e-11dd-88c7-29a3b14d5316
上级 f419a171
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
#define FINSH_STRING_MAX 128 /* max length of string */ #define FINSH_STRING_MAX 128 /* max length of string */
#define FINSH_VARIABLE_MAX 8 /* max number of variable */ #define FINSH_VARIABLE_MAX 8 /* max number of variable */
#define FINSH_STACK_MAX 128 /* max stack size */ #define FINSH_STACK_MAX 64 /* max stack size */
#define FINSH_TEXT_MAX 128 /* max text segment size */ #define FINSH_TEXT_MAX 128 /* max text segment size */
#define HEAP_ALIGNMENT 4 /* heap alignment */ #define HEAP_ALIGNMENT 4 /* heap alignment */
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
u_char global_errno; u_char global_errno;
const char* finsh_error_string_table[] = static const char* finsh_error_string_table[] =
{ {
"No error", "No error",
"Invalid token", "Invalid token",
......
...@@ -28,7 +28,7 @@ struct name_table ...@@ -28,7 +28,7 @@ struct name_table
}; };
/* keyword */ /* keyword */
static struct name_table finsh_name_table[] = static const struct name_table finsh_name_table[] =
{ {
{"void", finsh_token_type_void}, {"void", finsh_token_type_void},
{"char", finsh_token_type_char}, {"char", finsh_token_type_char},
......
...@@ -144,9 +144,10 @@ void finsh_auto_complete(char* prefix) ...@@ -144,9 +144,10 @@ void finsh_auto_complete(char* prefix)
rt_kprintf("finsh>>%s", prefix); rt_kprintf("finsh>>%s", prefix);
} }
extern const char* finsh_error_string_table[];
void finsh_run_line(struct finsh_parser* parser, const char *line) void finsh_run_line(struct finsh_parser* parser, const char *line)
{ {
const char* err_str;
rt_kprintf("\n"); rt_kprintf("\n");
finsh_parser_run(parser, (unsigned char*)line); finsh_parser_run(parser, (unsigned char*)line);
...@@ -157,7 +158,8 @@ void finsh_run_line(struct finsh_parser* parser, const char *line) ...@@ -157,7 +158,8 @@ void finsh_run_line(struct finsh_parser* parser, const char *line)
} }
else else
{ {
rt_kprintf("%s\n", finsh_error_string(finsh_errno())); err_str = finsh_error_string(finsh_errno());
rt_kprintf("%s\n", err_str);
} }
/* run virtual machine */ /* run virtual machine */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册