From: Quentin Young Date: Mon, 25 Feb 2019 19:49:00 +0000 (+0000) Subject: *: compare pointer types to NULL, not 0 X-Git-Tag: 7.1_pulled~195^2~5 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=831600c3d073dff1c6c0a4de84ef476f97b0332d;p=matthieu%2Ffrr.git *: compare pointer types to NULL, not 0 Signed-off-by: Quentin Young --- diff --git a/bgpd/bgp_mpath.c b/bgpd/bgp_mpath.c index 241146e451..d5b3d6b197 100644 --- a/bgpd/bgp_mpath.c +++ b/bgpd/bgp_mpath.c @@ -671,7 +671,7 @@ void bgp_mp_dmed_deselect(struct bgp_path_info *dmed_best) bgp_path_info_mpath_count_set(dmed_best, 0); UNSET_FLAG(dmed_best->flags, BGP_PATH_MULTIPATH_CHG); - assert(bgp_path_info_mpath_first(dmed_best) == 0); + assert(bgp_path_info_mpath_first(dmed_best) == NULL); } /* diff --git a/isisd/dict.c b/isisd/dict.c index 5d3e61e6d6..d91f05d254 100644 --- a/isisd/dict.c +++ b/isisd/dict.c @@ -1095,10 +1095,10 @@ void dict_load_end(dict_load_t *load) baselevel = level = 1; complete = tree[0]; - if (complete != 0) { + if (complete != NULL) { tree[0] = 0; complete->right = dictnil; - while (tree[level] != 0) { + while (tree[level] != NULL) { tree[level]->right = complete; complete->parent = tree[level]; complete = tree[level]; @@ -1114,7 +1114,7 @@ void dict_load_end(dict_load_t *load) complete = curr; assert(level == baselevel); - while (tree[level] != 0) { + while (tree[level] != NULL) { tree[level]->right = complete; complete->parent = tree[level]; complete = tree[level]; @@ -1134,7 +1134,7 @@ void dict_load_end(dict_load_t *load) complete = dictnil; for (i = 0; i < DICT_DEPTH_MAX; i++) { - if (tree[i] != 0) { + if (tree[i] != NULL) { tree[i]->right = complete; complete->parent = tree[i]; complete = tree[i]; diff --git a/nhrpd/netlink_arp.c b/nhrpd/netlink_arp.c index 4c6827cb3d..6666c6e96b 100644 --- a/nhrpd/netlink_arp.c +++ b/nhrpd/netlink_arp.c @@ -122,7 +122,7 @@ static int netlink_route_recv(struct thread *t) zbuf_init(&zb, buf, sizeof(buf), 0); while (zbuf_recv(&zb, fd) > 0) { - while ((n = znl_nlmsg_pull(&zb, &payload)) != 0) { + while ((n = znl_nlmsg_pull(&zb, &payload)) != NULL) { debugf(NHRP_DEBUG_KERNEL, "Netlink: Received msg_type %u, msg_flags %u", n->nlmsg_type, n->nlmsg_flags); @@ -217,7 +217,7 @@ static int netlink_log_recv(struct thread *t) zbuf_init(&zb, buf, sizeof(buf), 0); while (zbuf_recv(&zb, fd) > 0) { - while ((n = znl_nlmsg_pull(&zb, &payload)) != 0) { + while ((n = znl_nlmsg_pull(&zb, &payload)) != NULL) { debugf(NHRP_DEBUG_KERNEL, "Netlink-log: Received msg_type %u, msg_flags %u", n->nlmsg_type, n->nlmsg_flags); diff --git a/vtysh/vtysh_user.c b/vtysh/vtysh_user.c index dcf8ca0470..aaf70ab08b 100644 --- a/vtysh/vtysh_user.c +++ b/vtysh/vtysh_user.c @@ -204,7 +204,7 @@ char *vtysh_get_home(void) struct passwd *passwd; char *homedir; - if ((homedir = getenv("HOME")) != 0) + if ((homedir = getenv("HOME")) != NULL) return homedir; /* Fallback if HOME is undefined */