You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-23 15:16:17 +00:00
Replace NULL with nullptr
This commit is contained in:
@@ -233,8 +233,8 @@ bool Variant::can_convert(Variant::Type p_type_from, Variant::Type p_type_to) {
|
||||
return (p_type_to == OBJECT);
|
||||
};
|
||||
|
||||
const Type *valid_types = NULL;
|
||||
const Type *invalid_types = NULL;
|
||||
const Type *valid_types = nullptr;
|
||||
const Type *invalid_types = nullptr;
|
||||
|
||||
switch (p_type_to) {
|
||||
case BOOL: {
|
||||
@@ -570,7 +570,7 @@ bool Variant::can_convert_strict(Variant::Type p_type_from, Variant::Type p_type
|
||||
return (p_type_to == OBJECT);
|
||||
};
|
||||
|
||||
const Type *valid_types = NULL;
|
||||
const Type *valid_types = nullptr;
|
||||
|
||||
switch (p_type_to) {
|
||||
case BOOL: {
|
||||
@@ -1020,7 +1020,7 @@ bool Variant::is_zero() const {
|
||||
} break;
|
||||
case OBJECT: {
|
||||
|
||||
return _get_obj().obj == NULL;
|
||||
return _get_obj().obj == nullptr;
|
||||
} break;
|
||||
case CALLABLE: {
|
||||
|
||||
@@ -1479,7 +1479,7 @@ void Variant::clear() {
|
||||
memdelete(reference);
|
||||
}
|
||||
}
|
||||
_get_obj().obj = NULL;
|
||||
_get_obj().obj = nullptr;
|
||||
_get_obj().id = ObjectID();
|
||||
} break;
|
||||
case _RID: {
|
||||
@@ -1864,7 +1864,7 @@ String Variant::stringify(List<const void *> &stack) const {
|
||||
|
||||
stack.push_back(d.id());
|
||||
|
||||
//const String *K=NULL;
|
||||
//const String *K=nullptr;
|
||||
String str("{");
|
||||
List<Variant> keys;
|
||||
d.get_key_list(&keys);
|
||||
@@ -2227,7 +2227,7 @@ Variant::operator RID() const {
|
||||
};
|
||||
#endif
|
||||
Callable::CallError ce;
|
||||
Variant ret = _get_obj().obj->call(CoreStringNames::get_singleton()->get_rid, NULL, 0, ce);
|
||||
Variant ret = _get_obj().obj->call(CoreStringNames::get_singleton()->get_rid, nullptr, 0, ce);
|
||||
if (ce.error == Callable::CallError::CALL_OK && ret.get_type() == Variant::_RID) {
|
||||
return ret;
|
||||
}
|
||||
@@ -2242,7 +2242,7 @@ Variant::operator Object *() const {
|
||||
if (type == OBJECT)
|
||||
return _get_obj().obj;
|
||||
else
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Object *Variant::get_validated_object_with_check(bool &r_previously_freed) const {
|
||||
@@ -2252,7 +2252,7 @@ Object *Variant::get_validated_object_with_check(bool &r_previously_freed) const
|
||||
return instance;
|
||||
} else {
|
||||
r_previously_freed = false;
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2260,7 +2260,7 @@ Object *Variant::get_validated_object() const {
|
||||
if (type == OBJECT)
|
||||
return ObjectDB::get_instance(_get_obj().id);
|
||||
else
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Variant::operator Node *() const {
|
||||
@@ -2268,14 +2268,14 @@ Variant::operator Node *() const {
|
||||
if (type == OBJECT)
|
||||
return Object::cast_to<Node>(_get_obj().obj);
|
||||
else
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
Variant::operator Control *() const {
|
||||
|
||||
if (type == OBJECT)
|
||||
return Object::cast_to<Control>(_get_obj().obj);
|
||||
else
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Variant::operator Dictionary() const {
|
||||
|
||||
Reference in New Issue
Block a user