Address warnings from clang-tidy 11 (#1470)

This commit is contained in:
Andrew Gaul 2020-11-09 21:15:20 +09:00 committed by GitHub
parent d96a08d4ad
commit 543231c9f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 10 additions and 8 deletions

View File

@ -3,6 +3,7 @@ Checks: '
bugprone-*,
-bugprone-branch-clone,
-bugprone-macro-parentheses,
-bugprone-unhandled-self-assignment,
google-*,
-google-build-using-namespace,
-google-readability-casting,
@ -11,6 +12,7 @@ Checks: '
-google-runtime-int,
-google-runtime-references,
misc-*,
-misc-no-recursion,
-misc-redundant-expression,
-misc-unused-parameters,
modernize-*,
@ -22,11 +24,13 @@ Checks: '
-modernize-use-trailing-return-type,
-modernize-use-using,
performance-*,
-performance-inefficient-string-concatenation,
portability-*,
readability-*,
-readability-else-after-return,
-readability-function-size,
-readability-implicit-bool-conversion,
-readability-inconsistent-declaration-parameter-name,
-readability-isolate-declaration,
-readability-magic-numbers,
-readability-named-parameter,

View File

@ -1854,10 +1854,10 @@ int S3fsCurl::RawCurlDebugFunc(CURL* hcurl, curl_infotype type, char* data, size
// Methods for S3fsCurl
//-------------------------------------------------------------------
S3fsCurl::S3fsCurl(bool ahbe) :
hCurl(NULL), type(REQTYPE_UNSET), path(""), base_path(""), saved_path(""), url(""), requestHeaders(NULL),
hCurl(NULL), type(REQTYPE_UNSET), requestHeaders(NULL),
LastResponseCode(S3FSCURL_RESPONSECODE_NOTSET), postdata(NULL), postdata_remaining(0), is_use_ahbe(ahbe),
retry_count(0), b_infile(NULL), b_postdata(NULL), b_postdata_remaining(0), b_partdata_startpos(0), b_partdata_size(0),
b_ssekey_pos(-1), b_ssevalue(""), b_ssetype(sse_type_t::SSE_DISABLE), op(""), query_string(""),
b_ssekey_pos(-1), b_ssetype(sse_type_t::SSE_DISABLE),
sem(NULL), completed_tids_lock(NULL), completed_tids(NULL), fpLazySetup(NULL)
{
}

View File

@ -95,8 +95,8 @@ ino_t FdEntity::GetInode(int fd)
//------------------------------------------------
FdEntity::FdEntity(const char* tpath, const char* cpath) :
is_lock_init(false), refcnt(0), path(SAFESTRPTR(tpath)),
fd(-1), pfile(NULL), inode(0), size_orgmeta(0), upload_id(""), mp_start(0), mp_size(0),
cachepath(SAFESTRPTR(cpath)), mirrorpath(""), is_meta_pending(false), holding_mtime(-1)
fd(-1), pfile(NULL), inode(0), size_orgmeta(0), mp_start(0), mp_size(0),
cachepath(SAFESTRPTR(cpath)), is_meta_pending(false), holding_mtime(-1)
{
pthread_mutexattr_t attr;
pthread_mutexattr_init(&attr);

View File

@ -163,7 +163,7 @@ bool CacheFileStat::RenameCacheFileStat(const char* oldpath, const char* newpath
//------------------------------------------------
// CacheFileStat methods
//------------------------------------------------
CacheFileStat::CacheFileStat(const char* tpath) : path(""), fd(-1)
CacheFileStat::CacheFileStat(const char* tpath) : fd(-1)
{
if(tpath && '\0' != tpath[0]){
SetPath(tpath, true);

View File

@ -180,9 +180,7 @@ bool S3fsLog::LowSetLogfile(const char* pfile)
fclose(newfp);
return false;
}
if(S3fsLog::plogfile){
delete S3fsLog::plogfile;
}
S3fsLog::plogfile = new std::string(pfile);
}
return true;