Skip to content

Commit

Permalink
[clang-tidy][NFC] Fix readability-uppercase-literal-suffix 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 fc2a9ad commit fe4bf68
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion clang-tools-extra/clang-tidy/abseil/DurationRewriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion clang-tools-extra/clang-tidy/utils/ExceptionAnalyzer.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion clang-tools-extra/clang-tidy/utils/ExceptionSpecAnalyzer.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit fe4bf68

Please sign in to comment.