From 49862904f6cc707d300fab079ffe8173bf24d5d4 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Sat, 25 Jul 2020 02:17:48 +0300 Subject: libcamera: file: Use Flags<> class for map flags MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use the newly introduced Flags<> class to store a bitfield of File::MapFlag in a type-safe way. Signed-off-by: Laurent Pinchart Reviewed-by: Niklas Söderlund Reviewed-by: Jacopo Mondi --- src/libcamera/base/file.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/libcamera/base/file.cpp b/src/libcamera/base/file.cpp index 073666fa..944918f2 100644 --- a/src/libcamera/base/file.cpp +++ b/src/libcamera/base/file.cpp @@ -52,6 +52,11 @@ LOG_DEFINE_CATEGORY(File) * the file constents */ +/** + * \typedef File::MapFlags + * \brief A bitwise combination of File::MapFlag values + */ + /** * \enum File::OpenMode * \brief Mode in which a file is opened @@ -371,7 +376,7 @@ ssize_t File::write(const Span &data) * * \return The mapped memory on success, or an empty span otherwise */ -Span File::map(off_t offset, ssize_t size, enum File::MapFlag flags) +Span File::map(off_t offset, ssize_t size, File::MapFlags flags) { if (!isOpen()) { error_ = -EBADF; -- cgit v1.2.1