Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions include/decodeless/detail/mappedfile_linux.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class FileDescriptor {
}
size_t size() const { return static_cast<size_t>(stat().st_size); }
void truncate(size_t size) {
if (ftruncate(m_fd, size) == -1)
if (ftruncate(m_fd, static_cast<off_t>(size)) == -1)
throw LastError();
}
explicit operator bool() const = delete; // possibly unexpected due to operator int()
Expand Down Expand Up @@ -133,7 +133,7 @@ class MemoryMap {
requires Writable
{
assert(offset + size <= m_size);
size_t alignedOffset = offset & ~(pageSize() - 1);
size_t alignedOffset = offset & ~static_cast<size_t>(pageSize() - 1);
size_t alignedSize = size + offset - alignedOffset;
void* offsetAddress = static_cast<void*>(
static_cast<std::byte*>(const_cast<void*>(m_address)) + alignedOffset);
Expand Down Expand Up @@ -294,8 +294,8 @@ class ResizableMappedMemory {
throw std::bad_alloc();

// Align to the next page boundary
size_t ps = pageSize();
size_t newMappedSize = ((size + ps - 1) / ps) * ps;
size_t ps = static_cast<size_t>(pageSize());
size_t newMappedSize = (size + ps - 1) & ~(ps - 1);

if (newMappedSize > m_mappedSize) {
// Add just the new range
Expand Down