summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2019-04-09 17:08:36 +0200
committerRémi Verschelde <rverschelde@gmail.com>2019-04-09 17:09:48 +0200
commitc8994b56f95c2623f60e48cd86d6e2368708e3ca (patch)
tree105363f3f3283eb691f44de640fcdad852c2ba1b /core
parent4b2c79c4718f2f0b016069f0acba61df6d950fbd (diff)
Style: Apply new changes from clang-format 8.0
It seems to stay compatible with formatting done by clang-format 6.0 and 7.0, so contributors can keep using those versions for now (they will not undo those changes).
Diffstat (limited to 'core')
-rw-r--r--core/bind/core_bind.cpp3
-rw-r--r--core/image.cpp15
-rw-r--r--core/io/marshalls.cpp11
-rw-r--r--core/io/resource_format_binary.cpp3
-rw-r--r--core/math/basis.cpp4
-rw-r--r--core/math/basis.h4
-rw-r--r--core/math/expression.cpp6
-rw-r--r--core/object.cpp3
-rw-r--r--core/packed_data_container.cpp3
-rw-r--r--core/variant.cpp38
-rw-r--r--core/variant_op.cpp12
-rw-r--r--core/variant_parser.cpp3
12 files changed, 70 insertions, 35 deletions
diff --git a/core/bind/core_bind.cpp b/core/bind/core_bind.cpp
index 98d3e77f66..ba595b9627 100644
--- a/core/bind/core_bind.cpp
+++ b/core/bind/core_bind.cpp
@@ -2445,7 +2445,8 @@ void _Thread::_start_func(void *ud) {
reason = "Method Not Found";
} break;
- default: {}
+ default: {
+ }
}
ERR_EXPLAIN("Could not call function '" + t->target_method.operator String() + "'' starting thread ID: " + t->get_id() + " Reason: " + reason);
diff --git a/core/image.cpp b/core/image.cpp
index f547d7e973..90afd9f35a 100644
--- a/core/image.cpp
+++ b/core/image.cpp
@@ -1266,7 +1266,8 @@ void Image::shrink_x2() {
case FORMAT_RGBAH: _generate_po2_mipmap<uint16_t, 4, false, Image::average_4_half, Image::renormalize_half>(reinterpret_cast<const uint16_t *>(r.ptr()), reinterpret_cast<uint16_t *>(w.ptr()), width, height); break;
case FORMAT_RGBE9995: _generate_po2_mipmap<uint32_t, 1, false, Image::average_4_rgbe9995, Image::renormalize_rgbe9995>(reinterpret_cast<const uint32_t *>(r.ptr()), reinterpret_cast<uint32_t *>(w.ptr()), width, height); break;
- default: {}
+ default: {
+ }
}
}
@@ -1398,7 +1399,8 @@ Error Image::generate_mipmaps(bool p_renormalize) {
_generate_po2_mipmap<uint32_t, 1, false, Image::average_4_rgbe9995, Image::renormalize_rgbe9995>(reinterpret_cast<const uint32_t *>(&wp[prev_ofs]), reinterpret_cast<uint32_t *>(&wp[ofs]), prev_w, prev_h);
break;
- default: {}
+ default: {
+ }
}
prev_ofs = ofs;
@@ -1612,7 +1614,8 @@ void Image::create(const char **p_xpm) {
if (y == (size_height - 1))
status = DONE;
} break;
- default: {}
+ default: {
+ }
}
line++;
@@ -1685,7 +1688,8 @@ bool Image::is_invisible() const {
case FORMAT_DXT5: {
detected = true;
} break;
- default: {}
+ default: {
+ }
}
return !detected;
@@ -1729,7 +1733,8 @@ Image::AlphaMode Image::detect_alpha() const {
case FORMAT_DXT5: {
detected = true;
} break;
- default: {}
+ default: {
+ }
}
if (detected)
diff --git a/core/io/marshalls.cpp b/core/io/marshalls.cpp
index 363460311c..81b3829ffc 100644
--- a/core/io/marshalls.cpp
+++ b/core/io/marshalls.cpp
@@ -768,7 +768,9 @@ Error decode_variant(Variant &r_variant, const uint8_t *p_buffer, int p_len, int
r_variant = carray;
} break;
- default: { ERR_FAIL_V(ERR_BUG); }
+ default: {
+ ERR_FAIL_V(ERR_BUG);
+ }
}
return OK;
@@ -823,7 +825,8 @@ Error encode_variant(const Variant &p_variant, uint8_t *r_buffer, int &r_len, bo
flags |= ENCODE_FLAG_OBJECT_AS_ID;
}
} break;
- default: {} // nothing to do at this stage
+ default: {
+ } // nothing to do at this stage
}
if (buf) {
@@ -1385,7 +1388,9 @@ Error encode_variant(const Variant &p_variant, uint8_t *r_buffer, int &r_len, bo
r_len += 4 * 4 * len;
} break;
- default: { ERR_FAIL_V(ERR_BUG); }
+ default: {
+ ERR_FAIL_V(ERR_BUG);
+ }
}
return OK;
diff --git a/core/io/resource_format_binary.cpp b/core/io/resource_format_binary.cpp
index 42070cd132..f25abc4aab 100644
--- a/core/io/resource_format_binary.cpp
+++ b/core/io/resource_format_binary.cpp
@@ -1725,7 +1725,8 @@ void ResourceFormatSaverBinaryInstance::_find_resources(const Variant &p_variant
get_string_index(np.get_subname(i));
} break;
- default: {}
+ default: {
+ }
}
}
diff --git a/core/math/basis.cpp b/core/math/basis.cpp
index 82b2f7006d..9fcecd1ba6 100644
--- a/core/math/basis.cpp
+++ b/core/math/basis.cpp
@@ -557,7 +557,7 @@ void Basis::set_euler_yxz(const Vector3 &p_euler) {
*this = ymat * xmat * zmat;
}
-bool Basis::is_equal_approx(const Basis &a, const Basis &b,real_t p_epsilon) const {
+bool Basis::is_equal_approx(const Basis &a, const Basis &b, real_t p_epsilon) const {
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 3; j++) {
@@ -569,7 +569,7 @@ bool Basis::is_equal_approx(const Basis &a, const Basis &b,real_t p_epsilon) con
return true;
}
-bool Basis::is_equal_approx_ratio(const Basis &a, const Basis &b,real_t p_epsilon) const {
+bool Basis::is_equal_approx_ratio(const Basis &a, const Basis &b, real_t p_epsilon) const {
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 3; j++) {
diff --git a/core/math/basis.h b/core/math/basis.h
index aa0ddb280f..75037c2c52 100644
--- a/core/math/basis.h
+++ b/core/math/basis.h
@@ -133,8 +133,8 @@ public:
return elements[0][2] * v[0] + elements[1][2] * v[1] + elements[2][2] * v[2];
}
- bool is_equal_approx(const Basis &a, const Basis &b, real_t p_epsilon=CMP_EPSILON) const;
- bool is_equal_approx_ratio(const Basis &a, const Basis &b, real_t p_epsilon=UNIT_EPSILON) const;
+ bool is_equal_approx(const Basis &a, const Basis &b, real_t p_epsilon = CMP_EPSILON) const;
+ bool is_equal_approx_ratio(const Basis &a, const Basis &b, real_t p_epsilon = UNIT_EPSILON) const;
bool operator==(const Basis &p_matrix) const;
bool operator!=(const Basis &p_matrix) const;
diff --git a/core/math/expression.cpp b/core/math/expression.cpp
index 05b49f0815..133dcc7ab9 100644
--- a/core/math/expression.cpp
+++ b/core/math/expression.cpp
@@ -760,7 +760,8 @@ void Expression::exec_func(BuiltinFunc p_func, const Variant **p_inputs, Variant
*r_return = String(color);
} break;
- default: {}
+ default: {
+ }
}
}
@@ -1679,7 +1680,8 @@ Expression::ENode *Expression::_parse_expression() {
case TK_OP_BIT_OR: op = Variant::OP_BIT_OR; break;
case TK_OP_BIT_XOR: op = Variant::OP_BIT_XOR; break;
case TK_OP_BIT_INVERT: op = Variant::OP_BIT_NEGATE; break;
- default: {};
+ default: {
+ };
}
if (op == Variant::OP_MAX) { //stop appending stuff
diff --git a/core/object.cpp b/core/object.cpp
index 8b693f039c..03a11b8ca3 100644
--- a/core/object.cpp
+++ b/core/object.cpp
@@ -1637,7 +1637,8 @@ void Object::_clear_internal_resource_paths(const Variant &p_var) {
_clear_internal_resource_paths(d[E->get()]);
}
} break;
- default: {}
+ default: {
+ }
}
}
diff --git a/core/packed_data_container.cpp b/core/packed_data_container.cpp
index 99bed829c1..fa60be64a7 100644
--- a/core/packed_data_container.cpp
+++ b/core/packed_data_container.cpp
@@ -319,7 +319,8 @@ uint32_t PackedDataContainer::_pack(const Variant &p_data, Vector<uint8_t> &tmpd
} break;
- default: {}
+ default: {
+ }
}
return OK;
diff --git a/core/variant.cpp b/core/variant.cpp
index 2ee2e8e293..6c54faf233 100644
--- a/core/variant.cpp
+++ b/core/variant.cpp
@@ -179,7 +179,8 @@ String Variant::get_type_name(Variant::Type p_type) {
return "PoolColorArray";
} break;
- default: {}
+ default: {
+ }
}
return "";
@@ -403,7 +404,8 @@ bool Variant::can_convert(Variant::Type p_type_from, Variant::Type p_type_to) {
valid_types = valid;
} break;
- default: {}
+ default: {
+ }
}
if (valid_types) {
@@ -649,7 +651,8 @@ bool Variant::can_convert_strict(Variant::Type p_type_from, Variant::Type p_type
valid_types = valid;
} break;
- default: {}
+ default: {
+ }
}
if (valid_types) {
@@ -841,7 +844,8 @@ bool Variant::is_zero() const {
return reinterpret_cast<const PoolVector<Color> *>(_data._mem)->size() == 0;
} break;
- default: {}
+ default: {
+ }
}
return false;
@@ -896,7 +900,9 @@ bool Variant::is_one() const {
} break;
- default: { return !is_zero(); }
+ default: {
+ return !is_zero();
+ }
}
return false;
@@ -1039,7 +1045,8 @@ void Variant::reference(const Variant &p_variant) {
memnew_placement(_data._mem, PoolVector<Color>(*reinterpret_cast<const PoolVector<Color> *>(p_variant._data._mem)));
} break;
- default: {}
+ default: {
+ }
}
}
@@ -1143,7 +1150,8 @@ void Variant::clear() {
reinterpret_cast<PoolVector<Color> *>(_data._mem)->~PoolVector<Color>();
} break;
- default: {} /* not needed */
+ default: {
+ } /* not needed */
}
type = NIL;
@@ -1823,7 +1831,9 @@ inline DA _convert_array_from_variant(const Variant &p_variant) {
case Variant::POOL_COLOR_ARRAY: {
return _convert_array<DA, PoolVector<Color> >(p_variant.operator PoolVector<Color>());
}
- default: { return DA(); }
+ default: {
+ return DA();
+ }
}
return DA();
@@ -2642,7 +2652,8 @@ void Variant::operator=(const Variant &p_variant) {
*reinterpret_cast<PoolVector<Color> *>(_data._mem) = *reinterpret_cast<const PoolVector<Color> *>(p_variant._data._mem);
} break;
- default: {}
+ default: {
+ }
}
}
@@ -2919,7 +2930,8 @@ uint32_t Variant::hash() const {
return hash;
} break;
- default: {}
+ default: {
+ }
}
return 0;
@@ -3167,7 +3179,8 @@ bool Variant::is_shared() const {
case OBJECT: return true;
case ARRAY: return true;
case DICTIONARY: return true;
- default: {}
+ default: {
+ }
}
return false;
@@ -3204,7 +3217,8 @@ Variant Variant::call(const StringName &p_method, VARIANT_ARG_DECLARE) {
String err = "Too many arguments for method '" + p_method + "'";
ERR_PRINT(err.utf8().get_data());
} break;
- default: {}
+ default: {
+ }
}
return ret;
diff --git a/core/variant_op.cpp b/core/variant_op.cpp
index b40b6ce4a6..f3c9bcaa7e 100644
--- a/core/variant_op.cpp
+++ b/core/variant_op.cpp
@@ -2781,7 +2781,8 @@ bool Variant::in(const Variant &p_index, bool *r_valid) const {
return false;
}
} break;
- default: {}
+ default: {
+ }
}
if (r_valid)
@@ -2912,7 +2913,8 @@ void Variant::get_property_list(List<PropertyInfo> *p_list) const {
//nothing
} break;
- default: {}
+ default: {
+ }
}
}
@@ -3251,7 +3253,8 @@ bool Variant::iter_next(Variant &r_iter, bool &valid) const {
r_iter = idx;
return true;
} break;
- default: {}
+ default: {
+ }
}
valid = false;
@@ -3408,7 +3411,8 @@ Variant Variant::iter_get(const Variant &r_iter, bool &r_valid) const {
#endif
return arr->get(idx);
} break;
- default: {}
+ default: {
+ }
}
r_valid = false;
diff --git a/core/variant_parser.cpp b/core/variant_parser.cpp
index 0056fc75b6..6377197282 100644
--- a/core/variant_parser.cpp
+++ b/core/variant_parser.cpp
@@ -1948,7 +1948,8 @@ Error VariantWriter::write(const Variant &p_variant, StoreStringFunc p_store_str
p_store_string_func(p_store_string_ud, " )");
} break;
- default: {}
+ default: {
+ }
}
return OK;