Rename u32, io_reader, etc to base.u32, etc

This commit is contained in:
Nigel Tao committed 2018-04-12 21:49:17 +10:00
1 parent fee97df698
commit f95239f6e0
24 files changed
+394 -392

No files matched your search

+6 -6
View File
@@ -16,7 +16,7 @@ packageid "crc3"
// TODO: drop the '?' but still generate wuffs_crc32__ieee__initialize?
pub struct ieee?(
state u32,
state base.u32,
)
// TODO: add a ! as this function is impure.
@@ -24,11 +24,11 @@ pub struct ieee?(
// TODO: should it be ? instead of ! because it's public, and might need a way
// to signal "initializer not called"? Should the return type, in the generated
// C code, be "struct{ uint32_t checksum; wuffs_crc32__status status }"?
pub func ieee.update(x slice u8)(checksum u32) {
var s u32 = 0xFFFFFFFF ^ this.state
pub func ieee.update(x slice base.u8)(checksum base.u32) {
var s base.u32 = 0xFFFFFFFF ^ this.state
iterate[1](p ptr u8:in.x) {
s = ieee_table[((s & 0xFF) as u8) ^ deref p] ^ (s >> 8)
iterate[1](p ptr base.u8:in.x) {
s = ieee_table[((s & 0xFF) as base.u8) ^ deref p] ^ (s >> 8)
}
this.state = 0xFFFFFFFF ^ s
@@ -37,7 +37,7 @@ pub func ieee.update(x slice u8)(checksum u32) {
// The table below was created by script/print-crc32-magic-numbers.go.
pri const ieee_table array[256] u32 = $(
pri const ieee_table array[256] base.u32 = $(
0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA, 0x076DC419, 0x706AF48F, 0xE963A535, 0x9E6495A3,
0x0EDB8832, 0x79DCB8A4, 0xE0D5E91E, 0x97D2D988, 0x09B64C2B, 0x7EB17CBD, 0xE7B82D07, 0x90BF1D91,
0x1DB71064, 0x6AB020F2, 0xF3B97148, 0x84BE41DE, 0x1ADAD47D, 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7,