Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hurd: Avoid warnings #1268

Merged
merged 1 commit into from
Feb 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions pcap-hurd.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,13 @@ static struct bpf_insn filter[] = {
{ BPF_RET | BPF_K, 0, 0, MAXIMUM_SNAPLEN },
};

#define FILTER_COUNT (sizeof(filter) / sizeof(short))
/* device_set_filter calls net_set_filter which uses CSPF_BYTES which counts in
* shorts, not elements, so using extra parenthesis to silence compilers which
* believe we are computing wrong here. */
#define FILTER_COUNT (sizeof(filter) / (sizeof(short)))
guyharris marked this conversation as resolved.
Show resolved Hide resolved

static int
pcap_read_hurd(pcap_t *p, int cnt, pcap_handler callback, u_char *user)
pcap_read_hurd(pcap_t *p, int cnt _U_, pcap_handler callback, u_char *user)
{
struct net_rcv_msg *msg;
struct pcap_hurd *ph;
Expand Down Expand Up @@ -258,7 +261,7 @@ pcapint_create_interface(const char *device _U_, char *ebuf)
}

int
pcapint_platform_finddevs(pcap_if_list_t *alldevsp, char *errbuf)
pcapint_platform_finddevs(pcap_if_list_t *alldevsp _U_, char *errbuf _U_)
{
return 0;
}
Expand Down