return 0;
}
-int setenv(char *varname, char *varvalue)
+int setenv(const char *varname, const char *varvalue)
{
- char * const argv[4] = { "setenv", varname, varvalue, NULL };
+ const char * const argv[4] = { "setenv", varname, varvalue, NULL };
+
if ((varvalue == NULL) || (varvalue[0] == '\0'))
- return _do_env_set(0, 2, argv);
+ return _do_env_set(0, 2, (char * const *)argv);
else
- return _do_env_set(0, 3, argv);
+ return _do_env_set(0, 3, (char * const *)argv);
}
int do_env_set(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
* return address of storage for that variable,
* or NULL if not found
*/
-char *getenv(char *name)
+char *getenv(const char *name)
{
if (gd->flags & GD_FLG_ENV_READY) { /* after import into hashtable */
ENTRY e, *ep;
/*
* Look up variable from environment for restricted C runtime env.
*/
-int getenv_f(char *name, char *buf, unsigned len)
+int getenv_f(const char *name, char *buf, unsigned len)
{
int i, nxt;
int env_init (void);
void env_relocate (void);
int envmatch (uchar *, int);
-char *getenv (char *);
-int getenv_f (char *name, char *buf, unsigned len);
+char *getenv (const char *);
+int getenv_f (const char *name, char *buf, unsigned len);
int saveenv (void);
#ifdef CONFIG_PPC /* ARM version to be fixed! */
-int inline setenv (char *, char *);
+int inline setenv (const char *, const char *);
#else
-int setenv (char *, char *);
+int setenv (const char *, const char *);
#endif /* CONFIG_PPC */
#ifdef CONFIG_ARM
# include <asm/mach-types.h>
int vprintf(const char *, va_list);
unsigned long simple_strtoul(const char *cp,char **endp,unsigned int base);
int strict_strtoul(const char *cp, unsigned int base, unsigned long *res);
-char *getenv (char *name);
-int setenv (char *varname, char *varvalue);
+char *getenv (const char *name);
+int setenv (const char *varname, const char *varvalue);
long simple_strtol(const char *cp,char **endp,unsigned int base);
int strcmp(const char * cs,const char * ct);
int ustrtoul(const char *cp, char **endp, unsigned int base);
} ACTION;
typedef struct entry {
- char *key;
+ const char *key;
char *data;
} ENTRY;
if (htab->table[i].used > 0) {
ENTRY *ep = &htab->table[i].entry;
- free(ep->key);
+ free((void *)ep->key);
free(ep->data);
}
}
/* free used ENTRY */
debug("hdelete: DELETING key \"%s\"\n", key);
- free(ep->key);
+ free((void *)ep->key);
free(ep->data);
htab->table[idx].used = -1;
* export sorted list of result data
*/
for (i = 0, p = res; i < n; ++i) {
- char *s;
+ const char *s;
s = list[i]->key;
while (*s)