mirror of
https://github.com/godotengine/godot.git
synced 2026-01-03 18:11:19 +03:00
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:
@@ -35,7 +35,6 @@
|
||||
#include "core/ustring.h"
|
||||
|
||||
struct Vector3i {
|
||||
|
||||
enum Axis {
|
||||
AXIS_X,
|
||||
AXIS_Y,
|
||||
@@ -53,12 +52,10 @@ struct Vector3i {
|
||||
};
|
||||
|
||||
_FORCE_INLINE_ const int32_t &operator[](int p_axis) const {
|
||||
|
||||
return coord[p_axis];
|
||||
}
|
||||
|
||||
_FORCE_INLINE_ int32_t &operator[](int p_axis) {
|
||||
|
||||
return coord[p_axis];
|
||||
}
|
||||
|
||||
@@ -109,19 +106,16 @@ struct Vector3i {
|
||||
};
|
||||
|
||||
Vector3i Vector3i::abs() const {
|
||||
|
||||
return Vector3i(ABS(x), ABS(y), ABS(z));
|
||||
}
|
||||
|
||||
Vector3i Vector3i::sign() const {
|
||||
|
||||
return Vector3i(SGN(x), SGN(y), SGN(z));
|
||||
}
|
||||
|
||||
/* Operators */
|
||||
|
||||
Vector3i &Vector3i::operator+=(const Vector3i &p_v) {
|
||||
|
||||
x += p_v.x;
|
||||
y += p_v.y;
|
||||
z += p_v.z;
|
||||
@@ -129,36 +123,30 @@ Vector3i &Vector3i::operator+=(const Vector3i &p_v) {
|
||||
}
|
||||
|
||||
Vector3i Vector3i::operator+(const Vector3i &p_v) const {
|
||||
|
||||
return Vector3i(x + p_v.x, y + p_v.y, z + p_v.z);
|
||||
}
|
||||
|
||||
Vector3i &Vector3i::operator-=(const Vector3i &p_v) {
|
||||
|
||||
x -= p_v.x;
|
||||
y -= p_v.y;
|
||||
z -= p_v.z;
|
||||
return *this;
|
||||
}
|
||||
Vector3i Vector3i::operator-(const Vector3i &p_v) const {
|
||||
|
||||
return Vector3i(x - p_v.x, y - p_v.y, z - p_v.z);
|
||||
}
|
||||
|
||||
Vector3i &Vector3i::operator*=(const Vector3i &p_v) {
|
||||
|
||||
x *= p_v.x;
|
||||
y *= p_v.y;
|
||||
z *= p_v.z;
|
||||
return *this;
|
||||
}
|
||||
Vector3i Vector3i::operator*(const Vector3i &p_v) const {
|
||||
|
||||
return Vector3i(x * p_v.x, y * p_v.y, z * p_v.z);
|
||||
}
|
||||
|
||||
Vector3i &Vector3i::operator/=(const Vector3i &p_v) {
|
||||
|
||||
x /= p_v.x;
|
||||
y /= p_v.y;
|
||||
z /= p_v.z;
|
||||
@@ -166,12 +154,10 @@ Vector3i &Vector3i::operator/=(const Vector3i &p_v) {
|
||||
}
|
||||
|
||||
Vector3i Vector3i::operator/(const Vector3i &p_v) const {
|
||||
|
||||
return Vector3i(x / p_v.x, y / p_v.y, z / p_v.z);
|
||||
}
|
||||
|
||||
Vector3i &Vector3i::operator*=(int32_t p_scalar) {
|
||||
|
||||
x *= p_scalar;
|
||||
y *= p_scalar;
|
||||
z *= p_scalar;
|
||||
@@ -179,17 +165,14 @@ Vector3i &Vector3i::operator*=(int32_t p_scalar) {
|
||||
}
|
||||
|
||||
_FORCE_INLINE_ Vector3i operator*(int32_t p_scalar, const Vector3i &p_vec) {
|
||||
|
||||
return p_vec * p_scalar;
|
||||
}
|
||||
|
||||
Vector3i Vector3i::operator*(int32_t p_scalar) const {
|
||||
|
||||
return Vector3i(x * p_scalar, y * p_scalar, z * p_scalar);
|
||||
}
|
||||
|
||||
Vector3i &Vector3i::operator/=(int32_t p_scalar) {
|
||||
|
||||
x /= p_scalar;
|
||||
y /= p_scalar;
|
||||
z /= p_scalar;
|
||||
@@ -197,27 +180,22 @@ Vector3i &Vector3i::operator/=(int32_t p_scalar) {
|
||||
}
|
||||
|
||||
Vector3i Vector3i::operator/(int32_t p_scalar) const {
|
||||
|
||||
return Vector3i(x / p_scalar, y / p_scalar, z / p_scalar);
|
||||
}
|
||||
|
||||
Vector3i Vector3i::operator-() const {
|
||||
|
||||
return Vector3i(-x, -y, -z);
|
||||
}
|
||||
|
||||
bool Vector3i::operator==(const Vector3i &p_v) const {
|
||||
|
||||
return (x == p_v.x && y == p_v.y && z == p_v.z);
|
||||
}
|
||||
|
||||
bool Vector3i::operator!=(const Vector3i &p_v) const {
|
||||
|
||||
return (x != p_v.x || y != p_v.y || z != p_v.z);
|
||||
}
|
||||
|
||||
bool Vector3i::operator<(const Vector3i &p_v) const {
|
||||
|
||||
if (x == p_v.x) {
|
||||
if (y == p_v.y)
|
||||
return z < p_v.z;
|
||||
@@ -229,7 +207,6 @@ bool Vector3i::operator<(const Vector3i &p_v) const {
|
||||
}
|
||||
|
||||
bool Vector3i::operator>(const Vector3i &p_v) const {
|
||||
|
||||
if (x == p_v.x) {
|
||||
if (y == p_v.y)
|
||||
return z > p_v.z;
|
||||
@@ -241,7 +218,6 @@ bool Vector3i::operator>(const Vector3i &p_v) const {
|
||||
}
|
||||
|
||||
bool Vector3i::operator<=(const Vector3i &p_v) const {
|
||||
|
||||
if (x == p_v.x) {
|
||||
if (y == p_v.y)
|
||||
return z <= p_v.z;
|
||||
@@ -253,7 +229,6 @@ bool Vector3i::operator<=(const Vector3i &p_v) const {
|
||||
}
|
||||
|
||||
bool Vector3i::operator>=(const Vector3i &p_v) const {
|
||||
|
||||
if (x == p_v.x) {
|
||||
if (y == p_v.y)
|
||||
return z >= p_v.z;
|
||||
@@ -265,7 +240,6 @@ bool Vector3i::operator>=(const Vector3i &p_v) const {
|
||||
}
|
||||
|
||||
void Vector3i::zero() {
|
||||
|
||||
x = y = z = 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user