aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/restricted/aws/aws-checksums/source/crc.c
diff options
context:
space:
mode:
authororivej <orivej@yandex-team.ru>2022-02-10 16:44:49 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:44:49 +0300
commit718c552901d703c502ccbefdfc3c9028d608b947 (patch)
tree46534a98bbefcd7b1f3faa5b52c138ab27db75b7 /contrib/restricted/aws/aws-checksums/source/crc.c
parente9656aae26e0358d5378e5b63dcac5c8dbe0e4d0 (diff)
downloadydb-718c552901d703c502ccbefdfc3c9028d608b947.tar.gz
Restoring authorship annotation for <orivej@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'contrib/restricted/aws/aws-checksums/source/crc.c')
-rw-r--r--contrib/restricted/aws/aws-checksums/source/crc.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/contrib/restricted/aws/aws-checksums/source/crc.c b/contrib/restricted/aws/aws-checksums/source/crc.c
index f5d3e802fd..f4445f7316 100644
--- a/contrib/restricted/aws/aws-checksums/source/crc.c
+++ b/contrib/restricted/aws/aws-checksums/source/crc.c
@@ -1,29 +1,29 @@
-/**
- * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
- * SPDX-License-Identifier: Apache-2.0.
+/**
+ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ * SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/checksums/crc.h>
#include <aws/checksums/private/crc_priv.h>
-#include <aws/common/cpuid.h>
-
+#include <aws/common/cpuid.h>
+
static uint32_t (*s_crc32c_fn_ptr)(const uint8_t *input, int length, uint32_t previousCrc32) = 0;
-static uint32_t (*s_crc32_fn_ptr)(const uint8_t *input, int length, uint32_t previousCrc32) = 0;
+static uint32_t (*s_crc32_fn_ptr)(const uint8_t *input, int length, uint32_t previousCrc32) = 0;
uint32_t aws_checksums_crc32(const uint8_t *input, int length, uint32_t previousCrc32) {
- if (AWS_UNLIKELY(!s_crc32_fn_ptr)) {
- if (aws_cpu_has_feature(AWS_CPU_FEATURE_ARM_CRC)) {
- s_crc32_fn_ptr = aws_checksums_crc32_hw;
- } else {
- s_crc32_fn_ptr = aws_checksums_crc32_sw;
- }
- }
- return s_crc32_fn_ptr(input, length, previousCrc32);
+ if (AWS_UNLIKELY(!s_crc32_fn_ptr)) {
+ if (aws_cpu_has_feature(AWS_CPU_FEATURE_ARM_CRC)) {
+ s_crc32_fn_ptr = aws_checksums_crc32_hw;
+ } else {
+ s_crc32_fn_ptr = aws_checksums_crc32_sw;
+ }
+ }
+ return s_crc32_fn_ptr(input, length, previousCrc32);
}
uint32_t aws_checksums_crc32c(const uint8_t *input, int length, uint32_t previousCrc32) {
- if (AWS_UNLIKELY(!s_crc32c_fn_ptr)) {
- if (aws_cpu_has_feature(AWS_CPU_FEATURE_SSE_4_2) || aws_cpu_has_feature(AWS_CPU_FEATURE_ARM_CRC)) {
+ if (AWS_UNLIKELY(!s_crc32c_fn_ptr)) {
+ if (aws_cpu_has_feature(AWS_CPU_FEATURE_SSE_4_2) || aws_cpu_has_feature(AWS_CPU_FEATURE_ARM_CRC)) {
s_crc32c_fn_ptr = aws_checksums_crc32c_hw;
} else {
s_crc32c_fn_ptr = aws_checksums_crc32c_sw;