Chore: runs clang-format

This commit is contained in:
李通洲
2026-04-28 19:45:19 +08:00
parent 594c73461e
commit 55e4896524
7 changed files with 24 additions and 16 deletions
+4 -4
View File
@@ -790,9 +790,9 @@ bool ffStrbufMatchSeparatedNS(const FFstrbuf* strbuf, uint32_t compLength, const
}
for (const char* p = comp; p < comp + compLength;) {
const char* colon = memchr(p, separator, (size_t)(comp + compLength - p));
const char* colon = memchr(p, separator, (size_t) (comp + compLength - p));
if (colon == NULL) {
uint32_t remainingLen = (uint32_t)(comp + compLength - p);
uint32_t remainingLen = (uint32_t) (comp + compLength - p);
return strbuf->length == remainingLen && memcmp(strbuf->chars, p, remainingLen) == 0;
}
@@ -818,9 +818,9 @@ bool ffStrbufMatchSeparatedIgnCaseNS(const FFstrbuf* strbuf, uint32_t compLength
}
for (const char* p = comp; p < comp + compLength;) {
const char* colon = memchr(p, separator, (size_t)(comp + compLength - p));
const char* colon = memchr(p, separator, (size_t) (comp + compLength - p));
if (colon == NULL) {
uint32_t remainingLen = (uint32_t)(comp + compLength - p);
uint32_t remainingLen = (uint32_t) (comp + compLength - p);
return strbuf->length == remainingLen && strncasecmp(strbuf->chars, p, remainingLen) == 0;
}
+1 -1
View File
@@ -441,7 +441,7 @@ const char* ffGetTerminalResponse(const char* request, int nParams, const char*
while (true) {
DWORD bytes = 0;
if (!ReadFile(hInput, buffer + bytesRead, (DWORD)(sizeof(buffer) - 1 - bytesRead), &bytes, NULL) || bytes == 0) {
if (!ReadFile(hInput, buffer + bytesRead, (DWORD) (sizeof(buffer) - 1 - bytesRead), &bytes, NULL) || bytes == 0) {
va_end(args);
return "ReadFile() failed";
}
+6 -2
View File
@@ -110,7 +110,9 @@ bool ffNetifGetDefaultRouteImplV4(FFNetifDefaultRouteResult* result) {
&& sdl->sdl_len
#endif
) {
if (sdl->sdl_nlen > IF_NAMESIZE) return false;
if (sdl->sdl_nlen > IF_NAMESIZE) {
return false;
}
memcpy(result->ifName, sdl->sdl_data, sdl->sdl_nlen);
result->ifName[sdl->sdl_nlen] = '\0';
result->ifIndex = sdl->sdl_index;
@@ -183,7 +185,9 @@ bool ffNetifGetDefaultRouteImplV6(FFNetifDefaultRouteResult* result) {
&& sdl->sdl_len
#endif
) {
if (sdl->sdl_nlen > IF_NAMESIZE) return false;
if (sdl->sdl_nlen > IF_NAMESIZE) {
return false;
}
memcpy(result->ifName, sdl->sdl_data, sdl->sdl_nlen);
result->ifName[sdl->sdl_nlen] = '\0';
result->ifIndex = sdl->sdl_index;
+6 -2
View File
@@ -65,7 +65,9 @@ bool ffNetifGetDefaultRouteImplV4(FFNetifDefaultRouteResult* result) {
if ((rtm->rtm_flags & RTF_GATEWAY) && !(rtm->rtm_flags & RTF_REJECT) && (sa->sa_family == AF_INET)) {
struct sockaddr_dl* sdl = (struct sockaddr_dl*) get_rt_address(rtm, RTA_IFP);
if (sdl && sdl->sdl_family == AF_LINK) {
if (sdl->sdl_nlen > IF_NAMESIZE) continue;
if (sdl->sdl_nlen > IF_NAMESIZE) {
continue;
}
memcpy(result->ifName, sdl->sdl_data, sdl->sdl_nlen);
result->ifName[sdl->sdl_nlen] = '\0';
result->ifIndex = sdl->sdl_index;
@@ -106,7 +108,9 @@ bool ffNetifGetDefaultRouteImplV6(FFNetifDefaultRouteResult* result) {
if ((rtm->rtm_flags & RTF_GATEWAY) && !(rtm->rtm_flags & RTF_REJECT) && (sa->sa_family == AF_INET6)) {
struct sockaddr_dl* sdl = (struct sockaddr_dl*) get_rt_address(rtm, RTA_IFP);
if (sdl && sdl->sdl_family == AF_LINK) {
if (sdl->sdl_nlen > IF_NAMESIZE) continue;
if (sdl->sdl_nlen > IF_NAMESIZE) {
continue;
}
memcpy(result->ifName, sdl->sdl_data, sdl->sdl_nlen);
result->ifName[sdl->sdl_nlen] = '\0';
result->ifIndex = sdl->sdl_index;