aboutsummaryrefslogtreecommitdiff
path: root/lib/std/mem.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2023-07-03 15:59:54 -0700
committerGitHub <noreply@github.com>2023-07-03 15:59:54 -0700
commit17890f6b8a9a91c780377ac6cdcb22fc4180e929 (patch)
tree330dae6f9a9c23e052e270c8cf333c5f80beded6 /lib/std/mem.zig
parent0dffab7356685c7643aa6e3cbe0ad1a18bc0dd55 (diff)
parentadf07183165eb910be6f8b13ae0192dab6ed59e7 (diff)
downloadzig-17890f6b8a9a91c780377ac6cdcb22fc4180e929.tar.gz
zig-17890f6b8a9a91c780377ac6cdcb22fc4180e929.zip
Merge pull request #15879 from r00ster91/more_stage1_test_coverage
More stage1 test coverage
Diffstat (limited to 'lib/std/mem.zig')
-rw-r--r--lib/std/mem.zig2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/std/mem.zig b/lib/std/mem.zig
index d3e874a211..489fec7ea1 100644
--- a/lib/std/mem.zig
+++ b/lib/std/mem.zig
@@ -1616,7 +1616,7 @@ test "readIntBig and readIntLittle" {
/// accepts any integer bit width.
/// This function stores in native endian, which means it is implemented as a simple
/// memory store.
-pub fn writeIntNative(comptime T: type, buf: *[(@typeInfo(T).Int.bits + 7) / 8]u8, value: T) void {
+pub fn writeIntNative(comptime T: type, buf: *[@as(u16, @intCast((@as(u17, @typeInfo(T).Int.bits) + 7) / 8))]u8, value: T) void {
@as(*align(1) T, @ptrCast(buf)).* = value;
}