tree-wide: replace FOREACH_POINTER with FOREACH_ARGUMENT
The latter is more generic and while being compatible with the former.
This commit is contained in:
@@ -266,12 +266,6 @@ static inline int __coverity_check_and_return__(int condition) {
|
||||
/* Pointers range from NULL to POINTER_MAX */
|
||||
#define POINTER_MAX ((void*) UINTPTR_MAX)
|
||||
|
||||
/* Iterates through a specified list of pointers. Accepts NULL pointers, but uses POINTER_MAX as internal marker for EOL. */
|
||||
#define FOREACH_POINTER(p, x, ...) \
|
||||
for (typeof(p) *_l = (typeof(p)[]) { ({ p = x; }), ##__VA_ARGS__, POINTER_MAX }; \
|
||||
p != (typeof(p)) POINTER_MAX; \
|
||||
p = *(++_l))
|
||||
|
||||
#define _FOREACH_ARRAY(i, array, num, m, end) \
|
||||
for (typeof(array[0]) *i = (array), *end = ({ \
|
||||
typeof(num) m = (num); \
|
||||
|
||||
@@ -446,14 +446,15 @@ bool fstype_needs_quota(const char *fstype) {
|
||||
}
|
||||
|
||||
bool fstype_is_api_vfs(const char *fstype) {
|
||||
const FilesystemSet *fs;
|
||||
assert(fstype);
|
||||
|
||||
FOREACH_POINTER(fs,
|
||||
filesystem_sets + FILESYSTEM_SET_BASIC_API,
|
||||
filesystem_sets + FILESYSTEM_SET_AUXILIARY_API,
|
||||
filesystem_sets + FILESYSTEM_SET_PRIVILEGED_API,
|
||||
filesystem_sets + FILESYSTEM_SET_TEMPORARY)
|
||||
if (nulstr_contains(fs->value, fstype))
|
||||
const FilesystemSet *fs;
|
||||
FOREACH_ARGUMENT(fs,
|
||||
filesystem_sets + FILESYSTEM_SET_BASIC_API,
|
||||
filesystem_sets + FILESYSTEM_SET_AUXILIARY_API,
|
||||
filesystem_sets + FILESYSTEM_SET_PRIVILEGED_API,
|
||||
filesystem_sets + FILESYSTEM_SET_TEMPORARY)
|
||||
if (nulstr_contains(fs->value, fstype))
|
||||
return true;
|
||||
|
||||
/* Filesystems not present in the internal database */
|
||||
|
||||
Reference in New Issue
Block a user