1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-11 13:10:58 +00:00

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

@@ -62,7 +62,7 @@ void draw_margin_line(Control *edit_draw, Vector2 from, Vector2 to) {
}
void TextureRegionEditor::_region_draw() {
Ref<Texture> base_tex = NULL;
Ref<Texture> base_tex = nullptr;
if (node_sprite)
base_tex = node_sprite->get_texture();
else if (node_sprite_3d)
@@ -699,7 +699,7 @@ void TextureRegionEditor::_update_autoslice() {
autoslice_is_dirty = false;
autoslice_cache.clear();
Ref<Texture> texture = NULL;
Ref<Texture> texture = nullptr;
if (node_sprite)
texture = node_sprite->get_texture();
else if (node_sprite_3d)
@@ -794,11 +794,11 @@ void TextureRegionEditor::_notification(int p_what) {
void TextureRegionEditor::_node_removed(Object *p_obj) {
if (p_obj == node_sprite || p_obj == node_sprite_3d || p_obj == node_ninepatch || p_obj == obj_styleBox.ptr() || p_obj == atlas_tex.ptr()) {
node_sprite = NULL;
node_sprite_3d = NULL;
node_ninepatch = NULL;
obj_styleBox = Ref<StyleBox>(NULL);
atlas_tex = Ref<AtlasTexture>(NULL);
node_sprite = nullptr;
node_sprite_3d = nullptr;
node_ninepatch = nullptr;
obj_styleBox = Ref<StyleBox>(nullptr);
atlas_tex = Ref<AtlasTexture>(nullptr);
hide();
}
}
@@ -832,7 +832,7 @@ bool TextureRegionEditor::is_atlas_texture() {
}
bool TextureRegionEditor::is_ninepatch() {
return node_ninepatch != NULL;
return node_ninepatch != nullptr;
}
Sprite3D *TextureRegionEditor::get_sprite_3d() {
@@ -865,11 +865,11 @@ void TextureRegionEditor::edit(Object *p_obj) {
p_obj->add_change_receptor(this);
_edit_region();
} else {
node_sprite = NULL;
node_sprite_3d = NULL;
node_ninepatch = NULL;
obj_styleBox = Ref<StyleBoxTexture>(NULL);
atlas_tex = Ref<AtlasTexture>(NULL);
node_sprite = nullptr;
node_sprite_3d = nullptr;
node_ninepatch = nullptr;
obj_styleBox = Ref<StyleBoxTexture>(nullptr);
atlas_tex = Ref<AtlasTexture>(nullptr);
}
edit_draw->update();
if ((node_sprite && !node_sprite->is_region()) || (node_sprite_3d && !node_sprite_3d->is_region())) {
@@ -888,7 +888,7 @@ void TextureRegionEditor::_changed_callback(Object *p_changed, const char *p_pro
}
void TextureRegionEditor::_edit_region() {
Ref<Texture> texture = NULL;
Ref<Texture> texture = nullptr;
if (node_sprite)
texture = node_sprite->get_texture();
else if (node_sprite_3d)
@@ -934,11 +934,11 @@ Vector2 TextureRegionEditor::snap_point(Vector2 p_target) const {
}
TextureRegionEditor::TextureRegionEditor(EditorNode *p_editor) {
node_sprite = NULL;
node_sprite_3d = NULL;
node_ninepatch = NULL;
obj_styleBox = Ref<StyleBoxTexture>(NULL);
atlas_tex = Ref<AtlasTexture>(NULL);
node_sprite = nullptr;
node_sprite_3d = nullptr;
node_ninepatch = nullptr;
obj_styleBox = Ref<StyleBoxTexture>(nullptr);
atlas_tex = Ref<AtlasTexture>(nullptr);
editor = p_editor;
undo_redo = editor->get_undo_redo();
@@ -1096,7 +1096,7 @@ void TextureRegionEditorPlugin::make_visible(bool p_visible) {
manually_hidden = false;
}
texture_region_button->hide();
region_editor->edit(NULL);
region_editor->edit(nullptr);
}
}