9
0
Fork 0

svn_rev_481

make more char * const, fix compiler warnings
This commit is contained in:
Sascha Hauer 2007-07-05 18:01:58 +02:00 committed by Sascha Hauer
parent dbf8680a0a
commit fe2d505d4d
14 changed files with 27 additions and 24 deletions

View File

@ -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"

View File

@ -5,6 +5,7 @@
#include <linux/stat.h>
#include <errno.h>
#include <malloc.h>
#include <xfuncs.h>
#ifdef CONFIG_HUSH_PARSER
#include <hush.h>

View File

@ -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"

View File

@ -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";

View File

@ -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"

View File

@ -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;

View File

@ -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) {

View File

@ -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"

View File

@ -25,6 +25,7 @@
#define __COMMON_H_ 1
#include <stdio.h>
#include <compiler.h>
#undef _LINUX_CONFIG_H
#define _LINUX_CONFIG_H 1 /* avoid reading Linux autoconf.h file */
@ -46,7 +47,6 @@ typedef unsigned long IPaddr_t;
#endif
#include <part.h>
//#include <image.h>
#ifdef DEBUG
#define debug(fmt,args...) printf (fmt ,##args)

View File

@ -88,6 +88,7 @@ struct device_d *get_first_device(void);
int get_free_deviceid(char *id, char *id_template);
struct device_d *device_from_spec_str(const char *str, char **endp);
char *deviceid_from_spec_str(const char *str, char **endp);
/* Find a driver with the given name. Currently the filesystem implementation
* uses this to get the driver from the name the user specifies with the

View File

@ -40,7 +40,7 @@
int add_env_spec(char *spec);
/* common/cmd_nvedit.c */
char *getenv (const char *);
const char *getenv (const char *);
int saveenv (void);
int setenv (const char *, const char *);

View File

@ -415,7 +415,7 @@ IPaddr_t string_to_ip(const char *s);
void VLAN_to_string (ushort x, char *s);
/* Convert a string to a vlan id */
ushort string_to_VLAN(char *s);
ushort string_to_VLAN(const char *s);
/* read an IP address from a environment variable */
IPaddr_t getenv_IPaddr (char *);

View File

@ -319,7 +319,7 @@ int do_devinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
return 0;
}
static char cmd_devinfo_help[] =
static __maybe_unused char cmd_devinfo_help[] =
"Usage: devinfo [DEVICE]\n"
"If called without arguments devinfo shows a summary about known devices and\n"
"drivers. If called with a device id as argument devinfo shows more detailed\n"

View File

@ -535,7 +535,7 @@ startAgainHandler(uchar * pkt, unsigned dest, unsigned src, unsigned len)
void NetStartAgain (void)
{
char *nretry;
const char *nretry;
int noretry = 0, once = 0;
if ((nretry = getenv ("netretry")) != NULL) {
@ -1548,7 +1548,7 @@ void VLAN_to_string(ushort x, char *s)
sprintf(s, "%d", x & VLAN_IDMASK);
}
ushort string_to_VLAN(char *s)
ushort string_to_VLAN(const char *s)
{
ushort id;