From 8f12614f2da8221438a3807b1d234517650fbdb6 Mon Sep 17 00:00:00 2001 From: Dominick Allen Date: Thu, 2 Jan 2025 16:27:56 -0600 Subject: Clang tidy fixes. --- include/fud_csv.hpp | 19 ++++++++++++------- include/fud_option.hpp | 2 +- include/fud_vector.hpp | 2 +- 3 files changed, 14 insertions(+), 9 deletions(-) (limited to 'include') diff --git a/include/fud_csv.hpp b/include/fud_csv.hpp index 38b1b81..237c56f 100644 --- a/include/fud_csv.hpp +++ b/include/fud_csv.hpp @@ -25,8 +25,6 @@ #include "fud_utf8.hpp" #include "fud_vector.hpp" -#include // reference_wrapper - namespace fud { using TextBuffer = Vector; @@ -70,19 +68,26 @@ struct Csv { static Csv make(Allocator& entryAllocator, Allocator& bufferAllocator); /** Consume and return the CSV. */ - static FudStatus parseFromFilename( + static FudStatus parseFromFilenameUnbuffered( + Csv& csv, + StringView filename, + OpenFlags flags = OpenFlags{}, + Option dirFdOption = NullOpt, + size_t maxExtraAttempts = 0); + + static FudStatus parseFromFilenameBuffered( Csv& csv, - Option bufferOption, + TextBuffer&& buffer, StringView filename, OpenFlags flags = OpenFlags{}, Option dirFdOption = NullOpt, - Option maxExtraAttempts = NullOpt); + size_t maxExtraAttempts = 0); // assumes file is at start - static FudStatus parseFromUnbufferedFile(Csv& csv, RegularFile&& file, Option maxExtraAttempts); + static FudStatus parseFromUnbufferedFile(Csv& csv, RegularFile&& file, size_t maxExtraAttempts); // assumes file is at start - static FudStatus parseFromBufferedFile(Csv& csv, BufferedRegularFile& file, Option maxExtraAttempts); + static FudStatus parseFromBufferedFile(Csv& csv, BufferedRegularFile& file, size_t maxExtraAttempts); }; } // namespace fud diff --git a/include/fud_option.hpp b/include/fud_option.hpp index af2fcd3..3c94eaa 100644 --- a/include/fud_option.hpp +++ b/include/fud_option.hpp @@ -229,7 +229,7 @@ class Option { m_data.clear(); } - static constexpr auto Align = std::max(alignof(T), alignof(std::reference_wrapper)); + static constexpr auto Align = std::max(alignof(ValueType), alignof(std::reference_wrapper)); alignas(Align) option_detail::DataArray m_data{}; bool m_engaged; diff --git a/include/fud_vector.hpp b/include/fud_vector.hpp index 1730c50..2942e71 100644 --- a/include/fud_vector.hpp +++ b/include/fud_vector.hpp @@ -205,7 +205,7 @@ class Vector { return FudStatus::NullPointer; } } else { - allocator = rhs.allocator; + allocator = rhs.m_allocator; if (allocator == nullptr) { return FudStatus::ArgumentInvalid; } -- cgit v1.2.3