From 07535ec3ec62768d9886025caa65bcd2444305f3 Mon Sep 17 00:00:00 2001 From: Andrew Gaul Date: Fri, 29 Jul 2022 22:00:07 +0900 Subject: [PATCH] Address clang-tidy warnings (#2010) --- src/s3fs_cred.cpp | 8 +------- src/s3fs_cred.h | 4 ++-- src/threadpoolman.cpp | 3 ++- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/src/s3fs_cred.cpp b/src/s3fs_cred.cpp index 2a94280..2de2bae 100644 --- a/src/s3fs_cred.cpp +++ b/src/s3fs_cred.cpp @@ -99,23 +99,17 @@ bool S3fsCred::ParseIAMRoleFromMetaDataResponse(const char* response, std::strin //------------------------------------------------------------------- S3fsCred::S3fsCred() : is_lock_init(false), - passwd_file(""), aws_profile(DEFAULT_AWS_PROFILE_NAME), load_iamrole(false), - AWSAccessKeyId(""), - AWSSecretAccessKey(""), - AWSAccessToken(""), AWSAccessTokenExpire(0), is_ecs(false), is_use_session_token(false), is_ibm_iam_auth(false), IAM_cred_url("http://169.254.169.254/latest/meta-data/iam/security-credentials/"), IAM_api_version(2), - IAMv2_api_token(""), IAM_field_count(4), IAM_token_field("Token"), - IAM_expiry_field("Expiration"), - IAM_role("") + IAM_expiry_field("Expiration") { pthread_mutexattr_t attr; pthread_mutexattr_init(&attr); diff --git a/src/s3fs_cred.h b/src/s3fs_cred.h index 8ed15c6..8884166 100644 --- a/src/s3fs_cred.h +++ b/src/s3fs_cred.h @@ -119,7 +119,7 @@ class S3fsCred bool ParseS3fsPasswdFile(bucketkvmap_t& resmap); bool ReadS3fsPasswdFile(AutoLock::Type type); - int CheckS3fsCredentialAwsFormat(const kvmap_t& kvmap, std::string& access_key_id, std::string& secret_access_key); + static int CheckS3fsCredentialAwsFormat(const kvmap_t& kvmap, std::string& access_key_id, std::string& secret_access_key); bool ReadAwsCredentialFile(const std::string &filename, AutoLock::Type type); bool InitialS3fsCredentials(); @@ -130,7 +130,7 @@ class S3fsCred bool SetIAMCredentials(const char* response, AutoLock::Type type); bool SetIAMRoleFromMetaData(const char* response, AutoLock::Type type); - bool CheckForbiddenBucketParams(); + static bool CheckForbiddenBucketParams(); public: static bool SetBucket(const char* bucket); diff --git a/src/threadpoolman.cpp b/src/threadpoolman.cpp index db4f47d..bed3826 100644 --- a/src/threadpoolman.cpp +++ b/src/threadpoolman.cpp @@ -216,7 +216,8 @@ bool ThreadPoolMan::StopThreads() thread_list.clear(); // reset semaphore(to zero) - while(thpoolman_sem.try_wait()); + while(thpoolman_sem.try_wait()){ + } // clear instructions for(thpoolman_params_t::const_iterator iter = instruction_list.begin(); iter != instruction_list.end(); ++iter){