Skip to content

Commit 6941350

Browse files
committed
[build] Redeveloped and improved setting C/C++ standards in the build system (#1251)
* C/C++ standards support added to `qpl_set_common_target_properties()` CMake function: * C/C++ standard is set for a target in the following way: * If the required version of C/C++ standard is supported by CMake [`C_STANDARD`](https://cmake.org/cmake/help/latest/prop_tgt/C_STANDARD.html)/[`CXX_STANDARD`](https://cmake.org/cmake/help/latest/prop_tgt/CXX_STANDARD.html) properties, then these properties are set for the target (together with [`C_EXTENSIONS`](https://cmake.org/cmake/help/latest/prop_tgt/C_EXTENSIONS.html)/[`CXX_EXTENSIONS`](https://cmake.org/cmake/help/latest/prop_tgt/CXX_EXTENSIONS.html) set to `OFF` and [`C_STANDARD_REQUIRED`](https://cmake.org/cmake/help/latest/prop_tgt/C_STANDARD.html)/[`CXX_STANDARD_REQUIRED`](https://cmake.org/cmake/help/latest/prop_tgt/CXX_STANDARD_REQUIRED.html) set to `ON`). Otherwise, `-std=...` (Linux) and `/std:` (Windows) flags are set. * If the required version of C/C++ language feature ([`c_std_<version>`](https://cmake.org/cmake/help/latest/prop_gbl/CMAKE_C_KNOWN_FEATURES.html#high-level-meta-features-indicating-c-standard-support)/[`cxx_std_<version>`](https://cmake.org/cmake/help/latest/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.html#high-level-meta-features-indicating-c-standard-support)) is supported by CMake, then it is activated for the target additionally. * C/C++ compiler flags have been fixed in all `CMakeLists.txt` files: * If C/C++ standard set for a component was C17 or C++17, then the corresponding setting has been removed (since C17 and C++17 are set by default in `qpl_set_common_target_properties()` now). * If some other version of the standards was set, then it is passed via arguments `C` or `CXX` to `qpl_set_common_target_properties()` function call now (if there were no function call of this function previosly for a particular target, it has been added). * A non-existent standard C18 was used for the build of some components using MSVC previously; all such occurrences have been replaced with C17. * C/C++ standard conformance warnings are enabled: * Windows: [`/permissive-`](https://learn.microsoft.com/en-us/cpp/build/reference/permissive-standards-conformance), [`/volatile:iso`](https://learn.microsoft.com/en-us/cpp/build/reference/volatile-volatile-keyword-interpretation) * Linux: [`-pedantic`](https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-pedantic) or `-pedantic-errors` (depending on the value of `QPL_TREAT_WARNINGS_AS_ERRORS` CMake option) * Fixed mostly all standard conformance warnings for all supported compilers. The warnings remained unfixed are suppressed using `#pragma GCC diagnostic ignored` (for gcc and clang): * Fixed warnings: * Redundant semicolons have been removed, including: * `QPL_API` and `OWN_QPLC_API` macros don't have a trailing semicolon anymore; semicolons have been added after the usage of these macros where it was needed. * `OWN_CRC32` variadic macro was converted into an ordinary macro (receiving CRC calculation implementation as its last argument). `GZIP_REFL` is now passed to all existing occurrences of this macro (to preserve old behavior). * C function `hw_get_job_size()` which takes no arguments has been marked as receiving `void`. * `hw_configuration_driver.c` is conditionally included in build now using CMake rules, not `#if ... #endif` language constructs (to avoid empty translation units). * Pointers to functions in C are stored in variables of the type `void (*)(void)` now, not `void*`. * POSIX compliance level for Linux builds of ISA-L has been set to 200809L (to use `strnlen()` function on Linux). * Suppressed warnings: * Conversion of function pointers returned from `dlsym()` function (of the type `void*`) to variables storing pointers to functions. * Anonymous `struct`s and `union`s, including nested ones.
1 parent 976e00f commit 6941350

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+506
-313
lines changed

Doxyfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2150,14 +2150,14 @@ INCLUDE_FILE_PATTERNS =
21502150
# recursively expanded use the := operator instead of the = operator.
21512151
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
21522152

2153-
PREDEFINED = "QPL_API(type,name,arg)=type name arg;" \
2153+
PREDEFINED = "QPL_API(type,name,arg)=type name arg" \
21542154
"OWN_FUN(type,name,arg)=type name arg" \
21552155
"QPL_FUN(type,name,arg)=type name arg" \
21562156
"HW_PATH_GENERAL_API(type,name,arg)=type hw_##name arg" \
21572157
"HW_PATH_IAA_API(type,name,arg)=type hw_iaa_##name arg" \
21582158
"HW_PATH_IAA_AECS_API(type,name,arg)=type hw_iaa_aecs_##name arg" \
21592159
"HW_PATH_BYTE_PACKED_STRUCTURE_BEGIN=typedef struct" \
2160-
"OWN_QPLC_API(type,name,arg)=type name arg;" \
2160+
"OWN_QPLC_API(type,name,arg)=type name arg" \
21612161
"OWN_QPLC_FUN(type,name,arg)=type name arg" \
21622162
"QPL_DEPRECATED(msg)=" \
21632163
"QPL_PROCESSING_ERROR_BASE=0U" \

cmake/target_settings.cmake

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,140 @@
44
# SPDX-License-Identifier: MIT
55
# ==========================================================================
66

7+
# Intel® Query Processing Library (Intel® QPL)
8+
9+
# Build system
10+
711
include_guard(GLOBAL)
812

13+
set(QPL_LANGUAGES C CXX)
14+
set(QPL_DEFAULT_C_STANDARD 17)
15+
set(QPL_DEFAULT_CXX_STANDARD 17)
16+
17+
# Sets the language standard of the given language ${language} for the given target ${target_name} to the given version ${version}.
18+
function (qpl_set_language_standard target_name language version)
19+
if (NOT language IN_LIST QPL_LANGUAGES)
20+
message(
21+
FATAL_ERROR
22+
"Intel(R) QPL: Unsupported language '${language}' specified for target '${target_name}'. Supported languages are: ${QPL_LANGUAGES}.")
23+
endif ()
24+
if (language STREQUAL "C")
25+
set(language_prefix "c")
26+
elseif (language STREQUAL "CXX")
27+
set(language_prefix "c++")
28+
endif ()
29+
set(language_standard "${language_prefix}${version}")
30+
# Set the language standard using `<LANG>_STANDARD` target property if it is supported by CMake (otherwise, use the compile option
31+
# `-std=<standard>`)
32+
set(language_version_is_supported_by_cmake FALSE)
33+
if (language STREQUAL "C")
34+
# https://cmake.org/cmake/help/latest/prop_tgt/C_STANDARD.html
35+
if (((version GREATER_EQUAL 90 OR version VERSION_LESS 17) AND CMAKE_VERSION VERSION_GREATER_EQUAL "3.1")
36+
OR (version VERSION_LESS_EQUAL 23 AND CMAKE_VERSION VERSION_GREATER_EQUAL "3.21"))
37+
set(language_version_is_supported_by_cmake TRUE)
38+
endif ()
39+
if (version VERSION_GREATER 23 AND version VERSION_LESS 90)
40+
message(
41+
FATAL_ERROR
42+
"Intel(R) QPL: C standard version '${version}' is not supported by Intel(R) QPL build system. Please, fix this CMake file to add support for this version."
43+
)
44+
endif ()
45+
elseif (language STREQUAL "CXX")
46+
# https://cmake.org/cmake/help/latest/prop_tgt/CXX_STANDARD.html
47+
if (((version GREATER_EQUAL 98 OR version VERSION_LESS 17) AND CMAKE_VERSION VERSION_GREATER_EQUAL "3.1")
48+
OR (version VERSION_EQUAL 17 AND CMAKE_VERSION VERSION_GREATER_EQUAL "3.8")
49+
OR (version VERSION_EQUAL 20 AND CMAKE_VERSION VERSION_GREATER_EQUAL "3.12")
50+
OR (version VERSION_EQUAL 23 AND CMAKE_VERSION VERSION_GREATER_EQUAL "3.20")
51+
OR (version VERSION_EQUAL 26 AND CMAKE_VERSION VERSION_GREATER_EQUAL "3.25"))
52+
set(language_version_is_supported_by_cmake TRUE)
53+
endif ()
54+
if (version VERSION_GREATER 26 AND version VERSION_LESS 98)
55+
message(
56+
FATAL_ERROR
57+
"Intel(R) QPL: C++ standard version '${version}' is not supported by Intel(R) QPL build system. Please, fix this CMake file to add support for this version."
58+
)
59+
endif ()
60+
endif ()
61+
if (language_version_is_supported_by_cmake)
62+
set_target_properties(
63+
${target_name}
64+
PROPERTIES ${language}_STANDARD ${version}
65+
${language}_EXTENSIONS OFF
66+
${language}_STANDARD_REQUIRED ON)
67+
else ()
68+
target_compile_options(
69+
${target_name} PRIVATE $<$<AND:$<COMPILE_LANGUAGE:${language}>,$<${language}_COMPILER_ID:GNU,Clang>>:-std=${language_standard}>
70+
$<$<AND:$<COMPILE_LANGUAGE:${language}>,$<${language}_COMPILER_ID:MSVC>>:/std:${language_standard}>)
71+
endif ()
72+
# Additionally, set the language standard using `<lang>_std_<version>` compile feature if it is supported by CMake
73+
set(language_feature_is_supported_by_cmake FALSE)
74+
if (language STREQUAL "C")
75+
# https://cmake.org/cmake/help/latest/prop_gbl/CMAKE_C_KNOWN_FEATURES.html
76+
if (((version GREATER_EQUAL 90 OR version VERSION_LESS 17) AND CMAKE_VERSION VERSION_GREATER_EQUAL "3.8")
77+
OR (version VERSION_LESS_EQUAL 23 AND CMAKE_VERSION VERSION_GREATER_EQUAL "3.21"))
78+
set(language_feature_is_supported_by_cmake TRUE)
79+
endif ()
80+
if (version VERSION_GREATER 23 AND version VERSION_LESS 90)
81+
message(FATAL_ERROR "Intel(R) QPL: C standard version feature 'c_std_${version}' is not supported by Intel(R) QPL build system. \
82+
Please, fix this CMake file to add support for this version.")
83+
endif ()
84+
elseif (language STREQUAL "CXX")
85+
# https://cmake.org/cmake/help/latest/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.html
86+
if (((version GREATER_EQUAL 98 OR version VERSION_LESS 20) AND CMAKE_VERSION VERSION_GREATER_EQUAL "3.8")
87+
OR (version VERSION_EQUAL 20 AND CMAKE_VERSION VERSION_GREATER_EQUAL "3.12")
88+
OR (version VERSION_EQUAL 23 AND CMAKE_VERSION VERSION_GREATER_EQUAL "3.20")
89+
OR (version VERSION_EQUAL 26 AND CMAKE_VERSION VERSION_GREATER_EQUAL "3.30"))
90+
set(language_feature_is_supported_by_cmake TRUE)
91+
endif ()
92+
if (version VERSION_GREATER 26 AND version VERSION_LESS 98)
93+
message(FATAL_ERROR "Intel(R) QPL: C++ standard version feature 'cxx_std_${version}' is not supported by Intel(R) QPL build system. \
94+
Please, fix this CMake file to add support for this version.")
95+
endif ()
96+
endif ()
97+
if (language_feature_is_supported_by_cmake)
98+
set(language_feature "${language}_std_${version}")
99+
string(TOLOWER "${language_feature}" language_feature)
100+
target_compile_features(${target_name} PRIVATE ${language_feature})
101+
endif ()
102+
endfunction ()
103+
104+
# Sets C and C++ language standards for the given target ${target_name}.
105+
#
106+
# Defaults are C17 and C++17.
107+
function (qpl_set_language_standards target_name)
108+
cmake_parse_arguments(
109+
"ARGUMENT" # prefix
110+
"" # options
111+
"${QPL_LANGUAGES}" # one-value arguments
112+
"" # multi-value arguments
113+
${ARGN})
114+
foreach (language IN LISTS QPL_LANGUAGES)
115+
if (NOT DEFINED ARGUMENT_${language})
116+
set(ARGUMENT_${language} ${QPL_DEFAULT_${language}_STANDARD})
117+
endif ()
118+
qpl_set_language_standard(${target_name} ${language} ${ARGUMENT_${language}})
119+
endforeach ()
120+
endfunction ()
121+
9122
option(QPL_TREAT_WARNINGS_AS_ERRORS "Treat all compiler warnings as errors" ON)
10123

11124
# Enables all reasonable warnings for a target with the given name ${target_name}.
12125
#
13126
# Treats them as errors if $CACHE{QPL_TREAT_WARNINGS_AS_ERRORS} option is set to ON.
14127
function (qpl_enable_warnings target_name)
128+
# TODO: enable warnings here, and not in CMakeLists.txt files
129+
130+
# Enable C/C++ standard conformance warnings
131+
if (MSVC)
132+
target_compile_options(${target_name} PRIVATE /permissive- /volatile:iso)
133+
else ()
134+
if ($CACHE{QPL_TREAT_WARNINGS_AS_ERRORS})
135+
target_compile_options(${target_name} PRIVATE -pedantic-errors)
136+
else ()
137+
target_compile_options(${target_name} PRIVATE -pedantic)
138+
endif ()
139+
endif ()
140+
# Treat warnings as errors
15141
if ($CACHE{QPL_TREAT_WARNINGS_AS_ERRORS})
16142
if (MSVC)
17143
target_compile_options(${target_name} PRIVATE /WX)
@@ -23,5 +149,6 @@ endfunction ()
23149

24150
# Sets common target settings for the target with the given name ${target_name}.
25151
function (qpl_set_common_target_settings target_name)
152+
qpl_set_language_standards(${target_name} ${ARGN})
26153
qpl_enable_warnings(${target_name})
27154
endfunction ()

examples/low-level-api/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ foreach(source_file ${cpp_files})
4949
target_link_libraries(${example_name} PRIVATE accel-config)
5050
target_compile_definitions(${example_name} PRIVATE "QPL_EXAMPLES_USE_LIBACCEL_CONFIG")
5151
endif()
52-
set_target_properties(${example_name} PROPERTIES CXX_STANDARD 17)
5352

5453
if(WIN32)
5554
target_compile_options(${example_name} PRIVATE "$<$<CONFIG:Release>:-O2>")

include/qpl/c_api/defs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ extern "C" {
3232
* @brief Macro to manipulate public API prototypes
3333
*/
3434
#if !defined(QPL_API)
35-
#define QPL_API(type, name, arg) type name arg;
35+
#define QPL_API(type, name, arg) type name arg
3636
#endif
3737

3838
#if !defined(UNREFERENCED_PARAMETER)

include/qpl/c_api/index_table.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ typedef struct {
6565
* - @ref QPL_STS_NULL_PTR_ERR.
6666
*/
6767
QPL_API(qpl_status, qpl_get_index_table_size,
68-
(uint32_t mini_block_count, uint32_t mini_blocks_per_block, size_t* size_ptr))
68+
(uint32_t mini_block_count, uint32_t mini_blocks_per_block, size_t* size_ptr));
6969

7070
/**
7171
* @brief Sets source pointer to required position for further mini-block decompression
@@ -83,7 +83,7 @@ QPL_API(qpl_status, qpl_get_index_table_size,
8383
*/
8484
QPL_API(qpl_status, qpl_set_mini_block_location,
8585
(uint32_t start_bit, uint32_t last_bit, uint8_t** source_pptr, uint32_t* first_bit_offset_ptr,
86-
uint32_t* last_bit_offset_ptr, uint32_t* compressed_size_ptr))
86+
uint32_t* last_bit_offset_ptr, uint32_t* compressed_size_ptr));
8787

8888
/**
8989
* @brief Sets appropriate deflate block index
@@ -97,7 +97,7 @@ QPL_API(qpl_status, qpl_set_mini_block_location,
9797
* - @ref QPL_STS_NULL_PTR_ERR.
9898
*/
9999
QPL_API(qpl_status, qpl_find_header_block_index,
100-
(qpl_index_table * table_ptr, uint32_t mini_block_number, uint32_t* block_index_ptr))
100+
(qpl_index_table * table_ptr, uint32_t mini_block_number, uint32_t* block_index_ptr));
101101

102102
/**
103103
* @brief Sets appropriate mini-block index
@@ -111,7 +111,7 @@ QPL_API(qpl_status, qpl_find_header_block_index,
111111
* - @ref QPL_STS_NULL_PTR_ERR.
112112
*/
113113
QPL_API(qpl_status, qpl_find_mini_block_index,
114-
(qpl_index_table * table_ptr, uint32_t mini_block_number, uint32_t* block_index_ptr))
114+
(qpl_index_table * table_ptr, uint32_t mini_block_number, uint32_t* block_index_ptr));
115115

116116
/** @} */
117117

include/qpl/c_api/job.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ typedef struct {
158158
* - @ref QPL_STS_OK;
159159
* - @ref QPL_STS_PATH_ERR.
160160
*/
161-
QPL_API(qpl_status, qpl_get_job_size, (qpl_path_t qpl_path, uint32_t* job_size_ptr))
161+
QPL_API(qpl_status, qpl_get_job_size, (qpl_path_t qpl_path, uint32_t* job_size_ptr));
162162

163163
/**
164164
* @brief Initializes the qpl_job structure and ensures proper alignment of internal structures.
@@ -179,7 +179,7 @@ QPL_API(qpl_status, qpl_get_job_size, (qpl_path_t qpl_path, uint32_t* job_size_p
179179
* - @ref QPL_STS_PATH_ERR;
180180
* - @ref QPL_STS_NULL_PTR_ERR.
181181
*/
182-
QPL_API(qpl_status, qpl_init_job, (qpl_path_t qpl_path, qpl_job* qpl_job_ptr))
182+
QPL_API(qpl_status, qpl_init_job, (qpl_path_t qpl_path, qpl_job* qpl_job_ptr));
183183

184184
/**
185185
* @brief Parses the qpl_job structure and forms the corresponding processing functions pipeline.
@@ -188,7 +188,7 @@ QPL_API(qpl_status, qpl_init_job, (qpl_path_t qpl_path, qpl_job* qpl_job_ptr))
188188
*
189189
* @return One of statuses presented in the @ref qpl_status
190190
*/
191-
QPL_API(qpl_status, qpl_execute_job, (qpl_job * qpl_job_ptr))
191+
QPL_API(qpl_status, qpl_execute_job, (qpl_job * qpl_job_ptr));
192192

193193
/**
194194
* @brief Parses the qpl_job structure and forms the corresponding processing functions pipeline.
@@ -199,7 +199,7 @@ QPL_API(qpl_status, qpl_execute_job, (qpl_job * qpl_job_ptr))
199199
* @return One of statuses presented in the @ref qpl_status
200200
*
201201
*/
202-
QPL_API(qpl_status, qpl_submit_job, (qpl_job * qpl_job_ptr))
202+
QPL_API(qpl_status, qpl_submit_job, (qpl_job * qpl_job_ptr));
203203

204204
/**
205205
* @brief Waits for the end of @ref qpl_job processing. (waits until the job is completed)
@@ -209,7 +209,7 @@ QPL_API(qpl_status, qpl_submit_job, (qpl_job * qpl_job_ptr))
209209
* @return One of statuses presented in the @ref qpl_status
210210
*
211211
*/
212-
QPL_API(qpl_status, qpl_wait_job, (qpl_job * qpl_job_ptr))
212+
QPL_API(qpl_status, qpl_wait_job, (qpl_job * qpl_job_ptr));
213213

214214
/**
215215
* @brief Checks the status of @ref qpl_job processing. (can be queried periodically to check the status
@@ -219,7 +219,7 @@ QPL_API(qpl_status, qpl_wait_job, (qpl_job * qpl_job_ptr))
219219
*
220220
* @return One of statuses presented in the @ref qpl_status
221221
*/
222-
QPL_API(qpl_status, qpl_check_job, (qpl_job * qpl_job_ptr))
222+
QPL_API(qpl_status, qpl_check_job, (qpl_job * qpl_job_ptr));
223223

224224
/**
225225
* @brief Completes @ref qpl_job lifecycle: disconnects from the internal library context, frees internal resources.
@@ -228,7 +228,7 @@ QPL_API(qpl_status, qpl_check_job, (qpl_job * qpl_job_ptr))
228228
*
229229
* @return ne of statuses presented in the @ref qpl_status
230230
*/
231-
QPL_API(qpl_status, qpl_fini_job, (qpl_job * qpl_job_ptr))
231+
QPL_API(qpl_status, qpl_fini_job, (qpl_job * qpl_job_ptr));
232232

233233
/** @} */
234234

include/qpl/c_api/statistics.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ typedef struct {
7474
*/
7575
QPL_API(qpl_status, qpl_gather_deflate_statistics,
7676
(uint8_t * source_ptr, const uint32_t source_length, qpl_histogram* histogram_ptr,
77-
const qpl_compression_levels level, const qpl_path_t path))
77+
const qpl_compression_levels level, const qpl_path_t path));
7878

7979
/** @} */
8080

include/qpl/c_api/utility.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ extern "C" {
4040
*
4141
* @return uint32_t
4242
*/
43-
QPL_API(uint32_t, qpl_get_safe_deflate_compression_buffer_size, (uint32_t source_size))
43+
QPL_API(uint32_t, qpl_get_safe_deflate_compression_buffer_size, (uint32_t source_size));
4444

4545
/** @} */
4646

sources/c_api/CMakeLists.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,6 @@ target_include_directories(qpl_c_api
3939
PRIVATE $<TARGET_PROPERTY:middle_layer_lib,INTERFACE_INCLUDE_DIRECTORIES>)
4040

4141
set_target_properties(qpl_c_api PROPERTIES
42-
$<$<C_COMPILER_ID:MSVC>:C_STANDARD 18>
43-
$<$<C_COMPILER_ID:GNU,Clang>:C_STANDARD 17>
44-
CXX_STANDARD 17
4542
C_VISIBILITY_PRESET hidden
4643
CXX_VISIBILITY_PRESET hidden)
4744

sources/c_api/compression_operations/own_deflate_job.c

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@
2020
#include "deflate_histogram.h"
2121
#include "qplc_compression_consts.h"
2222

23-
#define OWN_CRC32(buf, len, init_crc, ...) \
24-
((0, ##__VA_ARGS__) ? qpl_crc32_iscsi(buf, len, init_crc) : qpl_crc32_gzip_refl(init_crc, buf, len))
25-
2623
/* ------ Own functions implementation ------ */
2724

2825
void own_deflate_job_switch_to_next(own_deflate_job* const job_ptr, const uint32_t range) {
@@ -34,8 +31,9 @@ static inline void own_deflate_job_update_missed_literals(own_deflate_job* const
3431
const uint8_t* upper_bound_ptr) {
3532
while (job_ptr->current_ptr < upper_bound_ptr) {
3633
// Variables
37-
const uint32_t hash_value = OWN_CRC32(job_ptr->current_ptr, QPLC_DEFLATE_BYTES_FOR_HASH_CALCULATION, 0U) &
38-
job_ptr->histogram_ptr->table.hash_mask;
34+
const uint32_t hash_value =
35+
OWN_CRC32(job_ptr->current_ptr, QPLC_DEFLATE_BYTES_FOR_HASH_CALCULATION, 0U, GZIP_REFL) &
36+
job_ptr->histogram_ptr->table.hash_mask;
3937

4038
// Updating hash table
4139
own_deflate_hash_table_update(&job_ptr->histogram_ptr->table,
@@ -95,8 +93,8 @@ void own_deflate_job_process_literals_no_instructions(own_deflate_job* const job
9593
const uint32_t bytes_for_hash = QPL_MIN(QPLC_DEFLATE_BYTES_FOR_HASH_CALCULATION,
9694
(uint32_t)(upper_bound_ptr - job_ptr->current_ptr));
9795

98-
const uint32_t hash_value =
99-
OWN_CRC32(job_ptr->current_ptr, bytes_for_hash, 0U) & job_ptr->histogram_ptr->table.hash_mask;
96+
const uint32_t hash_value = OWN_CRC32(job_ptr->current_ptr, bytes_for_hash, 0U, GZIP_REFL) &
97+
job_ptr->histogram_ptr->table.hash_mask;
10098

10199
// Updating histogram
102100
job_ptr->histogram_ptr->literals_matches[*job_ptr->current_ptr]++;
@@ -111,8 +109,9 @@ void own_deflate_job_process_literals_no_instructions(own_deflate_job* const job
111109
} else {
112110
while (job_ptr->current_ptr < upper_bound_ptr) {
113111
// Variables
114-
const uint32_t hash_value = OWN_CRC32(job_ptr->current_ptr, QPLC_DEFLATE_BYTES_FOR_HASH_CALCULATION, 0U) &
115-
job_ptr->histogram_ptr->table.hash_mask;
112+
const uint32_t hash_value =
113+
OWN_CRC32(job_ptr->current_ptr, QPLC_DEFLATE_BYTES_FOR_HASH_CALCULATION, 0U, GZIP_REFL) &
114+
job_ptr->histogram_ptr->table.hash_mask;
116115

117116
// Updating histogram
118117
job_ptr->histogram_ptr->literals_matches[*job_ptr->current_ptr]++;

0 commit comments

Comments
 (0)