[2/N] Fix clang-tidy readability checks (#164652)

This PR applies clang-tidy readability checks to jit sources and all headers in the code base.
`readability-redundant-inline-specifier` is suppressed because it incurs too many changes. `readability-redundant-inline-specifier` is used to detect redundant inline specifiers on function and variable declarations. There are many in-class method definitions that are marked inline.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/164652
Approved by: https://github.com/Skylion007
This commit is contained in:
Yuanyuan Chen
2025-10-05 07:05:08 +00:00
committed by PyTorch MergeBot
parent 5178d0a480
commit 3c5ca685d6
89 changed files with 142 additions and 199 deletions

View File

@ -1710,7 +1710,7 @@ int64_t stringFindImpl(
bool reverse = false) {
int64_t size = string.size();
if (start < 0) {
start = std::max(int64_t(0), int64_t(size + start));
start = std::max(int64_t(0), size + start);
}
if (end < 0) {
end = std::max(int64_t(0), int64_t(size + end + 1));
@ -1964,7 +1964,7 @@ static const std::vector<OperatorGeneratorArgs> stringOpGenArgs{
return;
}
if (start < 0) {
start = std::max(int64_t(0), int64_t(size + start));
start = std::max(int64_t(0), size + start);
}
if (end < 0) {
end = std::max(int64_t(0), int64_t(size + end + 1));
@ -1993,7 +1993,7 @@ static const std::vector<OperatorGeneratorArgs> stringOpGenArgs{
std::string string = pop(stack).toStringRef();
int64_t size = string.size();
if (start < 0) {
start = std::max(int64_t(0), int64_t(size + start));
start = std::max(int64_t(0), (size + start));
}
if (end < 0) {
end = std::max(int64_t(0), int64_t(size + end + 1));
@ -2019,7 +2019,7 @@ static const std::vector<OperatorGeneratorArgs> stringOpGenArgs{
std::string string = pop(stack).toStringRef();
int64_t size = string.size();
if (start < 0) {
start = std::max(int64_t(0), int64_t(size + start));
start = std::max(int64_t(0), (size + start));
}
if (end < 0) {
end = std::max(int64_t(0), int64_t(size + end + 1));