diff options
author | Leo C | 2016-03-21 23:33:05 +0100 |
---|---|---|
committer | Leo C | 2016-03-21 23:33:05 +0100 |
commit | 1b77fa4e36e50258936a4b61fdb11a988d473b1a (patch) | |
tree | c9437a732dfcb31cc9272c079769d713fe946516 | |
parent | f3e47f679c5154908d3f869c1e9a4b5fcc29d4a5 (diff) | |
download | z180-stamp-1b77fa4e36e50258936a4b61fdb11a988d473b1a.zip |
Rename getenv() to getenv_char()
getenv() is declared in some avr-libc versions.
-rw-r--r-- | avr/cli.c | 6 | ||||
-rw-r--r-- | avr/cmd_gpio.c | 2 | ||||
-rw-r--r-- | avr/cmd_loadcpm3.c | 2 | ||||
-rw-r--r-- | avr/env.c | 2 | ||||
-rw-r--r-- | avr/main.c | 2 | ||||
-rw-r--r-- | avr/z180-serv.c | 2 | ||||
-rw-r--r-- | include/env.h | 2 |
7 files changed, 9 insertions, 9 deletions
@@ -177,7 +177,7 @@ char *process_macros(char *input, char *output) if (c == '}') { /* Terminate variable name */ *(inp-1) = '\0'; - const char *envval = getenv(varname); + const char *envval = getenv_char(varname); *(inp-1) = '}'; /* Copy into the line if it exists */ if (envval != NULL) @@ -210,7 +210,7 @@ char *process_macros(char *input, char *output) * WARNING: * * We must create a temporary copy of the command since the command we get - * may be the result from getenv(), which returns a pointer directly to + * may be the result from getenv_char(), which returns a pointer directly to * the environment data, which may change magicly when the command we run * creates or modifies environment variables (like "bootp" does). * @@ -398,7 +398,7 @@ command_ret_t do_run(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) for (i = 1; i < argc; ++i) { char *arg; - arg = getenv(argv[i]); + arg = getenv_char(argv[i]); if (arg == NULL) { printf_P(PSTR("## Error: \"%s\" is not set\n"), argv[i]); return CMD_RET_FAILURE; diff --git a/avr/cmd_gpio.c b/avr/cmd_gpio.c index 5589381..6b7b3f7 100644 --- a/avr/cmd_gpio.c +++ b/avr/cmd_gpio.c @@ -37,7 +37,7 @@ static void pinnames_get(void) /* TODO: enters endless loop on wrong parameters */ - if ((lp = getenv(PSTR(ENV_PINALIAS))) != NULL) { + if ((lp = getenv_char(PSTR(ENV_PINALIAS))) != NULL) { pin_names[namestr] = strdup(lp); ptr = strtok_P(pin_names[namestr], delim1); while (ptr != NULL) { diff --git a/avr/cmd_loadcpm3.c b/avr/cmd_loadcpm3.c index 324a40d..a2436f2 100644 --- a/avr/cmd_loadcpm3.c +++ b/avr/cmd_loadcpm3.c @@ -86,7 +86,7 @@ command_ret_t do_loadcpm3(cmd_tbl_t *cmdtp, int flag, int argc, char * const arg if (argc > 2) common_base = strtoul(argv[2], NULL, 16); - fname = getenv(PSTR(ENV_CPM3_SYSFILE)); + fname = getenv_char(PSTR(ENV_CPM3_SYSFILE)); if (argc > 1) { fname = argv[1]; } @@ -316,7 +316,7 @@ int env_init(void) } -char *getenv(const MEMX char *name) +char *getenv_char(const MEMX char *name) { env_item_t *ep; char *ret = NULL; @@ -224,7 +224,7 @@ const char *bootdelay_process(void) debug("### main_loop entered: bootdelay=%d\n\n", bootdelay); _delay_ms(20); - s = getenv(PSTR(ENV_BOOTCMD)); + s = getenv_char(PSTR(ENV_BOOTCMD)); stored_bootdelay = bootdelay; return s; } diff --git a/avr/z180-serv.c b/avr/z180-serv.c index a815537..58843fd 100644 --- a/avr/z180-serv.c +++ b/avr/z180-serv.c @@ -317,7 +317,7 @@ void do_msg_cpm_login(uint8_t subf, int len, uint8_t * msg) strcpy_P((char *)disk_buffer, PSTR("dsk0")); disk_buffer[3] = msg[0] + '0'; - if (((np = getenv((char*)disk_buffer)) == NULL) || + if (((np = getenv_char((char*)disk_buffer)) == NULL) || ((drv_table[drv].img_name = strdup(np)) == NULL)) { return msg_cpm_result(subf, 0x03, res); } diff --git a/include/env.h b/include/env.h index da38c54..c7e49ca 100644 --- a/include/env.h +++ b/include/env.h @@ -9,7 +9,7 @@ int env_init(void); -char *getenv(const MEMX char *name); +char *getenv_char(const MEMX char *name); unsigned long getenv_ulong(const MEMX char *name, int base, unsigned long default_val); int setenv_ulong(const MEMX char *varname, unsigned long value); int setenv_hex(const MEMX char *varname, unsigned long value); |