mirror of
https://github.com/samba-team/samba.git
synced 2025-02-08 05:57:51 +03:00
libsmb: Make SMBC_dlist_contains return bool
It returned True/False, and is used as boolean only. Modernize formatting a bit. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
This commit is contained in:
parent
66caa6b24d
commit
20b99b03a0
@ -430,8 +430,7 @@ SMBC_ftruncate_ctx(SMBCCTX *context,
|
|||||||
|
|
||||||
|
|
||||||
/* Functions in libsmb_misc.c */
|
/* Functions in libsmb_misc.c */
|
||||||
int
|
bool SMBC_dlist_contains(SMBCFILE * list, SMBCFILE *p);
|
||||||
SMBC_dlist_contains(SMBCFILE * list, SMBCFILE *p);
|
|
||||||
|
|
||||||
int
|
int
|
||||||
SMBC_errno(SMBCCTX *context,
|
SMBC_errno(SMBCCTX *context,
|
||||||
|
@ -31,15 +31,18 @@
|
|||||||
/*
|
/*
|
||||||
* check if an element is part of the list.
|
* check if an element is part of the list.
|
||||||
*/
|
*/
|
||||||
int
|
bool SMBC_dlist_contains(SMBCFILE * list, SMBCFILE *p)
|
||||||
SMBC_dlist_contains(SMBCFILE * list, SMBCFILE *p)
|
|
||||||
{
|
{
|
||||||
if (!p || !list) return False;
|
if ((p == NULL) || (list == NULL)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
do {
|
do {
|
||||||
if (p == list) return True;
|
if (p == list) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
list = list->next;
|
list = list->next;
|
||||||
} while (list);
|
} while (list != NULL);
|
||||||
return False;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user