Quit using NULL macro.

This commit is contained in:
Nicholas J. Kain 2018-10-26 07:17:39 -04:00
parent 05a075aeb2
commit 56b6ae2cd3
6 changed files with 10 additions and 10 deletions

View File

@ -55,12 +55,12 @@ static int get_udp_unicast_socket(struct client_state_t cs[static 1])
char buf[32];
buf[0] = 'u';
memcpy(buf + 1, &cs->clientAddr, sizeof cs->clientAddr);
return request_sockd_fd(buf, 1 + sizeof cs->clientAddr, NULL);
return request_sockd_fd(buf, 1 + sizeof cs->clientAddr, (char *)0);
}
static int get_raw_broadcast_socket(void)
{
return request_sockd_fd("s", 1, NULL);
return request_sockd_fd("s", 1, (char *)0);
}
static int get_raw_listen_socket(struct client_state_t cs[static 1])

View File

@ -109,7 +109,7 @@ static int perform_ip4set(const char buf[static 1], size_t len)
}
return perform_ip_subnet_bcast(ip4_addr, ip4_subnet,
have_bcast ? ip4_bcast : NULL);
have_bcast ? ip4_bcast : (char *)0);
}
%%{

View File

@ -426,8 +426,8 @@ static void ipbcpfx_clear_others_do(const struct nlmsghdr *nlh, void *data)
erase:
r = rtnl_addr_broadcast_send(ipx->fd, RTM_DELADDR, ifm->ifa_flags,
ifm->ifa_scope,
tb[IFA_ADDRESS] ? RTA_DATA(tb[IFA_ADDRESS]) : NULL,
tb[IFA_BROADCAST] ? RTA_DATA(tb[IFA_BROADCAST]) : NULL,
tb[IFA_ADDRESS] ? RTA_DATA(tb[IFA_ADDRESS]) : (uint32_t *)0,
tb[IFA_BROADCAST] ? RTA_DATA(tb[IFA_BROADCAST]) : (uint32_t *)0,
ifm->ifa_prefixlen);
if (r < 0 && r != -2) {
log_warning("%s: (%s) Failed to delete IP and broadcast addresses.",

View File

@ -166,7 +166,7 @@ static void setup_signals_ndhc(void)
sigaddset(&mask, SIGUSR2);
sigaddset(&mask, SIGCHLD);
sigaddset(&mask, SIGTERM);
if (sigprocmask(SIG_BLOCK, &mask, NULL) < 0)
if (sigprocmask(SIG_BLOCK, &mask, (sigset_t *)0) < 0)
suicide("sigprocmask failed");
if (cs.signalFd >= 0) {
epoll_del(cs.epollFd, cs.signalFd);
@ -232,7 +232,7 @@ int get_clientid_string(const char str[static 1], size_t slen)
uint8_t mac[6];
for (size_t i = 0; i < sizeof mac; ++i)
mac[i] = strtol(str+i*3, NULL, 16);
mac[i] = strtol(str+i*3, (char **)0, 16);
client_config.clientid[0] = 1; // Ethernet MAC type
memcpy(client_config.clientid + 1, mac,
min_size_t(sizeof mac, sizeof client_config.clientid - 1));
@ -471,7 +471,7 @@ static void ndhc_main(void) {
nk_set_chroot(chroot_dir);
memset(chroot_dir, '\0', sizeof chroot_dir);
nk_set_uidgid(ndhc_uid, ndhc_gid, NULL, 0);
nk_set_uidgid(ndhc_uid, ndhc_gid, (const unsigned char *)0, 0);
if (!carrier_isup()) {
if (ifchange_deconfig(&cs) < 0)

View File

@ -319,7 +319,7 @@ static int create_raw_broadcast_socket(void)
.sll_halen = 6,
};
memcpy(da.sll_addr, "\xff\xff\xff\xff\xff\xff", 6);
return create_raw_socket(&da, NULL, NULL);
return create_raw_socket(&da, (bool *)0, (struct sock_fprog *)0);
}
static bool arp_set_bpf_basic(int fd)

View File

@ -77,7 +77,7 @@ int setup_signals_subprocess(void)
sigaddset(&mask, SIGHUP);
sigaddset(&mask, SIGINT);
sigaddset(&mask, SIGTERM);
if (sigprocmask(SIG_BLOCK, &mask, NULL) < 0)
if (sigprocmask(SIG_BLOCK, &mask, (sigset_t *)0) < 0)
suicide("sigprocmask failed");
int sfd = signalfd(-1, &mask, SFD_NONBLOCK);
if (sfd < 0)