Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Visual warnings in xxh_x86dispatch.c #963

Merged
merged 4 commits into from
Sep 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
36 changes: 19 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,7 @@ jobs:
cd cmake_unofficial
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -A ${{ matrix.arch }} -DXXHASH_C_FLAGS="/WX"
cmake .. -DCMAKE_BUILD_TYPE=Release -A ${{ matrix.arch }} -DCMAKE_C_FLAGS="/W4 /WX"
cmake --build . --config Release

- name: Test
Expand All @@ -545,6 +545,24 @@ jobs:
run: |
.\cmake_unofficial\build\Release\xxhsum.exe -bi1

- name: Build ${{ matrix.system.os }}, ${{ matrix.arch }}, with DISPATCH
# DISPATCH only if target arch is x64 or Win32.
if: ${{ ( matrix.arch == 'x64' || matrix.arch == 'Win32' ) }}
run: |
cd cmake_unofficial
mkdir build-visual-dispatch
cd build-visual-dispatch
cmake .. -DCMAKE_BUILD_TYPE=Release -DDISPATCH=ON -A x64 -DCMAKE_C_FLAGS="/W4 /WX"
cmake --build . --config Release

- name: Runtime Test (DISPATCH)
# Run benchmark for testing only if target arch is x64 or Win32.
if: ${{ ( matrix.arch == 'x64' || matrix.arch == 'Win32' ) }}
run: |
.\cmake_unofficial\build-visual-dispatch\Release\xxhsum.exe -V | grep autoVec
.\cmake_unofficial\build-visual-dispatch\Release\xxhsum.exe -bi1


- name: Build ${{ matrix.system.os }}, clang-cl, ${{ matrix.arch }}
if: ${{ matrix.system.clangcl == 'true' }}
run: |
Expand All @@ -560,22 +578,6 @@ jobs:
run: |
.\cmake_unofficial\build-clang-cl\Release\xxhsum.exe -bi1

- name: Build ${{ matrix.system.os }}, clang-cl, ${{ matrix.arch }}, with DISPATCH
# DISPATCH only if target arch is x64 or Win32.
if: ${{ matrix.system.clangcl == 'true' && ( matrix.arch == 'x64' || matrix.arch == 'Win32' ) }}
run: |
cd cmake_unofficial
mkdir build-clang-cl-dispatch
cd build-clang-cl-dispatch
cmake .. -DCMAKE_BUILD_TYPE=Release -DDISPATCH=ON -A x64 -DCMAKE_GENERATOR_TOOLSET=ClangCL
cmake --build . --config Release

- name: Runtime Test (clang-cl + DISPATCH)
# Run benchmark for testing only if target arch is x64 or Win32.
if: ${{ matrix.system.clangcl == 'true' && ( matrix.arch == 'x64' || matrix.arch == 'Win32' ) }}
run: |
.\cmake_unofficial\build-clang-cl-dispatch\Release\xxhsum.exe -V | grep autoVec
.\cmake_unofficial\build-clang-cl-dispatch\Release\xxhsum.exe -bi1


# Windows, { mingw64, mingw32 }
Expand Down
12 changes: 6 additions & 6 deletions xxh_x86dispatch.c
Original file line number Diff line number Diff line change
Expand Up @@ -729,8 +729,8 @@ static XXH_CONSTRUCTOR void XXH_setDispatch(void)
/*! @cond Doxygen ignores this part */

static XXH64_hash_t
XXH3_hashLong_64b_defaultSecret_selection(const void* input, size_t len,
XXH64_hash_t seed64, const xxh_u8* secret, size_t secretLen)
XXH3_hashLong_64b_defaultSecret_selection(const void* XXH_RESTRICT input, size_t len,
XXH64_hash_t seed64, const xxh_u8* XXH_RESTRICT secret, size_t secretLen)
{
(void)seed64; (void)secret; (void)secretLen;
if (XXH_DISPATCH_MAYBE_NULL && XXH_g_dispatch.hashLong64_default == NULL)
Expand All @@ -744,8 +744,8 @@ XXH64_hash_t XXH3_64bits_dispatch(XXH_NOESCAPE const void* input, size_t len)
}

static XXH64_hash_t
XXH3_hashLong_64b_withSeed_selection(const void* input, size_t len,
XXH64_hash_t seed64, const xxh_u8* secret, size_t secretLen)
XXH3_hashLong_64b_withSeed_selection(const void* XXH_RESTRICT input, size_t len,
XXH64_hash_t seed64, const xxh_u8* XXH_RESTRICT secret, size_t secretLen)
{
(void)secret; (void)secretLen;
if (XXH_DISPATCH_MAYBE_NULL && XXH_g_dispatch.hashLong64_seed == NULL)
Expand All @@ -759,8 +759,8 @@ XXH64_hash_t XXH3_64bits_withSeed_dispatch(XXH_NOESCAPE const void* input, size_
}

static XXH64_hash_t
XXH3_hashLong_64b_withSecret_selection(const void* input, size_t len,
XXH64_hash_t seed64, const xxh_u8* secret, size_t secretLen)
XXH3_hashLong_64b_withSecret_selection(const void* XXH_RESTRICT input, size_t len,
XXH64_hash_t seed64, const xxh_u8* XXH_RESTRICT secret, size_t secretLen)
{
(void)seed64;
if (XXH_DISPATCH_MAYBE_NULL && XXH_g_dispatch.hashLong64_secret == NULL)
Expand Down
Loading