*: return bool from boolean functions

Not 1 or 0.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
This commit is contained in:
Quentin Young 2019-02-25 18:55:37 +00:00
parent d8729f8cb5
commit b08047f82d
5 changed files with 7 additions and 7 deletions

View 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);

View 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))

View 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;
}

View 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));
}

View 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)