From e0712f444d3641971cccf9f704fc4ae2a144b2aa Mon Sep 17 00:00:00 2001 From: Andrew Gaul Date: Fri, 29 Nov 2019 23:25:26 -0800 Subject: [PATCH] Update source for clang-tidy 9.0.0 --- .clang-tidy | 4 ++++ src/fdcache.cpp | 12 ++++++------ src/fdcache.h | 2 +- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/.clang-tidy b/.clang-tidy index 6f7ed48..7d1255b 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -1,10 +1,12 @@ Checks: ' -*, bugprone-*, + -bugprone-branch-clone, -bugprone-macro-parentheses, google-*, -google-build-using-namespace, -google-readability-casting, + -google-readability-function-size, -google-readability-todo, -google-runtime-int, -google-runtime-references, @@ -17,11 +19,13 @@ Checks: ' -modernize-loop-convert, -modernize-use-auto, -modernize-use-nullptr, + -modernize-use-trailing-return-type, -modernize-use-using, performance-*, portability-*, readability-*, -readability-else-after-return, + -readability-function-size, -readability-implicit-bool-conversion, -readability-isolate-declaration, -readability-magic-numbers, diff --git a/src/fdcache.cpp b/src/fdcache.cpp index 521b08c..348142c 100644 --- a/src/fdcache.cpp +++ b/src/fdcache.cpp @@ -808,7 +808,7 @@ bool PageList::GetMultipartSizeList(fdpage_list_t& mplist, off_t partsize) const return true; } -bool PageList::IsModified(void) const +bool PageList::IsModified() const { for(fdpage_list_t::const_iterator iter = pages.begin(); iter != pages.end(); ++iter){ if(iter->modified){ @@ -818,7 +818,7 @@ bool PageList::IsModified(void) const return false; } -bool PageList::ClearAllModified(void) +bool PageList::ClearAllModified() { for(fdpage_list_t::iterator iter = pages.begin(); iter != pages.end(); ++iter){ if(iter->modified){ @@ -957,7 +957,7 @@ void PageList::Dump() //------------------------------------------------ bool FdEntity::mixmultipart = true; -bool FdEntity::SetNoMixMultipart(void) +bool FdEntity::SetNoMixMultipart() { bool old = mixmultipart; mixmultipart = false; @@ -2035,7 +2035,7 @@ int FdEntity::RowFlush(const char* tpath, bool force_sync) // Need to lock before calling this method. bool FdEntity::ReserveDiskSpace(off_t size) { - if(FdManager::get()->ReserveDiskSpace(size)){ + if(FdManager::ReserveDiskSpace(size)){ return true; } @@ -2047,14 +2047,14 @@ bool FdEntity::ReserveDiskSpace(off_t size) return false; } - if(FdManager::get()->ReserveDiskSpace(size)){ + if(FdManager::ReserveDiskSpace(size)){ return true; } } FdManager::get()->CleanupCacheDir(); - return FdManager::get()->ReserveDiskSpace(size); + return FdManager::ReserveDiskSpace(size); } ssize_t FdEntity::Read(char* bytes, off_t start, size_t size, bool force_load) diff --git a/src/fdcache.h b/src/fdcache.h index ec369c3..1858032 100644 --- a/src/fdcache.h +++ b/src/fdcache.h @@ -247,7 +247,7 @@ class FdManager static off_t SetEnsureFreeDiskSpace(off_t size); static bool IsSafeDiskSpace(const char* path, off_t size); static void FreeReservedDiskSpace(off_t size); - bool ReserveDiskSpace(off_t size); + static bool ReserveDiskSpace(off_t size); // Return FdEntity associated with path, returning NULL on error. This operation increments the reference count; callers must decrement via Close after use. FdEntity* GetFdEntity(const char* path, int existfd = -1);