Address clang-tidy 17 warnings (#2362)

This commit is contained in:
Andrew Gaul 2023-11-12 11:48:08 +09:00 committed by GitHub
parent 807ec1f6f7
commit 0cd73e406d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 6 deletions

View File

@ -36,6 +36,7 @@ Checks: '
-google-runtime-references,
misc-*,
-misc-const-correctness,
-misc-include-cleaner,
-misc-no-recursion,
-misc-redundant-expression,
-misc-unused-parameters,
@ -52,6 +53,7 @@ Checks: '
-modernize-use-trailing-return-type,
-modernize-use-using,
performance-*,
-performance-avoid-endl,
-performance-no-int-to-ptr,
portability-*,
readability-*,

View File

@ -2139,7 +2139,10 @@ bool S3fsCurl::RemakeHandle()
// rewind file
struct stat st;
if(b_infile){
rewind(b_infile);
if(-1 == fseek(b_infile, 0, SEEK_SET)){
S3FS_PRN_WARN("Could not reset position(fd=%d)", fileno(b_infile));
return false;
}
if(-1 == fstat(fileno(b_infile), &st)){
S3FS_PRN_WARN("Could not get file stat(fd=%d)", fileno(b_infile));
return false;

View File

@ -206,8 +206,8 @@ class MpStatFlag
{
private:
mutable pthread_mutex_t flag_lock;
bool is_lock_init;
bool has_mp_stat;
bool is_lock_init = false;
bool has_mp_stat = false;
public:
MpStatFlag();
@ -221,7 +221,7 @@ class MpStatFlag
bool Set(bool flag);
};
MpStatFlag::MpStatFlag() : is_lock_init(false), has_mp_stat(false)
MpStatFlag::MpStatFlag()
{
pthread_mutexattr_t attr;
pthread_mutexattr_init(&attr);
@ -273,7 +273,7 @@ class SyncFiller
{
private:
mutable pthread_mutex_t filler_lock;
bool is_lock_init;
bool is_lock_init = false;
void* filler_buff;
fuse_fill_dir_t filler_func;
std::set<std::string> filled;
@ -290,7 +290,7 @@ class SyncFiller
int SufficiencyFill(const std::vector<std::string>& pathlist);
};
SyncFiller::SyncFiller(void* buff, fuse_fill_dir_t filler) : is_lock_init(false), filler_buff(buff), filler_func(filler)
SyncFiller::SyncFiller(void* buff, fuse_fill_dir_t filler) : filler_buff(buff), filler_func(filler)
{
if(!filler_buff || !filler_func){
S3FS_PRN_CRIT("Internal error: SyncFiller constructor parameter is critical value.");