summaryrefslogtreecommitdiff
path: root/avr
diff options
context:
space:
mode:
authorLeo C2016-03-21 23:33:05 +0100
committerLeo C2016-03-21 23:33:05 +0100
commit1b77fa4e36e50258936a4b61fdb11a988d473b1a (patch)
treec9437a732dfcb31cc9272c079769d713fe946516 /avr
parentf3e47f679c5154908d3f869c1e9a4b5fcc29d4a5 (diff)
downloadz180-stamp-1b77fa4e36e50258936a4b61fdb11a988d473b1a.zip
Rename getenv() to getenv_char()
getenv() is declared in some avr-libc versions.
Diffstat (limited to 'avr')
-rw-r--r--avr/cli.c6
-rw-r--r--avr/cmd_gpio.c2
-rw-r--r--avr/cmd_loadcpm3.c2
-rw-r--r--avr/env.c2
-rw-r--r--avr/main.c2
-rw-r--r--avr/z180-serv.c2
6 files changed, 8 insertions, 8 deletions
diff --git a/avr/cli.c b/avr/cli.c
index e66554a..8763ed1 100644
--- a/avr/cli.c
+++ b/avr/cli.c
@@ -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];
}
diff --git a/avr/env.c b/avr/env.c
index 9ea355f..c4837d5 100644
--- a/avr/env.c
+++ b/avr/env.c
@@ -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;
diff --git a/avr/main.c b/avr/main.c
index b8ce26d..113b4f2 100644
--- a/avr/main.c
+++ b/avr/main.c
@@ -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);
}