Enable clang-tidy narrowing conversions (#2564)
This commit is contained in:
@ -24,7 +24,6 @@ Checks: '
|
||||
-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,
|
||||
@ -80,5 +79,6 @@ Checks: '
|
||||
-readability-simplify-boolean-expr,
|
||||
-readability-suspicious-call-argument'
|
||||
CheckOptions:
|
||||
cppcoreguidelines-narrowing-conversions.WarnOnEquivalentBitWidth: 'false'
|
||||
readability-implicit-bool-conversion.AllowIntegerConditions: 'true'
|
||||
readability-implicit-bool-conversion.AllowPointerConditions: 'true'
|
||||
|
||||
@ -161,9 +161,9 @@ int S3fsMultiCurl::MultiPerform()
|
||||
for(const auto &thread_id : completed_tids){
|
||||
auto it = threads.find(thread_id);
|
||||
it->second.first.join();
|
||||
long int int_retval = it->second.second.get();
|
||||
auto int_retval = it->second.second.get();
|
||||
if (int_retval && !(int_retval == -ENOENT && isMultiHead)) {
|
||||
S3FS_PRN_WARN("thread terminated with non-zero return code: %ld", int_retval);
|
||||
S3FS_PRN_WARN("thread terminated with non-zero return code: %d", int_retval);
|
||||
result = int_retval;
|
||||
}
|
||||
threads.erase(it);
|
||||
|
||||
@ -99,7 +99,7 @@ std::string lower(std::string s)
|
||||
{
|
||||
// change each character of the std::string to lower case
|
||||
for(size_t i = 0; i < s.length(); i++){
|
||||
s[i] = tolower(s[i]);
|
||||
s[i] = static_cast<char>(tolower(s[i]));
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
@ -130,7 +130,7 @@ void test_wtf8_encoding()
|
||||
std::string utf8("Hyld\xc3\xbdpi \xc3\xbej\xc3\xb3\xc3\xb0""f\xc3\xa9lagsins vex \xc3\xbar k\xc3\xa6rkomnu b\xc3\xb6li \xc3\xad \xc3\xa1st");
|
||||
std::string cp1252("Hyld\xfdpi \xfej\xf3\xf0""f\xe9lagsins vex \xfar k\xe6rkomnu b\xf6li \xed \xe1st");
|
||||
std::string broken = utf8;
|
||||
broken[14] = 0x97;
|
||||
broken[14] = '\x97';
|
||||
std::string mixed = ascii + utf8 + cp1252;
|
||||
|
||||
ASSERT_EQUALS(s3fs_wtf8_encode(ascii), ascii);
|
||||
|
||||
Reference in New Issue
Block a user