]> git.puffer.fish Git - matthieu/frr.git/commitdiff
*: return bool from boolean functions
authorQuentin Young <qlyoung@cumulusnetworks.com>
Mon, 25 Feb 2019 18:55:37 +0000 (18:55 +0000)
committerQuentin Young <qlyoung@cumulusnetworks.com>
Mon, 25 Feb 2019 23:00:16 +0000 (23:00 +0000)
Not 1 or 0.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
bgpd/bgp_lcommunity.c
bgpd/bgp_updgrp.c
lib/frrstr.c
tests/lib/test_srcdest_table.c
zebra/zebra_pbr.c

index 06281e16c62bed0abe20b4d5a907412f33cd7e45..9934ab4c13deda7e9c4ba1a17386076bc046c810 100644 (file)
@@ -319,10 +319,10 @@ bool lcommunity_cmp(const void *arg1, const void *arg2)
        const struct lcommunity *lcom2 = arg2;
 
        if (lcom1 == NULL && lcom2 == NULL)
-               return 1;
+               return true;
 
        if (lcom1 == NULL || lcom2 == NULL)
-               return 0;
+               return false;
 
        return (lcom1->size == lcom2->size
                && memcmp(lcom1->val, lcom2->val, lcom_length(lcom1)) == 0);
index b74dc33ea4d4e08423c663433c5d266bec7b499f..472800de10774c949dcd22d3d522d5f4e6b1edb5 100644 (file)
@@ -440,7 +440,7 @@ static bool updgrp_hash_cmp(const void *p1, const void *p2)
                return false;
 
        if (pe1->addpath_type[afi][safi] != pe2->addpath_type[afi][safi])
-               return 0;
+               return false;
 
        if ((pe1->cap & PEER_UPDGRP_CAP_FLAGS)
            != (pe2->cap & PEER_UPDGRP_CAP_FLAGS))
index 85d968182b042f87a46f7eb33e9802339ca818d3..fd337073f812d30aa77ffea4adf325e47f1eb10d 100644 (file)
@@ -155,13 +155,13 @@ void frrstr_strvec_free(vector v)
 bool begins_with(const char *str, const char *prefix)
 {
        if (!str || !prefix)
-               return 0;
+               return false;
 
        size_t lenstr = strlen(str);
        size_t lenprefix = strlen(prefix);
 
        if (lenprefix > lenstr)
-               return 0;
+               return false;
 
        return strncmp(str, prefix, lenprefix) == 0;
 }
index 5c0e171778300740e63ec57a35e57ea1796df202..19a40b21841f964ac583c9121106191a980391a2 100644 (file)
@@ -105,7 +105,7 @@ static unsigned int log_key(void *data)
 static bool log_cmp(const void *a, const void *b)
 {
        if (a == NULL || b == NULL)
-               return 0;
+               return false;
 
        return !memcmp(a, b, 2 * sizeof(struct prefix));
 }
index 348bdeb9fca87653fc8084d4463de10150ed6e15..73db567eace35a52a1e6427f120504060025ae27 100644 (file)
@@ -388,7 +388,7 @@ bool zebra_pbr_iptable_hash_equal(const void *arg1, const void *arg2)
        r2 = (const struct zebra_pbr_iptable *)arg2;
 
        if (r1->vrf_id != r2->vrf_id)
-               return 0;
+               return false;
        if (r1->type != r2->type)
                return false;
        if (r1->unique != r2->unique)