Skip to content

Commit

Permalink
Address clang-tidy 17 warnings (s3fs-fuse#2362)
Browse files Browse the repository at this point in the history
  • Loading branch information
gaul authored Nov 12, 2023
1 parent 807ec1f commit 0cd73e4
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ Checks: '
-google-runtime-references,
misc-*,
-misc-const-correctness,
-misc-include-cleaner,
-misc-no-recursion,
-misc-redundant-expression,
-misc-unused-parameters,
Expand All @@ -52,6 +53,7 @@ Checks: '
-modernize-use-trailing-return-type,
-modernize-use-using,
performance-*,
-performance-avoid-endl,
-performance-no-int-to-ptr,
portability-*,
readability-*,
Expand Down
5 changes: 4 additions & 1 deletion src/curl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
10 changes: 5 additions & 5 deletions src/s3fs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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);
Expand Down Expand Up @@ -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;
Expand All @@ -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.");
Expand Down

0 comments on commit 0cd73e4

Please sign in to comment.