| author | |
| committer | |
| log | fec795cd29909f0e43ba9de303b93309db8858b5 |
| tree | 67b8b05a5fe60586dab16532d05f4ab7301ef015 |
| parent | f50bfb94b52424f2145b9a18b731a47b3faf9648 |
3 files changed, 9 insertions(+), 7 deletions(-)
std/hash/cityhash.zig+4-4| ... | @@ -214,7 +214,7 @@ pub const CityHash64 = struct { | ... | @@ -214,7 +214,7 @@ pub const CityHash64 = struct { |
| 214 | } | 214 | } |
| 215 | 215 | ||
| 216 | fn hashLen0To16(str: []const u8) u64 { | 216 | fn hashLen0To16(str: []const u8) u64 { |
| 217 | const len: u64 = @truncate(u64, str.len); | 217 | const len: u64 = u64(str.len); |
| 218 | if (len >= 8) { | 218 | if (len >= 8) { |
| 219 | const mul: u64 = k2 +% len *% 2; | 219 | const mul: u64 = k2 +% len *% 2; |
| 220 | const a: u64 = fetch64(str.ptr) +% k2; | 220 | const a: u64 = fetch64(str.ptr) +% k2; |
| ... | @@ -240,7 +240,7 @@ pub const CityHash64 = struct { | ... | @@ -240,7 +240,7 @@ pub const CityHash64 = struct { |
| 240 | } | 240 | } |
| 241 | 241 | ||
| 242 | fn hashLen17To32(str: []const u8) u64 { | 242 | fn hashLen17To32(str: []const u8) u64 { |
| 243 | const len: u64 = @truncate(u64, str.len); | 243 | const len: u64 = u64(str.len); |
| 244 | const mul: u64 = k2 +% len *% 2; | 244 | const mul: u64 = k2 +% len *% 2; |
| 245 | const a: u64 = fetch64(str.ptr) *% k1; | 245 | const a: u64 = fetch64(str.ptr) *% k1; |
| 246 | const b: u64 = fetch64(str.ptr + 8); | 246 | const b: u64 = fetch64(str.ptr + 8); |
| ... | @@ -251,7 +251,7 @@ pub const CityHash64 = struct { | ... | @@ -251,7 +251,7 @@ pub const CityHash64 = struct { |
| 251 | } | 251 | } |
| 252 | 252 | ||
| 253 | fn hashLen33To64(str: []const u8) u64 { | 253 | fn hashLen33To64(str: []const u8) u64 { |
| 254 | const len: u64 = @truncate(u64, str.len); | 254 | const len: u64 = u64(str.len); |
| 255 | const mul: u64 = k2 +% len *% 2; | 255 | const mul: u64 = k2 +% len *% 2; |
| 256 | const a: u64 = fetch64(str.ptr) *% k2; | 256 | const a: u64 = fetch64(str.ptr) *% k2; |
| 257 | const b: u64 = fetch64(str.ptr + 8); | 257 | const b: u64 = fetch64(str.ptr + 8); |
| ... | @@ -305,7 +305,7 @@ pub const CityHash64 = struct { | ... | @@ -305,7 +305,7 @@ pub const CityHash64 = struct { |
| 305 | return hashLen33To64(str); | 305 | return hashLen33To64(str); |
| 306 | } | 306 | } |
| 307 | 307 | ||
| 308 | var len: u64 = @truncate(u64, str.len); | 308 | var len: u64 = u64(str.len); |
| 309 | 309 | ||
| 310 | var x: u64 = fetch64(str.ptr + str.len - 40); | 310 | var x: u64 = fetch64(str.ptr + str.len - 40); |
| 311 | var y: u64 = fetch64(str.ptr + str.len - 16) +% fetch64(str.ptr + str.len - 56); | 311 | var y: u64 = fetch64(str.ptr + str.len - 16) +% fetch64(str.ptr + str.len - 56); |
std/hash/murmur.zig+3-3| ... | @@ -98,9 +98,9 @@ pub const Murmur2_64 = struct { | ... | @@ -98,9 +98,9 @@ pub const Murmur2_64 = struct { |
| 98 | 98 | ||
| 99 | pub fn hashWithSeed(str: []const u8, seed: u64) u64 { | 99 | pub fn hashWithSeed(str: []const u8, seed: u64) u64 { |
| 100 | const m: u64 = 0xc6a4a7935bd1e995; | 100 | const m: u64 = 0xc6a4a7935bd1e995; |
| 101 | const len = @truncate(u64, str.len); | 101 | const len = u64(str.len); |
| 102 | var h1: u64 = seed ^ (len *% m); | 102 | var h1: u64 = seed ^ (len *% m); |
| 103 | for (@ptrCast([*]allowzero align(1) const u64, str.ptr)[0..(len >> 3)]) |v| { | 103 | for (@ptrCast([*]allowzero align(1) const u64, str.ptr)[0..@intCast(usize, len >> 3)]) |v| { |
| 104 | var k1: u64 = v; | 104 | var k1: u64 = v; |
| 105 | if (builtin.endian == builtin.Endian.Big) | 105 | if (builtin.endian == builtin.Endian.Big) |
| 106 | k1 = @byteSwap(u64, k1); | 106 | k1 = @byteSwap(u64, k1); |
| ... | @@ -114,7 +114,7 @@ pub const Murmur2_64 = struct { | ... | @@ -114,7 +114,7 @@ pub const Murmur2_64 = struct { |
| 114 | const offset = len - rest; | 114 | const offset = len - rest; |
| 115 | if (rest > 0) { | 115 | if (rest > 0) { |
| 116 | var k1: u64 = 0; | 116 | var k1: u64 = 0; |
| 117 | @memcpy(@ptrCast([*]u8, &k1), @ptrCast([*]const u8, &str[offset]), rest); | 117 | @memcpy(@ptrCast([*]u8, &k1), @ptrCast([*]const u8, &str[@intCast(usize, offset)]), @intCast(usize, rest)); |
| 118 | if (builtin.endian == builtin.Endian.Big) | 118 | if (builtin.endian == builtin.Endian.Big) |
| 119 | k1 = @byteSwap(u64, k1); | 119 | k1 = @byteSwap(u64, k1); |
| 120 | h1 ^= k1; | 120 | h1 ^= k1; |
std/os/bits/linux/arm-eabi.zig+2| ... | @@ -569,3 +569,5 @@ pub const timezone = extern struct { | ... | @@ -569,3 +569,5 @@ pub const timezone = extern struct { |
| 569 | tz_minuteswest: i32, | 569 | tz_minuteswest: i32, |
| 570 | tz_dsttime: i32, | 570 | tz_dsttime: i32, |
| 571 | }; | 571 | }; |
| 572 | |||
| 573 | pub const Elf_Symndx = u32; |