summaryrefslogtreecommitdiff
path: root/absl/crc/internal/crc_memcpy.h
diff options
context:
space:
mode:
authorGravatar Derek Mauro <dmauro@google.com>2022-11-29 09:19:04 -0800
committerGravatar Copybara-Service <copybara-worker@google.com>2022-11-29 09:19:57 -0800
commitd03cced7d552ece168c6db92acb3a7c379aae0c0 (patch)
treef5975b279620e410ad017ee09bceaee4c676fec1 /absl/crc/internal/crc_memcpy.h
parent82196f059f213c50738142a799bb166b2971950d (diff)
CRC: Make crc32c_t as a class for explicit control of operators
The motivation is to explicitly remove and document dangerous operations like adding crc32c_t to a set, because equality is not enough to guarantee uniqueness. PiperOrigin-RevId: 491656425 Change-Id: I7b4dadc1a59ea9861e6ec7a929d64b5746467832
Diffstat (limited to 'absl/crc/internal/crc_memcpy.h')
-rw-r--r--absl/crc/internal/crc_memcpy.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/absl/crc/internal/crc_memcpy.h b/absl/crc/internal/crc_memcpy.h
index 8e728a6e..ae9cccad 100644
--- a/absl/crc/internal/crc_memcpy.h
+++ b/absl/crc/internal/crc_memcpy.h
@@ -40,7 +40,7 @@ class CrcMemcpy {
public:
static crc32c_t CrcAndCopy(void* __restrict dst, const void* __restrict src,
std::size_t length,
- crc32c_t initial_crc = ToCrc32c(0),
+ crc32c_t initial_crc = crc32c_t{0},
bool non_temporal = false) {
static const ArchSpecificEngines engines = GetArchSpecificEngines();
auto* engine = non_temporal ? engines.non_temporal : engines.temporal;
@@ -100,7 +100,7 @@ class CrcNonTemporalMemcpyAVXEngine : public CrcMemcpyEngine {
// the generic fallback version.
inline crc32c_t Crc32CAndCopy(void* __restrict dst, const void* __restrict src,
std::size_t length,
- crc32c_t initial_crc = ToCrc32c(0),
+ crc32c_t initial_crc = crc32c_t{0},
bool non_temporal = false) {
return CrcMemcpy::CrcAndCopy(dst, src, length, initial_crc, non_temporal);
}