Skip to content

Commit 8589bf2

Browse files
committed
Chore: silence compiler warnings
1 parent 8b18e69 commit 8589bf2

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

src/common/netif/netif_linux.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,7 @@ bool ffNetifGetDefaultRouteImplV4(FFNetifDefaultRouteResult* result)
130130
}
131131

132132
if (nlh->nlmsg_type == NLMSG_ERROR) {
133-
struct nlmsgerr* err = (struct nlmsgerr*)NLMSG_DATA(nlh);
134-
FF_DEBUG("Netlink reports error: %s", strerror(-err->error));
133+
FF_DEBUG("Netlink reports error: %s", strerror(-((struct nlmsgerr*)NLMSG_DATA(nlh))->error));
135134
continue;
136135
}
137136

@@ -340,8 +339,7 @@ bool ffNetifGetDefaultRouteImplV6(FFNetifDefaultRouteResult* result)
340339
}
341340

342341
if (nlh->nlmsg_type == NLMSG_ERROR) {
343-
struct nlmsgerr* err = (struct nlmsgerr*)NLMSG_DATA(nlh);
344-
FF_DEBUG("Netlink reports error: %s", strerror(-err->error));
342+
FF_DEBUG("Netlink reports error: %s", strerror(-((struct nlmsgerr*)NLMSG_DATA(nlh))->error));
345343
continue;
346344
}
347345

src/detection/gpu/gpu_windows.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ const char* ffDetectGPUImpl(FF_MAYBE_UNUSED const FFGPUOptions* options, FFlist*
4040
return "CM_Get_Device_ID_ListW failed";
4141
}
4242

43-
int deviceCount = 0;
43+
FF_MAYBE_UNUSED int deviceCount = 0;
4444
for (wchar_t* devId = devIdList; *devId; devId += wcslen(devId) + 1)
4545
{
4646
FF_DEBUG("Processing device ID: %ls", devId);

src/detection/localip/localip_windows.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,7 @@ const char* ffDetectLocalIps(const FFLocalIpOptions* options, FFlist* results)
7474
}
7575
}
7676

77-
int adapterCount = 0;
78-
int processedCount = 0;
77+
FF_MAYBE_UNUSED int adapterCount = 0, processedCount = 0;
7978

8079
// Iterate through all of the adapters
8180
for (IP_ADAPTER_ADDRESSES* adapter = adapter_addresses; adapter; adapter = adapter->Next)
@@ -137,7 +136,7 @@ const char* ffDetectLocalIps(const FFLocalIpOptions* options, FFlist* results)
137136
uint32_t typesToAdd = options->showType & (FF_LOCALIP_TYPE_IPV4_BIT | FF_LOCALIP_TYPE_IPV6_BIT | FF_LOCALIP_TYPE_ALL_IPS_BIT);
138137
FF_DEBUG("Types to add for adapter %u: 0x%X", (unsigned)adapter->IfIndex, typesToAdd);
139138

140-
int ipv4Count = 0, ipv6Count = 0;
139+
FF_MAYBE_UNUSED int ipv4Count = 0, ipv6Count = 0;
141140

142141
for (IP_ADAPTER_UNICAST_ADDRESS* ifa = adapter->FirstUnicastAddress; ifa; ifa = ifa->Next)
143142
{

0 commit comments

Comments
 (0)