diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2022-08-29 14:10:59 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2022-08-29 14:10:59 -0700 |
| commit | de7270028d2b70ceea74c43be943b1b788c797a6 (patch) | |
| tree | 0d9b545a2a9d36c86b79178f797adf5ebcd40d17 /lib/std/packed_int_array.zig | |
| parent | 7c9a8ecc2aca7f925e59d282540ef8e2d1ae211e (diff) | |
| parent | e69973beddcd8a42dbc7ebcfb96187e5a6f61b61 (diff) | |
| download | zig-de7270028d2b70ceea74c43be943b1b788c797a6.tar.gz zig-de7270028d2b70ceea74c43be943b1b788c797a6.zip | |
Merge remote-tracking branch 'origin/master' into llvm15
Diffstat (limited to 'lib/std/packed_int_array.zig')
| -rw-r--r-- | lib/std/packed_int_array.zig | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/std/packed_int_array.zig b/lib/std/packed_int_array.zig index a07fc13af1..902e3ee19c 100644 --- a/lib/std/packed_int_array.zig +++ b/lib/std/packed_int_array.zig @@ -76,7 +76,7 @@ pub fn PackedIntIo(comptime Int: type, comptime endian: Endian) type { const value_ptr = @ptrCast(*align(1) const Container, &bytes[start_byte]); var value = value_ptr.*; - if (endian != native_endian) value = @byteSwap(Container, value); + if (endian != native_endian) value = @byteSwap(value); switch (endian) { .Big => { @@ -126,7 +126,7 @@ pub fn PackedIntIo(comptime Int: type, comptime endian: Endian) type { const target_ptr = @ptrCast(*align(1) Container, &bytes[start_byte]); var target = target_ptr.*; - if (endian != native_endian) target = @byteSwap(Container, target); + if (endian != native_endian) target = @byteSwap(target); //zero the bits we want to replace in the existing bytes const inv_mask = @intCast(Container, std.math.maxInt(UnInt)) << keep_shift; @@ -136,7 +136,7 @@ pub fn PackedIntIo(comptime Int: type, comptime endian: Endian) type { //merge the new value target |= value; - if (endian != native_endian) target = @byteSwap(Container, target); + if (endian != native_endian) target = @byteSwap(target); //save it back target_ptr.* = target; |
