Skip to content

Commit

Permalink
Merge pull request #963 from Cyan4973/test_visual
Browse files Browse the repository at this point in the history
Fix Visual warnings in xxh_x86dispatch.c
  • Loading branch information
Cyan4973 authored Sep 5, 2024
2 parents c1c3dcb + a26c58a commit 3e321b4
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 23 deletions.
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

0 comments on commit 3e321b4

Please sign in to comment.