]> git.proxmox.com Git - mirror_frr.git/commitdiff
*: compare pointer types to NULL, not 0
authorQuentin Young <qlyoung@cumulusnetworks.com>
Mon, 25 Feb 2019 19:49:00 +0000 (19:49 +0000)
committerQuentin Young <qlyoung@cumulusnetworks.com>
Mon, 25 Feb 2019 23:00:46 +0000 (23:00 +0000)
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
bgpd/bgp_mpath.c
isisd/dict.c
nhrpd/netlink_arp.c
vtysh/vtysh_user.c

index 241146e4519f3b489b0fa0e1d29df40d74b84795..d5b3d6b1974da26a2da084f64d8680db03d223d4 100644 (file)
@@ -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);
 }
 
 /*
index 5d3e61e6d6bfe0915f0edd55d80a32b646586ec9..d91f05d25442e77cdfcc8cc662f23add696070a4 100644 (file)
@@ -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];
index 4c6827cb3d63536e4976426e02c373d95b397006..6666c6e96bca99553ab31da45477d452386faeb1 100644 (file)
@@ -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);
index dcf8ca0470f7081038663d2a32daa35352445aeb..aaf70ab08b1d9917854b5cfb5c0da197979cbb97 100644 (file)
@@ -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 */