From b64ea39c7b488a566dea0ce20bba946ac3be0e0b Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Tue, 31 May 2016 22:21:17 +0900 Subject: [PATCH] Clang-format and small amends mapaddr_ is always nullptr in this context, so no need to set to nullptr again. --- src/AbstractDiskWriter.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/AbstractDiskWriter.cc b/src/AbstractDiskWriter.cc index a6191490..ea4403fe 100644 --- a/src/AbstractDiskWriter.cc +++ b/src/AbstractDiskWriter.cc @@ -373,7 +373,8 @@ void AbstractDiskWriter::ensureMmapWrite(size_t len, int64_t offset) return; } - if (static_cast(std::numeric_limits::max()) < static_cast(filesize)) { + if (static_cast(std::numeric_limits::max()) < + static_cast(filesize)) { // filesize could overflow in 32bit OS with 64bit off_t type // the filesize will be truncated if provided as a 32bit size_t enableMmap_ = false; @@ -398,11 +399,11 @@ void AbstractDiskWriter::ensureMmapWrite(size_t len, int64_t offset) errNum = GetLastError(); } #else // !__MINGW32__ - void * pa = mmap(nullptr, filesize, PROT_READ | PROT_WRITE, MAP_SHARED, fd_, 0); + auto pa = + mmap(nullptr, filesize, PROT_READ | PROT_WRITE, MAP_SHARED, fd_, 0); if (pa == MAP_FAILED) { errNum = errno; - mapaddr_ = nullptr; } else { mapaddr_ = reinterpret_cast(pa);