Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .github/workflows/clang_format.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ on:

jobs:
clang-format:
name: Clang Format Check
runs-on: ubuntu-latest

steps:
Expand All @@ -39,10 +40,10 @@ jobs:
run: |
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
echo "Getting diff for pull request"
git diff origin/${{ github.base_ref }}...HEAD > diff.patch
git diff origin/${{ github.base_ref }}...HEAD -- '*.c' '*.cpp' '*.hpp' '*.cc' '*.cxx' '*.h' '*.hh' '*.hxx' > diff.patch
else
echo "Getting diff for commit"
git diff ${{ github.event.before }} ${{ github.event.after }} > diff.patch
git diff ${{ github.event.before }} ${{ github.event.after }} -- '*.c' '*.cpp' '*.hpp' '*.cc' '*.cxx' '*.h' '*.hh' '*.hxx' > diff.patch
fi

- name: Check formatting
Expand Down
17 changes: 15 additions & 2 deletions .github/workflows/cmake-multi-platform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ on:

jobs:
run-matrix:
name: Run CMake Build and Test Matrix
uses: ./.github/workflows/cmake_build_and_test.yml
strategy:
# Set fail-fast to false to ensure that feedback is delivered for all matrix combinations. Consider changing this to true when your workflow is stable.
Expand Down Expand Up @@ -107,4 +106,18 @@ jobs:
build_type: ${{ matrix.build_type || matrix.preset == 'benchmark' && 'Release' || 'Debug' }}
head_ref: ${{ github.event.pull_request.head.ref }}
base_ref: ${{ github.event.pull_request.base.ref }}
secrets: inherit
secrets: inherit
status_check:
runs-on: ubuntu-latest
needs: run-matrix
if: ${{ always() }}
steps:
- name: Check for failed jobs
shell: bash
run: |
if [ -n "${{ needs.run-matrix.result }}" != "success" ]; then
echo "Some jobs failed. Please check the logs."
exit 1
else
echo "All jobs completed successfully."
fi
66 changes: 65 additions & 1 deletion CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
"name": "warnings_base",
"hidden": true,
"environment": {
"TARGET_FLAGS": "-Wall -Wextra -Wpedantic -Wold-style-cast -Wconversion -Wshadow -Wno-error"
"TARGET_FLAGS": "-Wall -Wextra -Wpedantic -Wshadow -Werror"
}
},
{
Expand Down Expand Up @@ -628,6 +628,36 @@
"lhs": "${hostSystemName}",
"rhs": "Linux"
}
},
{
"name": "warnings_linux_gcc_libstdcxx",
"configurePreset": "warnings_linux_gcc_libstdcxx",
"execution": {
"jobs": 1
},
"output": {
"verbosity": "verbose"
},
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Linux"
}
},
{
"name": "warnings_linux_clang_libcxx",
"configurePreset": "warnings_linux_clang_libcxx",
"execution": {
"jobs": 1
},
"output": {
"verbosity": "verbose"
},
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Linux"
}
}
],
"workflowPresets": [
Expand Down Expand Up @@ -800,6 +830,40 @@
"name": "benchmark_linux_clang_libcxx"
}
]
},
{
"name": "warnings_linux_gcc_libstdcxx",
"steps": [
{
"type": "configure",
"name": "warnings_linux_gcc_libstdcxx"
},
{
"type": "build",
"name": "warnings_linux_gcc_libstdcxx"
},
{
"type": "test",
"name": "warnings_linux_gcc_libstdcxx"
}
]
},
{
"name": "warnings_linux_clang_libcxx",
"steps": [
{
"type": "configure",
"name": "warnings_linux_clang_libcxx"
},
{
"type": "build",
"name": "warnings_linux_clang_libcxx"
},
{
"type": "test",
"name": "warnings_linux_clang_libcxx"
}
]
}
]
}
12 changes: 6 additions & 6 deletions include/bitlib/bit-algorithms/accumulate.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ constexpr auto accumulate(
} else {
sub_digits = std::min(last.position(), total_bits_to_op);
if (sub_digits != 0) {
advance(last, -sub_digits);
reverse(last, sub_digits);
acc = binary_op_subword(std::move(acc), get_masked_word<word_type>(last, sub_digits), sub_digits);
}
}
Expand All @@ -63,15 +63,15 @@ constexpr auto accumulate(
acc = binary_op(std::move(acc), get_word<word_type>(first));
advance(first, digits);
} else {
advance(last, -digits);
reverse(last, digits);
acc = binary_op(std::move(acc), get_word<word_type>(last));
}
}
if (remaining_bits_to_op > 0) {
if constexpr (forward) {
acc = binary_op_subword(std::move(acc), get_masked_word<word_type>(first, remaining_bits_to_op), remaining_bits_to_op);
} else {
advance(last, -remaining_bits_to_op);
reverse(last, remaining_bits_to_op);
acc = binary_op_subword(std::move(acc), get_masked_word<word_type>(last, remaining_bits_to_op), remaining_bits_to_op);
}
}
Expand Down Expand Up @@ -106,7 +106,7 @@ constexpr auto accumulate_while(
} else {
sub_digits = std::min(last.position(), total_bits_to_op);
if (sub_digits != 0) {
advance(last, -sub_digits);
reverse(last, sub_digits);
std::tie(keep_going, acc) = binary_op_subword(std::move(acc), get_masked_word<word_type>(first, sub_digits), sub_digits);
}
}
Expand All @@ -125,7 +125,7 @@ constexpr auto accumulate_while(
std::tie(keep_going, acc) = binary_op(std::move(acc), get_word<word_type>(first));
advance(first, digits);
} else {
advance(last, -digits);
reverse(last, digits);
std::tie(keep_going, acc) = binary_op(std::move(acc), get_word<word_type>(last));
}
if (!keep_going) {
Expand All @@ -136,7 +136,7 @@ constexpr auto accumulate_while(
if constexpr (forward) {
std::tie(std::ignore, acc) = binary_op_subword(std::move(acc), get_masked_word<word_type>(first, remaining_bits_to_op), remaining_bits_to_op);
} else {
advance(last, -remaining_bits_to_op);
reverse(last, remaining_bits_to_op);
std::tie(std::ignore, acc) = binary_op_subword(std::move(acc), get_masked_word<word_type>(last, remaining_bits_to_op), remaining_bits_to_op);
}
}
Expand Down
Loading
Loading