Comments
Patch
@@ -33,14 +33,14 @@
* for long help messages
*/
-int _do_help (cmd_tbl_t *cmd_start, int cmd_items, cmd_tbl_t * cmdtp, int
- flag, int argc, char * const argv[])
+int _do_help(const cmd_tbl_t *cmd_start, int cmd_items, const cmd_tbl_t *cmdtp,
+ int flag, int argc, char * const argv[])
{
int i;
int rcode = 0;
if (argc == 1) { /*show list of commands */
- cmd_tbl_t *cmd_array[cmd_items];
+ const cmd_tbl_t *cmd_array[cmd_items];
int i, j, swaps;
/* Make array of commands from .uboot_cmd section */
@@ -55,7 +55,7 @@ int _do_help (cmd_tbl_t *cmd_start, int cmd_items, cmd_tbl_t * cmdtp, int
for (j = 0; j < i; ++j) {
if (strcmp (cmd_array[j]->name,
cmd_array[j + 1]->name) > 0) {
- cmd_tbl_t *tmp;
+ const cmd_tbl_t *tmp;
tmp = cmd_array[j];
cmd_array[j] = cmd_array[j + 1];
cmd_array[j + 1] = tmp;
@@ -66,8 +66,8 @@ extern cmd_tbl_t __u_boot_cmd_end;
/* common/command.c */
-int _do_help (cmd_tbl_t *cmd_start, int cmd_items, cmd_tbl_t * cmdtp, int
- flag, int argc, char * const argv[]);
+int _do_help(const cmd_tbl_t *cmd_start, int cmd_items, const cmd_tbl_t *cmdtp,
+ int flag, int argc, char * const argv[]);
cmd_tbl_t *find_cmd(const char *cmd);
cmd_tbl_t *find_cmd_tbl (const char *cmd, cmd_tbl_t *table, int table_len);
The _do_help func does not need to write to the command tables passed to it, so constify the input args. Signed-off-by: Mike Frysinger <vapier@gentoo.org> --- common/command.c | 8 ++++---- include/command.h | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-)