Skip to content

Commit 556b66a

Browse files
committed
Clang format 20
1 parent d5ed5b2 commit 556b66a

6 files changed

Lines changed: 11 additions & 15 deletions

File tree

.github/workflows/style.yml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,10 @@ jobs:
1818
run: |
1919
sudo apt-get update -y
2020
sudo apt-get install -y pkg-config cmake cmake build-essential shellcheck
21-
wget https://github.com/muttleyxd/clang-tools-static-binaries/releases/download/master-46b8640/clang-format-10_linux-amd64
22-
echo "b8ed0cfc9cded28f8c0c9dd0da402d1287453b7d55a68bf243b432035aebcaa4720bfff22440d1f1c5d4c82f7b8d85948214cca85a2aa976589b88459e440521 clang-format-10_linux-amd64" | sha512sum -c
23-
mkdir -p ~/.local/bin/
24-
mv clang-format-10_linux-amd64 ~/.local/bin/clang-format
21+
wget https://github.com/muttleyxd/clang-tools-static-binaries/releases/download/master-796e77c/clang-format-20_linux-amd64
22+
echo "bbb30a777d075dfbe91aa146a1ea1fa0c1d4745efa9c5490ebf9f5a7a7dec679c22f1c6015d5c85cb5b5b22964d86ae65002f1d4145bfdd7f27022d981b58979 clang-format-20_linux-amd64" | sha512sum -c
23+
mv clang-format-20_linux-amd64 ~/.local/bin/clang-format
2524
chmod +x ~/.local/bin/clang-format
26-
- name: Check clang format version
27-
run: |
28-
clang-format -version # expect 10
2925
- name: Check fix_style
3026
run: scripts/fix_style.py --dry-run
3127
# - name: Shellcheck

scripts/fix_style.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def find_clang_format(version):
4343
print(f"Found no clang-format {version}")
4444
sys.exit(-1)
4545

46-
clang_format_bin = find_clang_format(10)
46+
clang_format_bin = find_clang_format(20)
4747

4848
def reformat(filenames):
4949
for filename in filenames:

src/bots/base.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ class CBaseBot
127127
void _SetWeaponRaw(int Value) const;
128128
void _SetWeapon(int Value, const char *pComment, const char *pFunction, const char *pFile, int Line) const;
129129

130-
void Tick(){};
130+
void Tick() {};
131131
};
132132

133133
} // namespace TWBL

src/twbl/teeworlds/base/color.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ class color4_base
8585
// Disallow casting between different instantiations of the color4_base template.
8686
// The color_cast functions below should be used to convert between colors.
8787
template<typename OtherDerivedT>
88-
requires(!std::is_same_v<DerivedT, OtherDerivedT>)
89-
color4_base(const color4_base<OtherDerivedT> &Other) = delete;
88+
requires(!std::is_same_v<DerivedT, OtherDerivedT>)
89+
color4_base(const color4_base<OtherDerivedT> &Other) = delete;
9090

9191
constexpr float &operator[](int index)
9292
{

src/twbl/teeworlds/base/detect.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#define CONF_PLATFORM_FREEBSD 1
1919
#endif
2020

21-
#if(defined(__LINUX__) || defined(__linux__) || defined(CONF_WEBASM)) && !defined(__ANDROID__)
21+
#if (defined(__LINUX__) || defined(__linux__) || defined(CONF_WEBASM)) && !defined(__ANDROID__)
2222
#define CONF_FAMILY_UNIX 1
2323
#define CONF_PLATFORM_LINUX 1
2424
#endif

src/twbl/teeworlds/base/vmath.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ class vector2_base
7676
return *this;
7777
}
7878

79-
bool operator==(const vector2_base &vec) const { return x == vec.x && y == vec.y; } //TODO: do this with an eps instead
79+
bool operator==(const vector2_base &vec) const { return x == vec.x && y == vec.y; } // TODO: do this with an eps instead
8080
bool operator!=(const vector2_base &vec) const { return x != vec.x || y != vec.y; }
8181

8282
T &operator[](const int index) { return index ? y : x; }
@@ -253,7 +253,7 @@ class vector3_base
253253
return *this;
254254
}
255255

256-
bool operator==(const vector3_base &vec) const { return x == vec.x && y == vec.y && z == vec.z; } //TODO: do this with an eps instead
256+
bool operator==(const vector3_base &vec) const { return x == vec.x && y == vec.y && z == vec.z; } // TODO: do this with an eps instead
257257
bool operator!=(const vector3_base &vec) const { return x != vec.x || y != vec.y || z != vec.z; }
258258
};
259259

@@ -383,7 +383,7 @@ class vector4_base
383383
return *this;
384384
}
385385

386-
bool operator==(const vector4_base &vec) const { return x == vec.x && y == vec.y && z == vec.z && w == vec.w; } //TODO: do this with an eps instead
386+
bool operator==(const vector4_base &vec) const { return x == vec.x && y == vec.y && z == vec.z && w == vec.w; } // TODO: do this with an eps instead
387387
bool operator!=(const vector4_base &vec) const { return x != vec.x || y != vec.y || z != vec.z || w != vec.w; }
388388
};
389389

0 commit comments

Comments
 (0)