mirror of
https://github.com/s3fs-fuse/s3fs-fuse.git
synced 2024-12-22 08:48:55 +00:00
Enable clang-tidy cppcoreguidelines (#2269)
This commit is contained in:
parent
d1272d296a
commit
6823c5a7ec
19
.clang-tidy
19
.clang-tidy
@ -8,7 +8,24 @@ Checks: '
|
||||
-bugprone-macro-parentheses,
|
||||
-bugprone-narrowing-conversions,
|
||||
-bugprone-unhandled-self-assignment,
|
||||
cppcoreguidelines-pro-type-cstyle-cast,
|
||||
cppcoreguidelines-*,
|
||||
-cppcoreguidelines-avoid-c-arrays,
|
||||
-cppcoreguidelines-avoid-do-while,
|
||||
-cppcoreguidelines-avoid-magic-numbers,
|
||||
-cppcoreguidelines-avoid-non-const-global-variables,
|
||||
-cppcoreguidelines-init-variables,
|
||||
-cppcoreguidelines-macro-usage,
|
||||
-cppcoreguidelines-narrowing-conversions,
|
||||
-cppcoreguidelines-no-malloc,
|
||||
-cppcoreguidelines-owning-memory,
|
||||
-cppcoreguidelines-pro-bounds-array-to-pointer-decay,
|
||||
-cppcoreguidelines-pro-bounds-constant-array-index,
|
||||
-cppcoreguidelines-pro-bounds-pointer-arithmetic,
|
||||
-cppcoreguidelines-pro-type-const-cast,
|
||||
-cppcoreguidelines-pro-type-member-init,
|
||||
-cppcoreguidelines-pro-type-reinterpret-cast,
|
||||
-cppcoreguidelines-pro-type-union-access,
|
||||
-cppcoreguidelines-pro-type-vararg,
|
||||
google-*,
|
||||
-google-build-using-namespace,
|
||||
-google-readability-casting,
|
||||
|
10
src/s3fs.cpp
10
src/s3fs.cpp
@ -206,9 +206,15 @@ class MpStatFlag
|
||||
mutable pthread_mutex_t flag_lock;
|
||||
bool is_lock_init;
|
||||
bool has_mp_stat;
|
||||
|
||||
public:
|
||||
MpStatFlag();
|
||||
MpStatFlag(const MpStatFlag&) = delete;
|
||||
MpStatFlag(MpStatFlag&&) = delete;
|
||||
~MpStatFlag();
|
||||
MpStatFlag& operator=(const MpStatFlag&) = delete;
|
||||
MpStatFlag& operator=(MpStatFlag&&) = delete;
|
||||
|
||||
bool Get();
|
||||
bool Set(bool flag);
|
||||
};
|
||||
@ -272,7 +278,11 @@ class SyncFiller
|
||||
|
||||
public:
|
||||
explicit SyncFiller(void* buff = nullptr, fuse_fill_dir_t filler = nullptr);
|
||||
SyncFiller(const SyncFiller&) = delete;
|
||||
SyncFiller(SyncFiller&&) = delete;
|
||||
~SyncFiller();
|
||||
SyncFiller& operator=(const SyncFiller&) = delete;
|
||||
SyncFiller& operator=(SyncFiller&&) = delete;
|
||||
|
||||
int Fill(const char *name, const struct stat *stbuf, off_t off);
|
||||
int SufficiencyFill(const std::vector<std::string>& pathlist);
|
||||
|
@ -40,7 +40,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
const char* filepath = argv[1];
|
||||
off_t size = (off_t)strtoull(argv[2], NULL, 10);
|
||||
off_t size = static_cast<off_t>(strtoull(argv[2], nullptr, 10));
|
||||
int fd;
|
||||
|
||||
// open file
|
||||
|
@ -171,7 +171,7 @@ static bool parse_arguments(int argc, char** argv, strlist_t& files, wbpart_list
|
||||
while(-1 != (opt = getopt(argc, argv, "f:p:"))){
|
||||
switch(opt){
|
||||
case 'f':
|
||||
files.push_back(std::string(optarg));
|
||||
files.emplace_back(optarg);
|
||||
break;
|
||||
case 'p':
|
||||
if(!parse_write_blocks(optarg, wbparts, max_size)){
|
||||
|
Loading…
Reference in New Issue
Block a user