Style: Enforce braces around if blocks and loops

Using clang-tidy's `readability-braces-around-statements`.
https://clang.llvm.org/extra/clang-tidy/checks/readability-braces-around-statements.html
This commit is contained in:
Rémi Verschelde 2021-05-05 12:44:11 +02:00
parent b8d198eeed
commit 140350d767
No known key found for this signature in database
GPG key ID: C3336907360768E1
694 changed files with 23283 additions and 12499 deletions

View file

@ -145,10 +145,12 @@ Ref<Script> PluginScript::get_base_script() const {
}
StringName PluginScript::get_instance_base_type() const {
if (_native_parent)
if (_native_parent) {
return _native_parent;
if (_ref_base_parent.is_valid())
}
if (_ref_base_parent.is_valid()) {
return _ref_base_parent->get_instance_base_type();
}
return StringName();
}
@ -217,8 +219,9 @@ String PluginScript::get_source_code() const {
}
void PluginScript::set_source_code(const String &p_code) {
if (_source == p_code)
if (_source == p_code) {
return;
}
_source = p_code;
}
@ -232,11 +235,13 @@ Error PluginScript::reload(bool p_keep_state) {
_valid = false;
String basedir = _path;
if (basedir == "")
if (basedir == "") {
basedir = get_path();
}
if (basedir != "")
if (basedir != "") {
basedir = basedir.get_base_dir();
}
if (_data) {
_desc->finish(_data);
@ -422,9 +427,6 @@ Error PluginScript::load_source_code(const String &p_path) {
}
_source = s;
#ifdef TOOLS_ENABLED
// source_changed_cache=true;
#endif
_path = p_path;
return OK;
}
@ -443,11 +445,11 @@ void PluginScript::get_script_signal_list(List<MethodInfo> *r_signals) const {
int PluginScript::get_member_line(const StringName &p_member) const {
#ifdef TOOLS_ENABLED
if (_member_lines.has(p_member))
if (_member_lines.has(p_member)) {
return _member_lines[p_member];
else
}
#endif
return -1;
return -1;
}
MultiplayerAPI::RPCMode PluginScript::get_rpc_mode(const StringName &p_method) const {