[U-Boot] [PATCH 2/8] Add setenv_uint() and setenv_addr()
Mike Frysinger
vapier at gentoo.org
Sun Oct 23 07:29:30 CEST 2011
On Sat, Oct 22, 2011 at 00:51, Simon Glass <sjg at chromium.org> wrote:
> +int setenv_ulong(const char *varname, ulong value)
> +{
> + char *str = simple_itoa(value);
> +
> + return setenv(varname, str);
> +}
could be a one liner, but works either way
> +int setenv_addr(const char *varname, const void *addr)
> +{
> + char str[17];
char str[sizeof(addr) * 2 + 1];
> + sprintf(str, "%x", (uintptr_t)addr);
i wonder if we should use %p and drop the cast
-mike
More information about the U-Boot
mailing list