vsprintf: expose strtoul function
This function is a wrapper around simple_strtoul, and allows us to expose it, replacing the one in bionic.c. Signed-off-by: Sean Cross <xobs@kosagi.com>
This commit is contained in:
parent
2e3dfee040
commit
58d7c3b17a
2 changed files with 7 additions and 2 deletions
|
@ -115,7 +115,7 @@ int cmd_lcd(int argc, char **argv)
|
||||||
for (x = 0; x < lcd_width(); x++)
|
for (x = 0; x < lcd_width(); x++)
|
||||||
lcd_addpixel(rgb(i++, 0, 0));
|
lcd_addpixel(rgb(i++, 0, 0));
|
||||||
}
|
}
|
||||||
else if (is_command(argc, argv, "tps")) {
|
else if (is_command(argc, argv, "tpd")) {
|
||||||
static int step = 0;
|
static int step = 0;
|
||||||
pixel_t *fb;
|
pixel_t *fb;
|
||||||
int x, y;
|
int x, y;
|
||||||
|
|
|
@ -87,6 +87,11 @@ int strict_strtoul(const char *cp, unsigned int base, unsigned long *res)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unsigned long strtoul(const char *cp, char **endp, unsigned int base)
|
||||||
|
{
|
||||||
|
return simple_strtoul(cp, endp, base);
|
||||||
|
}
|
||||||
|
|
||||||
long simple_strtol(const char *cp,char **endp,unsigned int base)
|
long simple_strtol(const char *cp,char **endp,unsigned int base)
|
||||||
{
|
{
|
||||||
if(*cp=='-')
|
if(*cp=='-')
|
||||||
|
@ -661,7 +666,7 @@ static int vsnprintf_internal(char *buf, size_t size, const char *fmt,
|
||||||
} else if (qualifier == 'Z' || qualifier == 'z') {
|
} else if (qualifier == 'Z' || qualifier == 'z') {
|
||||||
num = va_arg(args, size_t);
|
num = va_arg(args, size_t);
|
||||||
} else if (qualifier == 't') {
|
} else if (qualifier == 't') {
|
||||||
num = va_arg(args, ptrdiff_t);
|
num = va_arg(args, void *);
|
||||||
} else if (qualifier == 'h') {
|
} else if (qualifier == 'h') {
|
||||||
num = (unsigned short) va_arg(args, int);
|
num = (unsigned short) va_arg(args, int);
|
||||||
if (flags & SIGN)
|
if (flags & SIGN)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue