Files
rk35xx-android14/u-boot/lib/stdlib.c
T
hmz007 36ed224bac Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a)
Signed-off-by: hmz007 <hmz007@gmail.com>
Change-Id: Ib87fdbe7a0be7dc961af3500fe9ea4589a127f9f
2024-10-29 18:12:02 +08:00

40 lines
604 B
C

// SPDX-License-Identifier: GPL-2.0
/*
* Copyright (c) 2019 Fuzhou Rockchip Electronics Co., Ltd
*/
#include <linux/ctype.h>
#include <linux/types.h>
long atol(const char *nptr)
{
int c;
long total;
int sign;
while (isspace((int)(unsigned char)*nptr))
++nptr;
c = (int)(unsigned char)*nptr++;
sign = c;
if (c == '-' || c == '+')
c = (int)(unsigned char)*nptr++;
total = 0;
while (isdigit(c)) {
total = 10 * total + (c - '0');
c = (int)(unsigned char)*nptr++;
}
if (sign == '-')
return -total;
else
return total;
}
int atoi(const char *nptr)
{
return (int)atol(nptr);
}