mirror of
https://github.com/samba-team/samba.git
synced 2025-02-02 09:47:23 +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 */
|
||||
int
|
||||
SMBC_dlist_contains(SMBCFILE * list, SMBCFILE *p);
|
||||
bool SMBC_dlist_contains(SMBCFILE * list, SMBCFILE *p);
|
||||
|
||||
int
|
||||
SMBC_errno(SMBCCTX *context,
|
||||
|
@ -31,15 +31,18 @@
|
||||
/*
|
||||
* check if an element is part of the list.
|
||||
*/
|
||||
int
|
||||
SMBC_dlist_contains(SMBCFILE * list, SMBCFILE *p)
|
||||
bool SMBC_dlist_contains(SMBCFILE * list, SMBCFILE *p)
|
||||
{
|
||||
if (!p || !list) return False;
|
||||
if ((p == NULL) || (list == NULL)) {
|
||||
return false;
|
||||
}
|
||||
do {
|
||||
if (p == list) return True;
|
||||
if (p == list) {
|
||||
return true;
|
||||
}
|
||||
list = list->next;
|
||||
} while (list);
|
||||
return False;
|
||||
} while (list != NULL);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user