[clang-tools-extra] fe4bf68 - [clang-tidy][NFC] Fix readability-uppercase-literal-suffix findings
Piotr Zegar via cfe-commits
cfe-commits at lists.llvm.org
Sun Aug 27 05:00:00 PDT 2023
Author: Piotr Zegar
Date: 2023-08-27T11:59:02Z
New Revision: fe4bf68c56e14dd474b62227a1aeb347b199bd1e
URL: https://github.com/llvm/llvm-project/commit/fe4bf68c56e14dd474b62227a1aeb347b199bd1e
DIFF: https://github.com/llvm/llvm-project/commit/fe4bf68c56e14dd474b62227a1aeb347b199bd1e.diff
LOG: [clang-tidy][NFC] Fix readability-uppercase-literal-suffix findings
Fix issues found by clang-tidy in clang-tidy source directory.
Added:
Modified:
clang-tools-extra/clang-tidy/abseil/DurationRewriter.cpp
clang-tools-extra/clang-tidy/modernize/MacroToEnumCheck.cpp
clang-tools-extra/clang-tidy/modernize/RawStringLiteralCheck.cpp
clang-tools-extra/clang-tidy/readability/NamespaceCommentCheck.cpp
clang-tools-extra/clang-tidy/utils/ExceptionAnalyzer.h
clang-tools-extra/clang-tidy/utils/ExceptionSpecAnalyzer.h
Removed:
################################################################################
diff --git a/clang-tools-extra/clang-tidy/abseil/DurationRewriter.cpp b/clang-tools-extra/clang-tidy/abseil/DurationRewriter.cpp
index bd317d0d264178..3d807c1d0f7aa2 100644
--- a/clang-tools-extra/clang-tidy/abseil/DurationRewriter.cpp
+++ b/clang-tools-extra/clang-tidy/abseil/DurationRewriter.cpp
@@ -29,7 +29,7 @@ static std::optional<llvm::APSInt>
truncateIfIntegral(const FloatingLiteral &FloatLiteral) {
double Value = FloatLiteral.getValueAsApproximateDouble();
if (std::fmod(Value, 1) == 0) {
- if (Value >= static_cast<double>(1u << 31))
+ if (Value >= static_cast<double>(1U << 31))
return std::nullopt;
return llvm::APSInt::get(static_cast<int64_t>(Value));
diff --git a/clang-tools-extra/clang-tidy/modernize/MacroToEnumCheck.cpp b/clang-tools-extra/clang-tidy/modernize/MacroToEnumCheck.cpp
index cdd1984ab50cf7..b197c22dca410e 100644
--- a/clang-tools-extra/clang-tidy/modernize/MacroToEnumCheck.cpp
+++ b/clang-tools-extra/clang-tidy/modernize/MacroToEnumCheck.cpp
@@ -484,7 +484,7 @@ void MacroToEnumCallbacks::fixEnumMacro(const MacroList &MacroList) const {
Check->diag(Begin, "replace macro with enum")
<< FixItHint::CreateInsertion(Begin, "enum {\n");
- for (size_t I = 0u; I < MacroList.size(); ++I) {
+ for (size_t I = 0U; I < MacroList.size(); ++I) {
const EnumMacro &Macro = MacroList[I];
SourceLocation DefineEnd =
Macro.Directive->getMacroInfo()->getDefinitionLoc();
diff --git a/clang-tools-extra/clang-tidy/modernize/RawStringLiteralCheck.cpp b/clang-tools-extra/clang-tidy/modernize/RawStringLiteralCheck.cpp
index 57e4c4863d3b70..7ec62f41aec019 100644
--- a/clang-tools-extra/clang-tidy/modernize/RawStringLiteralCheck.cpp
+++ b/clang-tools-extra/clang-tidy/modernize/RawStringLiteralCheck.cpp
@@ -105,7 +105,7 @@ RawStringLiteralCheck::RawStringLiteralCheck(StringRef Name,
DisallowedChars.set(C);
// Non-ASCII are disallowed too.
- for (unsigned int C = 0x80u; C <= 0xFFu; ++C)
+ for (unsigned int C = 0x80U; C <= 0xFFU; ++C)
DisallowedChars.set(static_cast<unsigned char>(C));
}
diff --git a/clang-tools-extra/clang-tidy/readability/NamespaceCommentCheck.cpp b/clang-tools-extra/clang-tidy/readability/NamespaceCommentCheck.cpp
index 21e3bd08255d98..68e9dd4998473b 100644
--- a/clang-tools-extra/clang-tidy/readability/NamespaceCommentCheck.cpp
+++ b/clang-tools-extra/clang-tidy/readability/NamespaceCommentCheck.cpp
@@ -27,8 +27,8 @@ NamespaceCommentCheck::NamespaceCommentCheck(StringRef Name,
"^/[/*] *(end (of )?)? *(anonymous|unnamed)? *"
"namespace( +(((inline )|([a-zA-Z0-9_:]))+))?\\.? *(\\*/)?$",
llvm::Regex::IgnoreCase),
- ShortNamespaceLines(Options.get("ShortNamespaceLines", 1u)),
- SpacesBeforeComments(Options.get("SpacesBeforeComments", 1u)) {}
+ ShortNamespaceLines(Options.get("ShortNamespaceLines", 1U)),
+ SpacesBeforeComments(Options.get("SpacesBeforeComments", 1U)) {}
void NamespaceCommentCheck::storeOptions(ClangTidyOptions::OptionMap &Opts) {
Options.store(Opts, "ShortNamespaceLines", ShortNamespaceLines);
diff --git a/clang-tools-extra/clang-tidy/utils/ExceptionAnalyzer.h b/clang-tools-extra/clang-tidy/utils/ExceptionAnalyzer.h
index 78da016a0fb45f..0a8cf8668d3ca9 100644
--- a/clang-tools-extra/clang-tidy/utils/ExceptionAnalyzer.h
+++ b/clang-tools-extra/clang-tidy/utils/ExceptionAnalyzer.h
@@ -141,7 +141,7 @@ class ExceptionAnalyzer {
bool IgnoreBadAlloc = true;
llvm::StringSet<> IgnoredExceptions;
- llvm::DenseMap<const FunctionDecl *, ExceptionInfo> FunctionCache{32u};
+ llvm::DenseMap<const FunctionDecl *, ExceptionInfo> FunctionCache{32U};
};
} // namespace clang::tidy::utils
diff --git a/clang-tools-extra/clang-tidy/utils/ExceptionSpecAnalyzer.h b/clang-tools-extra/clang-tidy/utils/ExceptionSpecAnalyzer.h
index cf876599469387..ddfb796d9c5460 100644
--- a/clang-tools-extra/clang-tidy/utils/ExceptionSpecAnalyzer.h
+++ b/clang-tools-extra/clang-tidy/utils/ExceptionSpecAnalyzer.h
@@ -81,7 +81,7 @@ class ExceptionSpecAnalyzer {
static DefaultableMemberKind
getDefaultableMemberKind(const FunctionDecl *FuncDecl);
- llvm::DenseMap<const FunctionDecl *, State> FunctionCache{32u};
+ llvm::DenseMap<const FunctionDecl *, State> FunctionCache{32U};
};
} // namespace clang::tidy::utils
More information about the cfe-commits
mailing list