Skip to content

Commit

Permalink
Address cppcheck 2.10 warnings
Browse files Browse the repository at this point in the history
References s3fs-fuse#2162.
  • Loading branch information
gaul committed May 14, 2023
1 parent 7bf4ca1 commit 7ff94fa
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
1 change: 1 addition & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ cppcheck:
--enable=warning,style,information,missingInclude \
--suppress=missingIncludeSystem \
--suppress=unmatchedSuppression \
--suppress=useStlAlgorithm \
src/ test/

#
Expand Down
4 changes: 1 addition & 3 deletions src/addhead.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,7 @@ bool AdditionalHeader::Load(const char* file)
addheadlist.push_back(paddhead);

// set flag
if(!is_enable){
is_enable = true;
}
is_enable = true;
}
return true;
}
Expand Down
2 changes: 1 addition & 1 deletion src/fdcache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ bool FdManager::HaveLseekHole()
}
FdManager::checked_lseek = true;
FdManager::have_lseek_hole = false;
return FdManager::have_lseek_hole;
return false;
}

// check SEEK_DATA/SEEK_HOLE options
Expand Down
1 change: 1 addition & 0 deletions src/fdcache_page.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -959,6 +959,7 @@ bool PageList::Serialize(CacheFileStat& file, bool is_output, ino_t inode)
is_modified = (1 == cvt_strtoofft(part.c_str(), /* base= */10) ? true : false);
}
// add new area
// cppcheck-suppress knownConditionTrueFalse
PageList::page_status pstatus =
( is_loaded && is_modified ? PageList::PAGE_LOAD_MODIFIED :
!is_loaded && is_modified ? PageList::PAGE_MODIFIED :
Expand Down

0 comments on commit 7ff94fa

Please sign in to comment.