diff options
| author | hathach <[email protected]> | 2014-03-13 18:25:20 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2014-03-13 18:25:20 +0700 |
| commit | 6fbca0ea8731b7f50a895ae5c62fc2bbedde2550 (patch) | |
| tree | c98776c0f9b448a01b43f7d89b6624794d038ed4 /demos/host/src/cli.c | |
| parent | f1692c93ac7f9990490223cf924d84e1cbdcbeb6 (diff) | |
remove legacy code of msc_device.c read10 & write10
clean up some warnings
Diffstat (limited to 'demos/host/src/cli.c')
| -rw-r--r-- | demos/host/src/cli.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/demos/host/src/cli.c b/demos/host/src/cli.c index b3bdb3967..1dd2aadd9 100644 --- a/demos/host/src/cli.c +++ b/demos/host/src/cli.c @@ -210,21 +210,16 @@ void cli_poll(char ch) char* p_para = (p_space == NULL) ? (cli_buffer+command_len) : (p_space+1); // point to NULL-character or after space
//------------- Find entered command in lookup table & execute it -------------//
- cli_cmdtype_t cmd_id;
+ uint32_t cmd_id;
for(cmd_id = CLI_CMDTYPE_COUNT - 1; cmd_id > CLI_CMDTYPE_unknown; cmd_id--)
{
- if( 0 == strncmp(cli_buffer, cli_string_tbl[cmd_id], command_len) )
- {
- break;
- }
+ if( 0 == strncmp(cli_buffer, cli_string_tbl[cmd_id], command_len) ) break;
}
cli_error_t error = cli_command_tbl[cmd_id]( p_para ); // command execution, (unknown command if cannot find)
if (CLI_ERROR_NONE != error) puts(cli_error_message[error]); // error message output if any
-
- //------------- print out current path -------------//
- cli_command_prompt();
+ cli_command_prompt(); // print out current path
}
else if (ch=='\t') // \t may be used for auto-complete later
{
@@ -247,7 +242,7 @@ cli_error_t cli_cmd_unknown(char * para) cli_error_t cli_cmd_help(char * para)
{
puts("current supported commands are:");
- for(cli_cmdtype_t cmd_id = CLI_CMDTYPE_help+1; cmd_id < CLI_CMDTYPE_COUNT; cmd_id++)
+ for(uint32_t cmd_id = CLI_CMDTYPE_help+1; cmd_id < CLI_CMDTYPE_COUNT; cmd_id++)
{
printf("%s\t%s\n", cli_string_tbl[cmd_id], cli_description_tbl[cmd_id]);
}
@@ -474,8 +469,9 @@ cli_error_t cli_cmd_remove(char *p_para) case FR_DENIED:
printf("cannot remove readonly file/foler or non-empty folder\n");
-
- default: return CLI_ERROR_FAILED;
+ break;
+
+ default: break;
}
return CLI_ERROR_FAILED;
|
