From b08047f82d887d1ea639bbfe97147b46572099d5 Mon Sep 17 00:00:00 2001 From: Quentin Young Date: Mon, 25 Feb 2019 18:55:37 +0000 Subject: [PATCH] *: return bool from boolean functions Not 1 or 0. Signed-off-by: Quentin Young --- bgpd/bgp_lcommunity.c | 4 ++-- bgpd/bgp_updgrp.c | 2 +- lib/frrstr.c | 4 ++-- tests/lib/test_srcdest_table.c | 2 +- zebra/zebra_pbr.c | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/bgpd/bgp_lcommunity.c b/bgpd/bgp_lcommunity.c index 06281e16c6..9934ab4c13 100644 --- a/bgpd/bgp_lcommunity.c +++ b/bgpd/bgp_lcommunity.c @@ -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); diff --git a/bgpd/bgp_updgrp.c b/bgpd/bgp_updgrp.c index b74dc33ea4..472800de10 100644 --- a/bgpd/bgp_updgrp.c +++ b/bgpd/bgp_updgrp.c @@ -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)) diff --git a/lib/frrstr.c b/lib/frrstr.c index 85d968182b..fd337073f8 100644 --- a/lib/frrstr.c +++ b/lib/frrstr.c @@ -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; } diff --git a/tests/lib/test_srcdest_table.c b/tests/lib/test_srcdest_table.c index 5c0e171778..19a40b2184 100644 --- a/tests/lib/test_srcdest_table.c +++ b/tests/lib/test_srcdest_table.c @@ -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)); } diff --git a/zebra/zebra_pbr.c b/zebra/zebra_pbr.c index 348bdeb9fc..73db567eac 100644 --- a/zebra/zebra_pbr.c +++ b/zebra/zebra_pbr.c @@ -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) -- 2.39.5