[vm] Update NULL to nullptr in runtime/lib.

TEST=build
Change-Id: I883dd0516519b175eb15b530776499248a3e0759
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/292061
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
This commit is contained in:
Ryan Macnak 2023-03-30 19:28:28 +00:00 committed by Commit Queue
parent 25548a912f
commit 4176d8a02c
12 changed files with 22 additions and 22 deletions

View file

@ -15,7 +15,7 @@ DEFINE_NATIVE_ENTRY(AsyncStarMoveNext_debuggerStepCheck, 0, 1) {
#if !defined(PRODUCT)
GET_NON_NULL_NATIVE_ARGUMENT(Closure, async_op, arguments->NativeArgAt(0));
Debugger* debugger = isolate->debugger();
if (debugger != NULL) {
if (debugger != nullptr) {
debugger->MaybeAsyncStepInto(async_op);
}
#endif

View file

@ -30,7 +30,7 @@ static ScriptPtr FindScript(DartFrameIterator* iterator) {
Class::Handle(Library::LookupCoreClass(Symbols::AssertionError()));
ASSERT(!assert_error_class.IsNull());
bool hit_assertion_error = false;
for (; stack_frame != NULL; stack_frame = iterator->NextFrame()) {
for (; stack_frame != nullptr; stack_frame = iterator->NextFrame()) {
code = stack_frame->LookupDartCode();
if (code.is_optimized()) {
InlinedFunctionsIterator inlined_iterator(code, stack_frame->pc());

View file

@ -166,8 +166,8 @@ static IntegerPtr ParseInteger(const String& value) {
const intptr_t len = value.Length();
if (len > 0) {
const char* cstr = value.ToCString();
ASSERT(cstr != NULL);
char* p_end = NULL;
ASSERT(cstr != nullptr);
char* p_end = nullptr;
const int64_t int_value = strtoll(cstr, &p_end, 10);
if (p_end == (cstr + len)) {
if ((int_value != LLONG_MIN) && (int_value != LLONG_MAX)) {

View file

@ -579,7 +579,7 @@ ObjectPtr IsolateSpawnState::ResolveFunction() {
}
static ObjectPtr DeserializeMessage(Thread* thread, Message* message) {
if (message == NULL) {
if (message == nullptr) {
return Object::null();
}
if (message->IsRaw()) {
@ -936,9 +936,9 @@ DEFINE_NATIVE_ENTRY(Isolate_spawnFunction, 0, 10) {
/*same_group=*/true, message, ILLEGAL_PORT, Message::kNormalPriority));
const char* utf8_package_config =
packageConfig.IsNull() ? NULL : String2UTF8(packageConfig);
packageConfig.IsNull() ? nullptr : String2UTF8(packageConfig);
const char* utf8_debug_name =
debugName.IsNull() ? NULL : String2UTF8(debugName);
debugName.IsNull() ? nullptr : String2UTF8(debugName);
if (closure_tuple_handle != nullptr && utf8_debug_name == nullptr) {
const auto& closure_function = Function::Handle(zone, closure.function());
utf8_debug_name =
@ -963,7 +963,7 @@ static const char* CanonicalizeUri(Thread* thread,
const Library& library,
const String& uri,
char** error) {
const char* result = NULL;
const char* result = nullptr;
Zone* zone = thread->zone();
auto isolate_group = thread->isolate_group();
if (isolate_group->HasTagHandler()) {
@ -1024,17 +1024,17 @@ DEFINE_NATIVE_ENTRY(Isolate_spawnUri, 0, 12) {
// Canonicalize the uri with respect to the current isolate.
const Library& root_lib =
Library::Handle(isolate->group()->object_store()->root_library());
char* error = NULL;
char* error = nullptr;
const char* canonical_uri = CanonicalizeUri(thread, root_lib, uri, &error);
if (canonical_uri == NULL) {
if (canonical_uri == nullptr) {
const String& msg = String::Handle(String::New(error));
ThrowIsolateSpawnException(msg);
}
const char* utf8_package_config =
packageConfig.IsNull() ? NULL : String2UTF8(packageConfig);
packageConfig.IsNull() ? nullptr : String2UTF8(packageConfig);
const char* utf8_debug_name =
debugName.IsNull() ? NULL : String2UTF8(debugName);
debugName.IsNull() ? nullptr : String2UTF8(debugName);
std::unique_ptr<IsolateSpawnState> state(new IsolateSpawnState(
port.Id(), canonical_uri, utf8_package_config, &arguments_buffer,

View file

@ -12,5 +12,5 @@
const char* {{VAR_NAME}}[] = {
{{LIBRARY_SOURCE_MAP}}
{{PART_SOURCE_MAP}}
NULL, NULL, NULL
nullptr, nullptr, nullptr
};

View file

@ -35,7 +35,7 @@ DEFINE_NATIVE_ENTRY(SecureRandom_getBytes, 0, 1) {
ASSERT((n > 0) && (n <= 8));
uint8_t buffer[8];
Dart_EntropySource entropy_source = Dart::entropy_source_callback();
if ((entropy_source == NULL) || !entropy_source(buffer, n)) {
if ((entropy_source == nullptr) || !entropy_source(buffer, n)) {
const String& error = String::Handle(String::New(
"No source of cryptographically secure random numbers available."));
const Array& args = Array::Handle(Array::New(1));

View file

@ -1417,7 +1417,7 @@ DEFINE_NATIVE_ENTRY(ClassMirror_invokeConstructor, 0, 5) {
ArgumentsDescriptor::NewBoxed(kTypeArgsLen, args.Length(), arg_names));
ArgumentsDescriptor args_descriptor(args_descriptor_array);
if (!lookup_constructor.AreValidArguments(args_descriptor, NULL)) {
if (!lookup_constructor.AreValidArguments(args_descriptor, nullptr)) {
external_constructor_name = lookup_constructor.name();
ThrowNoSuchMethod(AbstractType::Handle(klass.RareType()),
external_constructor_name, explicit_args, arg_names,

View file

@ -560,7 +560,7 @@ DEFINE_NATIVE_ENTRY(Internal_boundsCheckForPartialInstantiation, 0, 2) {
DartFrameIterator iterator(Thread::Current(),
StackFrameIterator::kNoCrossThreadIteration);
StackFrame* caller_frame = iterator.NextFrame();
ASSERT(caller_frame != NULL);
ASSERT(caller_frame != nullptr);
location = caller_frame->GetTokenPos();
}
const auto& parameter_name = String::Handle(zone, type_params.NameAt(i));

View file

@ -67,9 +67,9 @@ static void AppendFrames(const GrowableObjectArray& code_list,
StackFrameIterator frames(ValidationPolicy::kDontValidateFrames, thread,
StackFrameIterator::kNoCrossThreadIteration);
StackFrame* frame = frames.NextFrame();
ASSERT(frame != NULL); // We expect to find a dart invocation frame.
ASSERT(frame != nullptr); // We expect to find a dart invocation frame.
Code& code = Code::Handle(zone);
for (; frame != NULL; frame = frames.NextFrame()) {
for (; frame != nullptr; frame = frames.NextFrame()) {
if (!frame->IsDartFrame()) {
continue;
}

View file

@ -44,7 +44,7 @@ DEFINE_NATIVE_ENTRY(StringBase_createFromCodePoints, 0, 3) {
length = a.Length();
} else {
Exceptions::ThrowArgumentError(list);
return NULL; // Unreachable.
return nullptr; // Unreachable.
}
intptr_t start = start_obj.Value();

View file

@ -44,12 +44,12 @@ DEFINE_NATIVE_ENTRY(Timeline_reportTaskEvent, 0, 4) {
GET_NON_NULL_NATIVE_ARGUMENT(String, args, arguments->NativeArgAt(3));
TimelineEventRecorder* recorder = Timeline::recorder();
if (recorder == NULL) {
if (recorder == nullptr) {
return Object::null();
}
TimelineEvent* event = Timeline::GetDartStream()->StartEvent();
if (event == NULL) {
if (event == nullptr) {
// Stream was turned off.
return Object::null();
}

View file

@ -120,7 +120,7 @@ DEFINE_NATIVE_ENTRY(VMService_OnServerAddressChange, 0, 1) {
#ifndef PRODUCT
GET_NATIVE_ARGUMENT(String, address, arguments->NativeArgAt(0));
if (address.IsNull()) {
ServiceIsolate::SetServerAddress(NULL);
ServiceIsolate::SetServerAddress(nullptr);
} else {
ServiceIsolate::SetServerAddress(address.ToCString());
}