summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2007-07-05 18:01:58 +0200
committerSascha Hauer <sha@octopus.labnet.pengutronix.de>2007-07-05 18:01:58 +0200
commitfe2d505d4df0ebae0e519abeb2cccfeb10ef80ac (patch)
tree3511c0d06d4de0cc65af6710d1e2bfae53e9e8b7 /common
parentdbf8680a0a9a983e8edd320d1ea812f7d6a1f1c8 (diff)
downloadbarebox-fe2d505d4df0ebae0e519abeb2cccfeb10ef80ac.tar.gz
barebox-fe2d505d4df0ebae0e519abeb2cccfeb10ef80ac.tar.xz
svn_rev_481
make more char * const, fix compiler warnings
Diffstat (limited to 'common')
-rw-r--r--common/cmd_edit.c2
-rw-r--r--common/cmd_exec.c1
-rw-r--r--common/cmd_mem.c6
-rw-r--r--common/cmd_net.c2
-rw-r--r--common/command.c4
-rw-r--r--common/env.c6
-rw-r--r--common/hush.c13
-rw-r--r--common/partition.c4
8 files changed, 20 insertions, 18 deletions
diff --git a/common/cmd_edit.c b/common/cmd_edit.c
index 9dd6b7727a..9e86882522 100644
--- a/common/cmd_edit.c
+++ b/common/cmd_edit.c
@@ -470,7 +470,7 @@ out:
return 0;
}
-static char cmd_edit_help[] =
+static __maybe_unused char cmd_edit_help[] =
"Usage: edit <file>\n"
"This is a very small editor. Its only features are moving the cursor with\n"
"the usual keys and typing characters.\n"
diff --git a/common/cmd_exec.c b/common/cmd_exec.c
index 1057bc1b8e..f7ae918fc9 100644
--- a/common/cmd_exec.c
+++ b/common/cmd_exec.c
@@ -5,6 +5,7 @@
#include <linux/stat.h>
#include <errno.h>
#include <malloc.h>
+#include <xfuncs.h>
#ifdef CONFIG_HUSH_PARSER
#include <hush.h>
diff --git a/common/cmd_mem.c b/common/cmd_mem.c
index eaa7c4653e..d7cd7fb96d 100644
--- a/common/cmd_mem.c
+++ b/common/cmd_mem.c
@@ -176,7 +176,7 @@ out:
return errno;
}
-static char cmd_md_help[] =
+static __maybe_unused char cmd_md_help[] =
"Usage md [OPTIONS] <region>\n"
"display (hexdump) a memory region.\n"
"options:\n"
@@ -284,7 +284,7 @@ out:
return errno;
}
-static char cmd_mw_help[] =
+static __maybe_unused char cmd_mw_help[] =
"Usage mw [OPTIONS] <region> <value(s)>\n"
"Write value(s) to the specifies region.\n"
"see 'help md' for supported options.\n";
@@ -466,7 +466,7 @@ out:
return ret;
}
-static char cmd_cp_help[] =
+static __maybe_unused char cmd_cp_help[] =
"Usage: cp <source> <destination>\n"
"cp copies file <source> to <destination>.\n"
"Currently only this form is supported and you have to specify the exact target\n"
diff --git a/common/cmd_net.c b/common/cmd_net.c
index 73681016db..a01c561ee7 100644
--- a/common/cmd_net.c
+++ b/common/cmd_net.c
@@ -105,7 +105,7 @@ int do_tftpb (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
return netboot_common (TFTP, cmdtp, argc, argv);
}
-static char cmd_tftpboot_help[] =
+static __maybe_unused char cmd_tftpboot_help[] =
"Usage: tftpboot <localfile> <remotefile>\n"
"Load a file via network using BootP/TFTP protocol\n";
diff --git a/common/command.c b/common/command.c
index dfe672f2ac..9d715e9418 100644
--- a/common/command.c
+++ b/common/command.c
@@ -92,7 +92,7 @@ do_readline (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
return 0;
}
-static char cmd_readline_help[] =
+static __maybe_unused char cmd_readline_help[] =
"Usage: readline <prompt> VAR\n"
"readline reads a line of user input into variable VAR.\n";
@@ -317,7 +317,7 @@ int do_help (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
}
}
-static char cmd_help_help[] =
+static __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"
diff --git a/common/env.c b/common/env.c
index e8f841e46b..069c401b50 100644
--- a/common/env.c
+++ b/common/env.c
@@ -25,12 +25,12 @@ static char *var_name(struct variable_d *var)
return var->data;
}
-char *getenv (const char *name)
+const char *getenv (const char *name)
{
struct variable_d *var;
if (strchr(name, '.')) {
- char *ret = 0;
+ const char *ret = 0;
char *devstr = strdup(name);
char *par = strchr(devstr, '.');
struct device_d *dev;
@@ -109,7 +109,7 @@ int do_printenv (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
struct variable_d *var = env_list->next;
if (argc == 2) {
- char *val = getenv(argv[1]);
+ const char *val = getenv(argv[1]);
if (val) {
printf("%s=%s\n", argv[1], val);
return 0;
diff --git a/common/hush.c b/common/hush.c
index c96bab89e6..ba1ffce58c 100644
--- a/common/hush.c
+++ b/common/hush.c
@@ -464,7 +464,7 @@ static int redirect_opt_num(o_string *o);
static int process_command_subs(o_string *dest, struct p_context *ctx, struct in_str *input, int subst_end);
static int parse_group(o_string *dest, struct p_context *ctx, struct in_str *input, int ch);
#endif
-static char *lookup_param(char *src);
+static const char *lookup_param(char *src);
static char *make_string(char **inp);
static int handle_dollar(o_string *dest, struct p_context *ctx, struct in_str *input);
#ifndef __U_BOOT__
@@ -487,7 +487,7 @@ static void remove_bg_job(struct pipe *pi);
/* local variable support */
static char **make_list_in(char **inp, char *name);
static char *insert_var_value(char *inp);
-static char *get_local_var(const char *var);
+static const char *get_local_var(const char *var);
#ifndef __U_BOOT__
static void unset_local_var(const char *name);
#endif
@@ -2105,7 +2105,7 @@ static char *get_dollar_var(char ch);
#endif
/* This is used to get/check local shell variables */
-static char *get_local_var(const char *s)
+static const char *get_local_var(const char *s)
{
if (!s)
return NULL;
@@ -2639,9 +2639,9 @@ static int parse_group(o_string *dest, struct p_context *ctx,
/* basically useful version until someone wants to get fancier,
* see the bash man page under "Parameter Expansion" */
-static char *lookup_param(char *src)
+static const char *lookup_param(char *src)
{
- char *p;
+ const char *p;
if (!src)
return NULL;
@@ -3261,7 +3261,8 @@ static char *insert_var_value(char *inp)
int res_str_len = 0;
int len;
int done = 0;
- char *p, *p1, *res_str = NULL;
+ char *p, *res_str = NULL;
+ const char *p1;
while ((p = strchr(inp, SPECIAL_VAR_SYMBOL))) {
if (p != inp) {
diff --git a/common/partition.c b/common/partition.c
index 15d44305f1..919e2e2e08 100644
--- a/common/partition.c
+++ b/common/partition.c
@@ -167,7 +167,7 @@ int do_addpart ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
return 0;
}
-static char cmd_addpart_help[] =
+static __maybe_unused char cmd_addpart_help[] =
"Usage: addpart <partition description>\n"
"addpart adds a partition description to a device. The partition description\n"
"has the form\n"
@@ -206,7 +206,7 @@ int do_delpart ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
return 0;
}
-static char cmd_delpart_help[] =
+static __maybe_unused char cmd_delpart_help[] =
"Usage: delpart <dev>\n"
"Delete partitions previously added to a device with addpart.\n"
"Note: You have to specify the device as 'devid', _not_ as '/dev/devid'. This\n"