Enable modernize-use-nullptr clang tidy rule

Summary:
changelog: [internal]

You can read more about this rule on https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-nullptr.html

Reviewed By: rubennorte

Differential Revision: D33296118

fbshipit-source-id: ba9de4611c0f0459db9cea56722385e2541b155e
This commit is contained in:
Samuel Susla
2021-12-23 10:21:09 -08:00
committed by Facebook GitHub Bot
parent bf9872a7b5
commit d8d4e95697
3 changed files with 6 additions and 3 deletions
+1
View File
@@ -21,5 +21,6 @@ modernize-unary-static-assert,
modernize-use-emplace,
modernize-shrink-to-fit,
modernize-use-equals-default,
modernize-use-nullptr,
'
...
@@ -33,7 +33,7 @@ static int FabricDefaultYogaLog(
va_copy(args_copy, args);
// Adding 1 to add space for terminating null character.
int size_s = vsnprintf(NULL, 0, format, args);
int size_s = vsnprintf(nullptr, 0, format, args);
auto size = static_cast<size_t>(size_s);
std::vector<char> buffer(size);
@@ -219,7 +219,8 @@ TextMeasurement TextLayoutManager::doMeasure(
maximumSize.height,
attachmentPositions);
jfloat *attachmentData = env->GetFloatArrayElements(attachmentPositions, 0);
jfloat *attachmentData =
env->GetFloatArrayElements(attachmentPositions, nullptr);
auto attachments = TextMeasurement::Attachments{};
if (attachmentsCount > 0) {
@@ -283,7 +284,8 @@ TextMeasurement TextLayoutManager::doMeasureMapBuffer(
maximumSize.height,
attachmentPositions);
jfloat *attachmentData = env->GetFloatArrayElements(attachmentPositions, 0);
jfloat *attachmentData =
env->GetFloatArrayElements(attachmentPositions, nullptr);
auto attachments = TextMeasurement::Attachments{};
if (attachmentsCount > 0) {