mirror of
https://github.com/mhx/dwarfs.git
synced 2025-09-09 04:19:10 -04:00
chore: add clang-tidy exceptions for const_casts
This commit is contained in:
parent
5d341ec60e
commit
68e0bcd480
@ -115,6 +115,7 @@ mmap::advise(advice adv [[maybe_unused]], file_off_t offset [[maybe_unused]],
|
||||
size += misalign;
|
||||
size -= size % page_size_;
|
||||
|
||||
// NOLINTNEXTLINE(cppcoreguidelines-pro-type-const-cast)
|
||||
auto data = const_cast<char*>(mf_.const_data() + offset);
|
||||
|
||||
int native_adv = posix_advice(adv);
|
||||
|
@ -102,6 +102,7 @@ class cached_block_ final : public cached_block {
|
||||
// TODO: should be possible to do this on Windows and macOS as well
|
||||
auto page_size = ::sysconf(_SC_PAGESIZE);
|
||||
tmp.resize((data_.size() + page_size - 1) / page_size);
|
||||
// NOLINTNEXTLINE(cppcoreguidelines-pro-type-const-cast)
|
||||
if (::mincore(const_cast<uint8_t*>(data_.data()), data_.size(),
|
||||
tmp.data()) == 0) {
|
||||
// i&1 == 1 means resident in memory
|
||||
|
@ -441,6 +441,7 @@ size_t inode_reader_<LoggerPolicy>::readv(iovec_read_buf& buf, uint32_t inode,
|
||||
auto rv = read_internal(inode, size, offset, maxiov, chunks, ec,
|
||||
[&](size_t, const block_range& br) {
|
||||
auto& iov = buf.buf.emplace_back();
|
||||
// NOLINTNEXTLINE(cppcoreguidelines-pro-type-const-cast)
|
||||
iov.iov_base = const_cast<uint8_t*>(br.data());
|
||||
iov.iov_len = br.size();
|
||||
buf.ranges.emplace_back(br);
|
||||
|
Loading…
x
Reference in New Issue
Block a user