Skip to content

Commit

Permalink
[clang-tidy][NFC] Fix readability-make-member-function-const findings
Browse files Browse the repository at this point in the history
Fix issues found by clang-tidy in clang-tidy source directory.
  • Loading branch information
PiotrZSL committed Aug 27, 2023
1 parent ec5f4be commit 24a7587
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ void StructPackAlignCheck::registerMatchers(MatchFinder *Finder) {
}

CharUnits
StructPackAlignCheck::computeRecommendedAlignment(CharUnits MinByteSize) {
StructPackAlignCheck::computeRecommendedAlignment(CharUnits MinByteSize) const {
CharUnits NewAlign = CharUnits::fromQuantity(1);
if (!MinByteSize.isPowerOfTwo()) {
int MSB = (int)MinByteSize.getQuantity();
Expand Down
2 changes: 1 addition & 1 deletion clang-tools-extra/clang-tidy/altera/StructPackAlignCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class StructPackAlignCheck : public ClangTidyCheck {

private:
const unsigned MaxConfiguredAlignment;
CharUnits computeRecommendedAlignment(CharUnits MinByteSize);
CharUnits computeRecommendedAlignment(CharUnits MinByteSize) const;
};

} // namespace clang::tidy::altera
Expand Down
2 changes: 1 addition & 1 deletion clang-tools-extra/clang-tidy/altera/UnrollLoopsCheck.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ bool UnrollLoopsCheck::extractValue(int &Value, const BinaryOperator *Op,
}

bool UnrollLoopsCheck::exprHasLargeNumIterations(const Expr *Expression,
const ASTContext *Context) {
const ASTContext *Context) const {
Expr::EvalResult Result;
if (Expression->EvaluateAsRValue(Result, *Context)) {
if (!Result.Val.isInt())
Expand Down
2 changes: 1 addition & 1 deletion clang-tools-extra/clang-tidy/altera/UnrollLoopsCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class UnrollLoopsCheck : public ClangTidyCheck {
/// bound on the number of loops is greater than max_loop_iterations or not.
/// If the expression is not evaluatable or not an integer, returns false.
bool exprHasLargeNumIterations(const Expr *Expression,
const ASTContext *Context);
const ASTContext *Context) const;
/// Returns the type of unrolling, if any, associated with the given
/// statement.
enum UnrollType unrollType(const Stmt *Statement, ASTContext *Context);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -939,7 +939,7 @@ void NotNullTerminatedResultCheck::memchrFix(

void NotNullTerminatedResultCheck::memmoveFix(
StringRef Name, const MatchFinder::MatchResult &Result,
DiagnosticBuilder &Diag) {
DiagnosticBuilder &Diag) const {
bool IsOverflows = isDestCapacityFix(Result, Diag);

if (UseSafeFunctions && isKnownDest(Result)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class NotNullTerminatedResultCheck : public ClangTidyCheck {
const ast_matchers::MatchFinder::MatchResult &Result);
void memmoveFix(StringRef Name,
const ast_matchers::MatchFinder::MatchResult &Result,
DiagnosticBuilder &Diag);
DiagnosticBuilder &Diag) const;
void strerror_sFix(const ast_matchers::MatchFinder::MatchResult &Result);
void ncmpFix(StringRef Name,
const ast_matchers::MatchFinder::MatchResult &Result);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class SpecialMemberFunctionsCheck : public ClangTidyCheck {
SpecialMemberFunctionKind FunctionKind;
bool IsDeleted;

bool operator==(const SpecialMemberFunctionData &Other) {
bool operator==(const SpecialMemberFunctionData &Other) const {
return (Other.FunctionKind == FunctionKind) &&
(Other.IsDeleted == IsDeleted);
}
Expand Down

0 comments on commit 24a7587

Please sign in to comment.