You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-19 14:31:59 +00:00
Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks
This commit is contained in:
@@ -33,22 +33,18 @@
|
||||
#include "core/script_language.h"
|
||||
|
||||
bool Reference::init_ref() {
|
||||
|
||||
if (reference()) {
|
||||
|
||||
if (!is_referenced() && refcount_init.unref()) {
|
||||
unreference(); // first referencing is already 1, so compensate for the ref above
|
||||
}
|
||||
|
||||
return true;
|
||||
} else {
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
void Reference::_bind_methods() {
|
||||
|
||||
ClassDB::bind_method(D_METHOD("init_ref"), &Reference::init_ref);
|
||||
ClassDB::bind_method(D_METHOD("reference"), &Reference::reference);
|
||||
ClassDB::bind_method(D_METHOD("unreference"), &Reference::unreference);
|
||||
@@ -59,7 +55,6 @@ int Reference::reference_get_count() const {
|
||||
}
|
||||
|
||||
bool Reference::reference() {
|
||||
|
||||
uint32_t rc_val = refcount.refval();
|
||||
bool success = rc_val != 0;
|
||||
|
||||
@@ -80,7 +75,6 @@ bool Reference::reference() {
|
||||
}
|
||||
|
||||
bool Reference::unreference() {
|
||||
|
||||
uint32_t rc_val = refcount.unrefval();
|
||||
bool die = rc_val == 0;
|
||||
|
||||
@@ -103,7 +97,6 @@ bool Reference::unreference() {
|
||||
}
|
||||
|
||||
Reference::Reference() {
|
||||
|
||||
refcount.init();
|
||||
refcount_init.init();
|
||||
}
|
||||
@@ -112,7 +105,6 @@ Reference::~Reference() {
|
||||
}
|
||||
|
||||
Variant WeakRef::get_ref() const {
|
||||
|
||||
if (ref == 0)
|
||||
return Variant();
|
||||
|
||||
@@ -121,7 +113,6 @@ Variant WeakRef::get_ref() const {
|
||||
return Variant();
|
||||
Reference *r = cast_to<Reference>(obj);
|
||||
if (r) {
|
||||
|
||||
return REF(r);
|
||||
}
|
||||
|
||||
@@ -133,7 +124,6 @@ void WeakRef::set_obj(Object *p_object) {
|
||||
}
|
||||
|
||||
void WeakRef::set_ref(const REF &p_ref) {
|
||||
|
||||
ref = p_ref.is_valid() ? p_ref->get_instance_id() : 0;
|
||||
}
|
||||
|
||||
@@ -142,6 +132,5 @@ WeakRef::WeakRef() :
|
||||
}
|
||||
|
||||
void WeakRef::_bind_methods() {
|
||||
|
||||
ClassDB::bind_method(D_METHOD("get_ref"), &WeakRef::get_ref);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user