diff --git a/lib/std/hash/crc32.c3 b/lib/std/hash/crc32.c3 index 7b265deb6..9440dc1fb 100644 --- a/lib/std/hash/crc32.c3 +++ b/lib/std/hash/crc32.c3 @@ -8,29 +8,29 @@ struct Crc32 uint result; } -fn void Crc32.init(&this, uint seed = 0) +fn void Crc32.init(&self, uint seed = 0) { - this.result = ~seed; + self.result = ~seed; } -fn void Crc32.updatec(&this, char c) +fn void Crc32.updatec(&self, char c) { - this.result = (this.result >> 8) ^ CRC32_TABLE[(this.result ^ c) & 0xFF]; + self.result = (self.result >> 8) ^ CRC32_TABLE[(self.result ^ c) & 0xFF]; } -fn void Crc32.update(&this, char[] data) +fn void Crc32.update(&self, char[] data) { - uint result = this.result; + uint result = self.result; foreach (char x : data) { result = (result >> 8) ^ CRC32_TABLE[(result ^ x) & 0xFF]; } - this.result = result; + self.result = result; } -fn uint Crc32.final(&this) +fn uint Crc32.final(&self) { - return ~this.result; + return ~self.result; } fn uint encode(char[] data) diff --git a/lib/std/hash/crc64.c3 b/lib/std/hash/crc64.c3 index 4726ab40a..e44898218 100644 --- a/lib/std/hash/crc64.c3 +++ b/lib/std/hash/crc64.c3 @@ -8,29 +8,29 @@ struct Crc64 ulong result; } -fn void Crc64.init(&this, uint seed = 0) +fn void Crc64.init(&self, uint seed = 0) { - this.result = seed; + self.result = seed; } -fn void Crc64.updatec(&this, char c) +fn void Crc64.updatec(&self, char c) { - this.result = (this.result << 8) ^ CRC64_TABLE[(char)((this.result >> 56) ^ c)]; + self.result = (self.result << 8) ^ CRC64_TABLE[(char)((self.result >> 56) ^ c)]; } -fn void Crc64.update(&this, char[] data) +fn void Crc64.update(&self, char[] data) { - ulong result = this.result; + ulong result = self.result; foreach (char x : data) { result = (result << 8) ^ CRC64_TABLE[(char)((result >> 56) ^ x)]; } - this.result = result; + self.result = result; } -fn ulong Crc64.final(&this) +fn ulong Crc64.final(&self) { - return this.result; + return self.result; } fn ulong encode(char[] data) diff --git a/lib/std/hash/fnv32a.c3 b/lib/std/hash/fnv32a.c3 index 443aaf5f3..f200180f0 100644 --- a/lib/std/hash/fnv32a.c3 +++ b/lib/std/hash/fnv32a.c3 @@ -10,24 +10,24 @@ const FNV32A_MUL @private = 0x01000193; macro void @update(uint &h, char x) @private => h = (h * FNV32A_MUL) ^ x; -fn void Fnv32a.init(&this) +fn void Fnv32a.init(&self) { - *this = FNV32A_START; + *self = FNV32A_START; } -fn void Fnv32a.update(&this, char[] data) +fn void Fnv32a.update(&self, char[] data) { - uint h = (uint)*this; + uint h = (uint)*self; foreach (char x : data) { @update(h, x); } - *this = (Fnv32a)h; + *self = (Fnv32a)h; } -macro void Fnv32a.update_char(&this, char c) +macro void Fnv32a.update_char(&self, char c) { - @update(*this, x); + @update(*self, x); } fn uint encode(char[] data) diff --git a/lib/std/hash/fnv64a.c3 b/lib/std/hash/fnv64a.c3 index 838520bcb..40207b6dc 100644 --- a/lib/std/hash/fnv64a.c3 +++ b/lib/std/hash/fnv64a.c3 @@ -10,24 +10,24 @@ const FNV64A_MUL @private = 0x00000100000001b3; macro void @update(ulong &h, char x) @private => h = (h * FNV64A_MUL) ^ x; -fn void Fnv64a.init(&this) +fn void Fnv64a.init(&self) { - *this = FNV64A_START; + *self = FNV64A_START; } -fn void Fnv64a.update(&this, char[] data) +fn void Fnv64a.update(&self, char[] data) { - ulong h = (ulong)*this; + ulong h = (ulong)*self; foreach (char x : data) { @update(h, x); } - *this = (Fnv64a)h; + *self = (Fnv64a)h; } -macro void Fnv64a.update_char(&this, char c) +macro void Fnv64a.update_char(&self, char c) { - @update(*this, x); + @update(*self, x); } fn ulong encode(char[] data)