From dc95ec5777f92187e478bf4f19c822c08a33c362 Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Fri, 27 Jan 2023 23:48:00 -0500 Subject: [PATCH] file_systems/fs_ops_support: Add comment for next_dirent and mark "inline." This way, anything which includes the file will not trigger a warning if it does not use the function. --- headers/private/file_systems/fs_ops_support.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/headers/private/file_systems/fs_ops_support.h b/headers/private/file_systems/fs_ops_support.h index a2b2f3875f..f6b9743214 100644 --- a/headers/private/file_systems/fs_ops_support.h +++ b/headers/private/file_systems/fs_ops_support.h @@ -14,7 +14,10 @@ #endif -static struct dirent* +/*! Computes and assigns `dirent->d_reclen`, adjusts `bufferRemaining` accordingly, + * and either advances to the next buffer, or returns NULL if no space remains. + */ +static inline struct dirent* next_dirent(struct dirent* dirent, size_t nameLength, size_t& bufferRemaining) { const size_t reclen = offsetof(struct dirent, d_name) + nameLength + 1;