缩小变量作用域:消除18处variableScope,声明移入实际使用块

This commit is contained in:
2026-09-01 13:59:44 +08:00
parent f1d5483a49
commit 6307c3f635
9 changed files with 17 additions and 25 deletions
+1 -2
View File
@@ -36,10 +36,9 @@
static int time_sync_open_listener(void)
{
int retry;
int s;
for (retry = 0; retry < 5; retry++) {
s = net_socket(NET_AF_INET, NET_SOCK_STREAM);
int s = net_socket(NET_AF_INET, NET_SOCK_STREAM);
if (s < 0) {
DBG_ERROR("time_sync: net_socket FAIL");
vTaskDelay(pdMS_TO_TICKS(500));