Style: Replaces uses of 0/NULL by nullptr (C++11)

Using clang-tidy's `modernize-use-nullptr`.
https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-nullptr.html
This commit is contained in:
Rémi Verschelde
2021-05-04 16:00:45 +02:00
parent 2b429b24b5
commit a828398655
633 changed files with 4454 additions and 4410 deletions

View File

@@ -68,7 +68,7 @@ Size2 EditorProperty::get_minimum_size() const {
ms.width += check->get_width() + get_constant("hseparation", "CheckBox") + get_constant("hseparator", "Tree");
}
if (bottom_editor != NULL && bottom_editor->is_visible()) {
if (bottom_editor != nullptr && bottom_editor->is_visible()) {
ms.height += get_constant("vseparation");
Size2 bems = bottom_editor->get_combined_minimum_size();
//bems.width += get_constant("item_margin", "Tree");
@@ -820,7 +820,7 @@ void EditorProperty::_bind_methods() {
EditorProperty::EditorProperty() {
draw_top_bg = true;
object = NULL;
object = nullptr;
split_ratio = 0.5;
selectable = true;
text_size = 0;
@@ -837,8 +837,8 @@ EditorProperty::EditorProperty() {
property_usage = 0;
selected = false;
selected_focusable = -1;
label_reference = NULL;
bottom_editor = NULL;
label_reference = nullptr;
bottom_editor = nullptr;
}
////////////////////////////////////////////////
////////////////////////////////////////////////
@@ -850,7 +850,7 @@ void EditorInspectorPlugin::add_custom_control(Control *control) {
}
void EditorInspectorPlugin::add_property_editor(const String &p_for_property, Control *p_prop) {
ERR_FAIL_COND(Object::cast_to<EditorProperty>(p_prop) == NULL);
ERR_FAIL_COND(Object::cast_to<EditorProperty>(p_prop) == nullptr);
AddedEditor ae;
ae.properties.push_back(p_for_property);
@@ -1195,7 +1195,7 @@ void EditorInspectorSection::_bind_methods() {
}
EditorInspectorSection::EditorInspectorSection() {
object = NULL;
object = nullptr;
foldable = false;
vbox = memnew(VBoxContainer);
vbox_added = false;
@@ -1231,7 +1231,7 @@ EditorProperty *EditorInspector::instantiate_property_editor(Object *p_object, V
}
}
}
return NULL;
return nullptr;
}
void EditorInspector::add_inspector_plugin(const Ref<EditorInspectorPlugin> &p_plugin) {
@@ -1402,7 +1402,7 @@ void EditorInspector::update_tree() {
String filter = search_box ? search_box->get_text() : "";
String group;
String group_base;
VBoxContainer *category_vbox = NULL;
VBoxContainer *category_vbox = nullptr;
List<PropertyInfo>
plist;
@@ -1456,7 +1456,7 @@ void EditorInspector::update_tree() {
EditorInspectorCategory *category = memnew(EditorInspectorCategory);
main_vbox->add_child(category);
category_vbox = NULL; //reset
category_vbox = nullptr; //reset
String type = p.name;
category->icon = EditorNode::get_singleton()->get_class_icon(type, "Object");
@@ -1540,7 +1540,7 @@ void EditorInspector::update_tree() {
continue;
}
if (category_vbox == NULL) {
if (category_vbox == nullptr) {
category_vbox = memnew(VBoxContainer);
main_vbox->add_child(category_vbox);
}
@@ -1577,7 +1577,7 @@ void EditorInspector::update_tree() {
if (current_vbox == main_vbox) {
//do not add directly to the main vbox, given it has no spacing
if (category_vbox == NULL) {
if (category_vbox == nullptr) {
category_vbox = memnew(VBoxContainer);
}
current_vbox = category_vbox;
@@ -2049,7 +2049,7 @@ void EditorInspector::_property_checked(const String &p_path, bool p_checked) {
for (List<PropertyInfo>::Element *E = pinfo.front(); E; E = E->next()) {
if (E->get().name == p_path) {
Variant::CallError ce;
to_create = Variant::construct(E->get().type, NULL, 0, ce);
to_create = Variant::construct(E->get().type, nullptr, 0, ce);
break;
}
}
@@ -2094,7 +2094,7 @@ void EditorInspector::_resource_selected(const String &p_path, RES p_resource) {
void EditorInspector::_node_removed(Node *p_node) {
if (p_node == object) {
edit(NULL);
edit(nullptr);
}
}
@@ -2110,13 +2110,13 @@ void EditorInspector::_notification(int p_what) {
}
}
if (p_what == NOTIFICATION_PREDELETE) {
edit(NULL); //just in case
edit(nullptr); //just in case
}
if (p_what == NOTIFICATION_EXIT_TREE) {
if (!sub_inspector) {
get_tree()->disconnect("node_removed", this, "_node_removed");
}
edit(NULL);
edit(nullptr);
}
if (p_what == NOTIFICATION_PROCESS) {
@@ -2229,8 +2229,8 @@ void EditorInspector::_bind_methods() {
}
EditorInspector::EditorInspector() {
object = NULL;
undo_redo = NULL;
object = nullptr;
undo_redo = nullptr;
main_vbox = memnew(VBoxContainer);
main_vbox->set_h_size_flags(SIZE_EXPAND_FILL);
main_vbox->add_constant_override("separation", 0);
@@ -2250,7 +2250,7 @@ EditorInspector::EditorInspector() {
update_tree_pending = false;
refresh_countdown = 0;
read_only = false;
search_box = NULL;
search_box = nullptr;
keying = false;
_prop_edited = "property_edited";
set_process(true);