From b13195f2dc9a815e8128c8bbd37cf2f4400b4541 Mon Sep 17 00:00:00 2001 From: Rose <83477269+AtariDreams@users.noreply.github.com> Date: Thu, 16 Feb 2023 12:27:22 -0500 Subject: Use const and static for member functions This shows that these are member functions that do not modify a class's data. --- absl/crc/internal/crc.cc | 4 ++-- absl/crc/internal/crc_internal.h | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'absl/crc/internal') diff --git a/absl/crc/internal/crc.cc b/absl/crc/internal/crc.cc index 337a173f..87202165 100644 --- a/absl/crc/internal/crc.cc +++ b/absl/crc/internal/crc.cc @@ -261,7 +261,7 @@ void CRC32::Extend(uint32_t* crc, const void* bytes, size_t length) const { const uint8_t* e = p + length; uint32_t l = *crc; - auto step_one_byte = [this, &p, &l] () { + auto step_one_byte = [this, &p, &l]() { int c = (l & 0xff) ^ *p++; l = this->table0_[c] ^ (l >> 8); }; @@ -359,7 +359,7 @@ void CRC32::Extend(uint32_t* crc, const void* bytes, size_t length) const { void CRC32::ExtendByZeroesImpl(uint32_t* crc, size_t length, const uint32_t zeroes_table[256], - const uint32_t poly_table[256]) const { + const uint32_t poly_table[256]) { if (length != 0) { uint32_t l = *crc; // For each ZEROES_BASE_LG bits in length diff --git a/absl/crc/internal/crc_internal.h b/absl/crc/internal/crc_internal.h index 9f080913..3a047880 100644 --- a/absl/crc/internal/crc_internal.h +++ b/absl/crc/internal/crc_internal.h @@ -118,9 +118,9 @@ class CRC32 : public CRCImpl { // // These will be set to reverse_zeroes_ and reverse_table0_ for Unextend, and // CRC32::zeroes_ and CRC32::table0_ for Extend. - void ExtendByZeroesImpl(uint32_t* crc, size_t length, - const uint32_t zeroes_table[256], - const uint32_t poly_table[256]) const; + static void ExtendByZeroesImpl(uint32_t* crc, size_t length, + const uint32_t zeroes_table[256], + const uint32_t poly_table[256]); uint32_t table0_[256]; // table of byte extensions uint32_t zeroes_[256]; // table of zero extensions -- cgit v1.2.3