[sscanf] use rt_sscanf to replace sscanf
This commit is contained in:
parent
16475b3c92
commit
443ade4c29
|
@ -167,12 +167,12 @@ void devmem(int argc, char *argv[])
|
|||
|
||||
if (argc == 3)
|
||||
{
|
||||
if (sscanf(argv[2], "0x%x", &value) != 1)
|
||||
if (rt_sscanf(argv[2], "0x%x", &value) != 1)
|
||||
goto exit_devmem;
|
||||
mode = 1; /*Write*/
|
||||
}
|
||||
|
||||
if (sscanf(argv[1], "0x%x", &u32Addr) != 1)
|
||||
if (rt_sscanf(argv[1], "0x%x", &u32Addr) != 1)
|
||||
goto exit_devmem;
|
||||
else if (!u32Addr || u32Addr & (4 - 1))
|
||||
goto exit_devmem;
|
||||
|
@ -203,12 +203,12 @@ void devmem2(int argc, char *argv[])
|
|||
|
||||
if (argc == 3)
|
||||
{
|
||||
if (sscanf(argv[2], "%u", &value) != 1)
|
||||
if (rt_sscanf(argv[2], "%u", &value) != 1)
|
||||
goto exit_devmem;
|
||||
word_count = value;
|
||||
}
|
||||
|
||||
if (sscanf(argv[1], "0x%x", &u32Addr) != 1)
|
||||
if (rt_sscanf(argv[1], "0x%x", &u32Addr) != 1)
|
||||
goto exit_devmem;
|
||||
else if (!u32Addr || u32Addr & (4 - 1))
|
||||
goto exit_devmem;
|
||||
|
|
|
@ -399,7 +399,7 @@ static rt_err_t lcd_set_overlay_colkey(int argc, char **argv)
|
|||
|
||||
for (index = 0; index < (len - 1); index ++)
|
||||
{
|
||||
if (sscanf(argv[index + 1], "%x", &arg[index]) != 1)
|
||||
if (rt_sscanf(argv[index + 1], "%x", &arg[index]) != 1)
|
||||
return -1;
|
||||
}
|
||||
rt_kprintf("colkeylow:0x%08x colkeyhigh:0x%08x\n", arg[0], arg[1]);
|
||||
|
@ -459,7 +459,7 @@ static rt_err_t lcd_set_alphablend_opmode(int argc, char **argv)
|
|||
|
||||
for (index = 0; index < (len - 1); index ++)
|
||||
{
|
||||
if (sscanf(argv[index + 1], "%x", &arg[index]) != 1)
|
||||
if (rt_sscanf(argv[index + 1], "%x", &arg[index]) != 1)
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
|
@ -307,12 +307,12 @@ void devmem(int argc, char *argv[])
|
|||
|
||||
if (argc == 3)
|
||||
{
|
||||
if (sscanf(argv[2], "0x%x", &value) != 1)
|
||||
if (rt_sscanf(argv[2], "0x%x", &value) != 1)
|
||||
goto exit_devmem;
|
||||
mode = 1; //Write
|
||||
}
|
||||
|
||||
if (sscanf(argv[1], "0x%x", &u32Addr) != 1)
|
||||
if (rt_sscanf(argv[1], "0x%x", &u32Addr) != 1)
|
||||
goto exit_devmem;
|
||||
else if (u32Addr & (4 - 1))
|
||||
goto exit_devmem;
|
||||
|
@ -343,12 +343,12 @@ void devmem2(int argc, char *argv[])
|
|||
|
||||
if (argc == 3)
|
||||
{
|
||||
if (sscanf(argv[2], "%d", &value) != 1)
|
||||
if (rt_sscanf(argv[2], "%d", &value) != 1)
|
||||
goto exit_devmem;
|
||||
word_count = value;
|
||||
}
|
||||
|
||||
if (sscanf(argv[1], "0x%x", &u32Addr) != 1)
|
||||
if (rt_sscanf(argv[1], "0x%x", &u32Addr) != 1)
|
||||
goto exit_devmem;
|
||||
else if (u32Addr & (4 - 1))
|
||||
goto exit_devmem;
|
||||
|
|
|
@ -90,12 +90,12 @@ void devmem(int argc, char *argv[])
|
|||
|
||||
if (argc == 3)
|
||||
{
|
||||
if (sscanf(argv[2], "0x%x", &value) != 1)
|
||||
if (rt_sscanf(argv[2], "0x%x", &value) != 1)
|
||||
goto exit_devmem;
|
||||
mode = 1; //Write
|
||||
}
|
||||
|
||||
if (sscanf(argv[1], "0x%x", &u32Addr) != 1)
|
||||
if (rt_sscanf(argv[1], "0x%x", &u32Addr) != 1)
|
||||
goto exit_devmem;
|
||||
else if (!u32Addr || u32Addr & (4 - 1))
|
||||
goto exit_devmem;
|
||||
|
|
|
@ -298,12 +298,12 @@ void whc_devmem(int argc, char *argv[])
|
|||
|
||||
if (argc == 3)
|
||||
{
|
||||
if (sscanf(argv[2], "0x%x", &value) != 1)
|
||||
if (rt_sscanf(argv[2], "0x%x", &value) != 1)
|
||||
goto exit_devmem;
|
||||
mode = 1; //Write
|
||||
}
|
||||
|
||||
if (sscanf(argv[1], "0x%x", &u32Addr) != 1)
|
||||
if (rt_sscanf(argv[1], "0x%x", &u32Addr) != 1)
|
||||
goto exit_devmem;
|
||||
else if (u32Addr & (4 - 1))
|
||||
goto exit_devmem;
|
||||
|
|
|
@ -116,7 +116,7 @@ rt_err_t rt_ofw_get_phyid(struct rt_ofw_node *np,rt_uint32_t *id)
|
|||
if (ret)
|
||||
return ret;
|
||||
|
||||
ret = sscanf(phy_id,"ethernet-phy-id%4x.%4x",&upper, &lower);
|
||||
ret = rt_sscanf(phy_id,"ethernet-phy-id%4x.%4x",&upper, &lower);
|
||||
if(ret != 2)
|
||||
return -RT_ERROR;
|
||||
|
||||
|
|
|
@ -759,7 +759,7 @@ static void at_connect_notice_cb(struct at_socket *sock, at_socket_evt_t event,
|
|||
}
|
||||
new_sock = at_get_socket(new_socket);
|
||||
new_sock->state = AT_SOCKET_CONNECT;
|
||||
sscanf(buff, "SOCKET:%d", &base_socket);
|
||||
rt_sscanf(buff, "SOCKET:%d", &base_socket);
|
||||
LOG_D("ACCEPT BASE SOCKET: %d", base_socket);
|
||||
new_sock->user_data = (void *)base_socket;
|
||||
|
||||
|
@ -985,7 +985,7 @@ int at_accept(int socket, struct sockaddr *name, socklen_t *namelen)
|
|||
at_do_event_changes(sock, AT_EVENT_RECV, RT_FALSE);
|
||||
}
|
||||
|
||||
sscanf(&receive_buff[0], "SOCKET:%d", &new_socket);
|
||||
rt_sscanf(&receive_buff[0], "SOCKET:%d", &new_socket);
|
||||
new_sock = at_get_socket(new_socket);
|
||||
ip4_addr_set_any(&remote_addr);
|
||||
ipaddr_port_to_socketaddr(name, &remote_addr, &remote_port);
|
||||
|
|
|
@ -556,7 +556,7 @@ int main(int argc, char *argv[])
|
|||
{
|
||||
if (argc == 2)
|
||||
{
|
||||
sscanf(argv[1], "%d", &loop_count);
|
||||
rt_sscanf(argv[1], "%d", &loop_count);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue