Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks
Which means that reduz' beloved style which we all became used to will now be changed automatically to remove the first empty line. This makes us lean closer to 1TBS (the one true brace style) instead of hybridating it with some Allman-inspired spacing. There's still the case of braces around single-statement blocks that needs to be addressed (but clang-format can't help with that, but clang-tidy may if we agree about it). Part of #33027.
This commit is contained in:
parent
710b34b702
commit
0be6d925dc
1552 changed files with 1 additions and 33876 deletions
|
|
@ -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;
|
||||
|
||||
|
|
@ -104,13 +98,11 @@ bool Reference::unreference() {
|
|||
|
||||
Reference::Reference() :
|
||||
Object(true) {
|
||||
|
||||
refcount.init();
|
||||
refcount_init.init();
|
||||
}
|
||||
|
||||
Variant WeakRef::get_ref() const {
|
||||
|
||||
if (ref.is_null())
|
||||
return Variant();
|
||||
|
||||
|
|
@ -119,7 +111,6 @@ Variant WeakRef::get_ref() const {
|
|||
return Variant();
|
||||
Reference *r = cast_to<Reference>(obj);
|
||||
if (r) {
|
||||
|
||||
return REF(r);
|
||||
}
|
||||
|
||||
|
|
@ -131,11 +122,9 @@ 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() : ObjectID();
|
||||
}
|
||||
|
||||
void WeakRef::_bind_methods() {
|
||||
|
||||
ClassDB::bind_method(D_METHOD("get_ref"), &WeakRef::get_ref);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue