summaryrefslogtreecommitdiff
path: root/source/fud_file.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/fud_file.cpp')
-rw-r--r--source/fud_file.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/source/fud_file.cpp b/source/fud_file.cpp
index 7219638..9666b14 100644
--- a/source/fud_file.cpp
+++ b/source/fud_file.cpp
@@ -728,8 +728,7 @@ DrainResult BufferedRegularFile::readUtf8(Utf8& sink, Option<size_t> maxExtraAtt
{
size_t extraAttempts{maxExtraAttempts.valueOr(0)};
Array<utf8, 4> utf8Data{};
- // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast)
- auto drainResult = read(reinterpret_cast<std::byte*>(utf8Data.data()), 1, maxExtraAttempts);
+ auto drainResult = read(std::bit_cast<std::byte*>(utf8Data.data()), 1, maxExtraAttempts);
if (drainResult.status != FudStatus::Success) {
return drainResult;
}
@@ -756,8 +755,7 @@ DrainResult BufferedRegularFile::readUtf8(Utf8& sink, Option<size_t> maxExtraAtt
}
if (bytesToRead > 0) {
- // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast)
- auto utf8ReadResult = read(reinterpret_cast<std::byte*>(utf8Data.data() + 1), bytesToRead, extraAttempts);
+ auto utf8ReadResult = read(std::bit_cast<std::byte*>(utf8Data.data() + 1), bytesToRead, extraAttempts);
drainResult.status = utf8ReadResult.status;
drainResult.bytesDrained += utf8ReadResult.bytesDrained;
}
@@ -784,7 +782,7 @@ void BufferedRegularFile::drainReadBuffer(std::byte*& sink, size_t& length, Drai
}
}
-// NOLINTNEXTLINE(readability-convert-member-functions-to-static,cppcoreguidelines-rvalue-*)
+// NOLINTNEXTLINE(cppcoreguidelines-rvalue-*)
FudStatus BufferedRegularFile::setBuffer(Vector<std::byte>&& buffer, bool discardOldBuffer)
{
static_cast<void>(buffer);