summaryrefslogtreecommitdiffstats
path: root/common/command.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2008-04-04 11:46:55 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2008-04-04 14:45:04 +0200
commit50cc8c5412e804480a10ecdd9546c7b6ad21760e (patch)
tree86d3a04fd004996fc91839b9a7cad705090bcdc0 /common/command.c
parenta9912f68c65850d2bed12111aabe8b779c95e365 (diff)
downloadbarebox-50cc8c5412e804480a10ecdd9546c7b6ad21760e.tar.gz
barebox-50cc8c5412e804480a10ecdd9546c7b6ad21760e.tar.xz
Subject: [PATCH] [general] Fixed constant strings in data section issue
For practical reasons I changed all string literals assumed to be constant to reside in .rodata subsection at end of .text section. Signed-off-by: Carsten Schlote <schlote@vahanus.net> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'common/command.c')
-rw-r--r--common/command.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/common/command.c b/common/command.c
index 94a8f28787..d1b19c076f 100644
--- a/common/command.c
+++ b/common/command.c
@@ -142,14 +142,14 @@ static int do_help (cmd_tbl_t * cmdtp, int argc, char *argv[])
}
}
-static __maybe_unused char cmd_help_help[] =
+static const __maybe_unused char cmd_help_help[] =
"Show help information (for 'command')\n"
"'help' prints online help for the monitor commands.\n\n"
"Without arguments, it prints a short usage message for all commands.\n\n"
"To get detailed help information for specific commands you can type\n"
"'help' with one or more command names as arguments.\n";
-static char *help_aliases[] = { "?", NULL};
+static const char *help_aliases[] = { "?", NULL};
U_BOOT_CMD_START(help)
.maxargs = 2,
@@ -161,8 +161,8 @@ U_BOOT_CMD_END
static int compare(struct list_head *a, struct list_head *b)
{
- char *na = list_entry(a, cmd_tbl_t, list)->name;
- char *nb = list_entry(b, cmd_tbl_t, list)->name;
+ char *na = (char*)list_entry(a, cmd_tbl_t, list)->name;
+ char *nb = (char*)list_entry(b, cmd_tbl_t, list)->name;
return strcmp(na, nb);
}
@@ -180,7 +180,7 @@ int register_command(cmd_tbl_t *cmd)
list_add_sort(&cmd->list, &command_list, compare);
if (cmd->aliases) {
- char **aliases = cmd->aliases;
+ char **aliases = (char**)cmd->aliases;
while(*aliases) {
char *usage = "alias for ";
cmd_tbl_t *c = xzalloc(sizeof(cmd_tbl_t));
@@ -189,7 +189,7 @@ int register_command(cmd_tbl_t *cmd)
c->name = *aliases;
c->usage = xmalloc(strlen(usage) + strlen(cmd->name) + 1);
- sprintf(c->usage, "%s%s", usage, cmd->name);
+ sprintf((char*)c->usage, "%s%s", usage, cmd->name);
c->aliases = NULL;