[clang-tools-extra] e47a224 - [clang-tidy] Use nullptr instead of 0 or NULL (NFC)

Kazu Hirata via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 31 13:54:44 PST 2021


Author: Kazu Hirata
Date: 2021-12-31T13:54:34-08:00
New Revision: e47a224ccfbbfd61f31136db53768dabbb85e563

URL: https://github.com/llvm/llvm-project/commit/e47a224ccfbbfd61f31136db53768dabbb85e563
DIFF: https://github.com/llvm/llvm-project/commit/e47a224ccfbbfd61f31136db53768dabbb85e563.diff

LOG: [clang-tidy] Use nullptr instead of 0 or NULL (NFC)

Identified with modernize-use-nullptr.

Added: 
    

Modified: 
    clang-tools-extra/clang-tidy/bugprone/NotNullTerminatedResultCheck.cpp
    clang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.cpp

Removed: 
    


################################################################################
diff  --git a/clang-tools-extra/clang-tidy/bugprone/NotNullTerminatedResultCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/NotNullTerminatedResultCheck.cpp
index 36d83b2a3ea31..200528b1c061d 100644
--- a/clang-tools-extra/clang-tidy/bugprone/NotNullTerminatedResultCheck.cpp
+++ b/clang-tools-extra/clang-tidy/bugprone/NotNullTerminatedResultCheck.cpp
@@ -144,7 +144,7 @@ static StringRef exprToStr(const Expr *E,
 
   return Lexer::getSourceText(
       CharSourceRange::getTokenRange(E->getSourceRange()),
-      *Result.SourceManager, Result.Context->getLangOpts(), 0);
+      *Result.SourceManager, Result.Context->getLangOpts(), nullptr);
 }
 
 // Returns the proper token based end location of \p E.
@@ -477,7 +477,7 @@ static void insertNullTerminatorExpr(StringRef Name,
       FunctionExpr->getBeginLoc());
   StringRef SpaceBeforeStmtStr = Lexer::getSourceText(
       CharSourceRange::getCharRange(SpaceRange), *Result.SourceManager,
-      Result.Context->getLangOpts(), 0);
+      Result.Context->getLangOpts(), nullptr);
 
   SmallString<128> NewAddNullTermExprStr;
   NewAddNullTermExprStr =

diff  --git a/clang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.cpp b/clang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.cpp
index cfbe79c525942..8cede1b2c17b5 100644
--- a/clang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.cpp
+++ b/clang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.cpp
@@ -1404,8 +1404,8 @@ IdentifierNamingCheck::getMacroFailureInfo(const Token &MacroNameTok,
   if (!Style.isActive())
     return llvm::None;
 
-  return getFailureInfo("", MacroNameTok.getIdentifierInfo()->getName(), NULL,
-                        Loc, Style.getStyles(), Style.getHNOption(),
+  return getFailureInfo("", MacroNameTok.getIdentifierInfo()->getName(),
+                        nullptr, Loc, Style.getStyles(), Style.getHNOption(),
                         SK_MacroDefinition, SM, IgnoreFailedSplit);
 }
 


        


More information about the cfe-commits mailing list