mirror of
https://github.com/opnsense/src.git
synced 2026-06-11 01:30:30 -04:00
Convert fsidcmp(9) from macro to inline function
This allows type checking the arguments. Explicit structure members comparisions are done to avoid introducting string.h pollution for userspace. Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D43205
This commit is contained in:
parent
63c928f17e
commit
3334a537ed
1 changed files with 6 additions and 1 deletions
|
|
@ -50,7 +50,12 @@
|
|||
|
||||
typedef struct fsid { int32_t val[2]; } fsid_t; /* filesystem id type */
|
||||
|
||||
#define fsidcmp(a, b) memcmp((a), (b), sizeof(fsid_t))
|
||||
/* Returns non-zero if fsids are different. */
|
||||
static inline int
|
||||
fsidcmp(const fsid_t *a, const fsid_t *b)
|
||||
{
|
||||
return (a->val[0] != b->val[0] || a->val[1] != b->val[1]);
|
||||
}
|
||||
|
||||
/*
|
||||
* File identifier.
|
||||
|
|
|
|||
Loading…
Reference in a new issue