diff options
author | Rose <83477269+AtariDreams@users.noreply.github.com> | 2023-02-16 12:27:22 -0500 |
---|---|---|
committer | Rose <83477269+AtariDreams@users.noreply.github.com> | 2023-03-07 10:11:29 -0500 |
commit | b13195f2dc9a815e8128c8bbd37cf2f4400b4541 (patch) | |
tree | a4cbd27f6e63ee30b8b5bd4886d502e399590d77 /absl/crc | |
parent | eba70b1c2f5f1684490edb573302e2fd654f1335 (diff) |
Use const and static for member functions
This shows that these are member functions that do not modify a class's data.
Diffstat (limited to 'absl/crc')
-rw-r--r-- | absl/crc/internal/crc.cc | 4 | ||||
-rw-r--r-- | absl/crc/internal/crc_internal.h | 6 |
2 files changed, 5 insertions, 5 deletions
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 |