diff options
| author | mlugg <mlugg@mlugg.co.uk> | 2023-06-22 18:46:56 +0100 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2023-06-24 16:56:39 -0700 |
| commit | f26dda21171e26f44aeec8c59a75bbb3331eeb2e (patch) | |
| tree | c935248861ae2693b314f2c8bc78fe38d9961b6d /lib/std/crypto/md5.zig | |
| parent | 447ca4e3fff021f471b748187b53f0a4744ad0bc (diff) | |
| download | zig-f26dda21171e26f44aeec8c59a75bbb3331eeb2e.tar.gz zig-f26dda21171e26f44aeec8c59a75bbb3331eeb2e.zip | |
all: migrate code to new cast builtin syntax
Most of this migration was performed automatically with `zig fmt`. There
were a few exceptions which I had to manually fix:
* `@alignCast` and `@addrSpaceCast` cannot be automatically rewritten
* `@truncate`'s fixup is incorrect for vectors
* Test cases are not formatted, and their error locations change
Diffstat (limited to 'lib/std/crypto/md5.zig')
| -rw-r--r-- | lib/std/crypto/md5.zig | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/std/crypto/md5.zig b/lib/std/crypto/md5.zig index bd4a78c032..b480cbcd8e 100644 --- a/lib/std/crypto/md5.zig +++ b/lib/std/crypto/md5.zig @@ -80,7 +80,7 @@ pub const Md5 = struct { // Copy any remainder for next pass. const b_slice = b[off..]; @memcpy(d.buf[d.buf_len..][0..b_slice.len], b_slice); - d.buf_len += @intCast(u8, b_slice.len); + d.buf_len += @as(u8, @intCast(b_slice.len)); // Md5 uses the bottom 64-bits for length padding d.total_len +%= b.len; @@ -103,9 +103,9 @@ pub const Md5 = struct { // Append message length. var i: usize = 1; var len = d.total_len >> 5; - d.buf[56] = @intCast(u8, d.total_len & 0x1f) << 3; + d.buf[56] = @as(u8, @intCast(d.total_len & 0x1f)) << 3; while (i < 8) : (i += 1) { - d.buf[56 + i] = @intCast(u8, len & 0xff); + d.buf[56 + i] = @as(u8, @intCast(len & 0xff)); len >>= 8; } |
