Merge branch 'feature/mem_cast' into development

This commit is contained in:
John Wellbelove 2021-06-14 14:20:38 +01:00
commit 892529b0f2
2 changed files with 6 additions and 2 deletions

View File

@ -1,7 +1,7 @@
name: clang
on:
push:
branches: [ master ]
branches: [ feature/mem_cast ]
pull_request:
branches: [ master ]
@ -18,6 +18,8 @@ jobs:
- name: Build
run: |
sudo apt-get update
sudo apt-get install -y "clang-9" "lldb-9" "lld-9" "clang-format-9"
export CC=clang-9
export CXX=clang++-9
cmake -D BUILD_TESTS=ON ./

View File

@ -529,7 +529,9 @@ namespace etl
//***********************************
ETL_NODISCARD size_t alignment() const
{
const uintptr_t p = reinterpret_cast<uintptr_t>(pbuffer);
typedef typename etl::smallest_uint_for_bits<sizeof(uintptr_t)* CHAR_BIT>::type type;
const type p = reinterpret_cast<type>(pbuffer);
return 1U << etl::count_trailing_zeros(p);
}