Compare commits

...

3 Commits

Author SHA1 Message Date
dependabot[bot]
88905609f5
build(deps): bump deps/libtomcrypt from cacfc2d to 1764254 (#112)
Bumps [deps/libtomcrypt](https://github.com/libtom/libtomcrypt) from `cacfc2d` to `1764254`.
- [Release notes](https://github.com/libtom/libtomcrypt/releases)
- [Commits](cacfc2dc04...17642547e4)

---
updated-dependencies:
- dependency-name: deps/libtomcrypt
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-01 17:20:09 +00:00
dependabot[bot]
890e4a6d92
build(deps): bump deps/GSL from 87f9d76 to ddae9d7 (#111)
Bumps [deps/GSL](https://github.com/microsoft/GSL) from `87f9d76` to `ddae9d7`.
- [Release notes](https://github.com/microsoft/GSL/releases)
- [Commits](87f9d76886...ddae9d72b6)

---
updated-dependencies:
- dependency-name: deps/GSL
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-01 17:15:00 +00:00
c5f4a1db71
build: fix building with clang 2024-12-01 17:09:58 +00:00
5 changed files with 40 additions and 4 deletions

28
.github/workflows/check-formatting.yml vendored Normal file
View File

@ -0,0 +1,28 @@
name: check-formatting
on:
push:
branches:
- "*"
pull_request:
branches:
- "*"
types: [opened, synchronize, reopened]
jobs:
check-formatting:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@main
- name: Install LLVM and Clang
uses: KyleMayes/install-llvm-action@v2.0.2
with:
version: "17.0"
- name: Test formatting for all files
working-directory: ${{ github.workspace }}
run: |
export CLANG_FORMAT_BIN="${LLVM_PATH}/bin/clang-format"
./scripts/check-format.sh

2
deps/GSL vendored

@ -1 +1 @@
Subproject commit 87f9d768866548b5b86e72be66c60c5abd4d9b37
Subproject commit ddae9d72b6bd5fe58bc5c54e8c513fca67c833f6

2
deps/libtomcrypt vendored

@ -1 +1 @@
Subproject commit cacfc2dc047518a90900638f1417a8544ac1e555
Subproject commit 17642547e4b18a6ba58b1705527500b003caca8f

8
scripts/check-format.sh Executable file
View File

@ -0,0 +1,8 @@
#!/bin/bash
# Go to repository root
cd "$(dirname "$0")/.." || exit 2
CLANG_FORMAT_BIN="${CLANG_FORMAT_BIN:-clang-format}"
find ./src -iname '*.hpp' -o -iname '*.cpp' | xargs $CLANG_FORMAT_BIN -Werror -ferror-limit=1 --dry-run

View File

@ -19,8 +19,8 @@ public:
template <typename T> static T* get() {
for (const auto& component_ : get_components()) {
if (typeid(*component_.get()) == typeid(T)) {
return reinterpret_cast<T*>(component_.get());
if (auto c = dynamic_cast<T*>(component_.get())) {
return c;
}
}