authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-04-25 01:49:15-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-04-25 11:23:41-07:00
log401b7f6f537699771ddbc82d524439c5f3db7ea7
treeb5502fbb299513a9f85ef5b0a3b9c4cd9160adba
parent792bbfa301436fc0ce31bc4072b4765ba1408a55

zig fmt


4 files changed, 6 insertions(+), 7 deletions(-)

lib/std/hash/murmur.zig+2-2
...@@ -100,7 +100,7 @@ pub const Murmur2_64 = struct {...@@ -100,7 +100,7 @@ pub const Murmur2_64 = struct {
100 pub fn hashWithSeed(str: []const u8, seed: u64) u64 {100 pub fn hashWithSeed(str: []const u8, seed: u64) u64 {
101 const m: u64 = 0xc6a4a7935bd1e995;101 const m: u64 = 0xc6a4a7935bd1e995;
102 var h1: u64 = seed ^ (@as(u64, str.len) *% m);102 var h1: u64 = seed ^ (@as(u64, str.len) *% m);
103 for (@ptrCast([*]align(1) const u64, str.ptr)[0..str.len / 8]) |v| {103 for (@ptrCast([*]align(1) const u64, str.ptr)[0 .. str.len / 8]) |v| {
104 var k1: u64 = v;104 var k1: u64 = v;
105 if (native_endian == .Big)105 if (native_endian == .Big)
106 k1 = @byteSwap(k1);106 k1 = @byteSwap(k1);
...@@ -291,7 +291,7 @@ fn SMHasherTest(comptime hash_fn: anytype, comptime hashbits: u32) u32 {...@@ -291,7 +291,7 @@ fn SMHasherTest(comptime hash_fn: anytype, comptime hashbits: u32) u32 {
291 var h = hash_fn(key[0..i], 256 - i);291 var h = hash_fn(key[0..i], 256 - i);
292 if (native_endian == .Big)292 if (native_endian == .Big)
293 h = @byteSwap(h);293 h = @byteSwap(h);
294 @memcpy(hashes[i * hashbytes..][0..hashbytes], @ptrCast([*]u8, &h));294 @memcpy(hashes[i * hashbytes ..][0..hashbytes], @ptrCast([*]u8, &h));
295 }295 }
296296
297 return @truncate(u32, hash_fn(&hashes, 0));297 return @truncate(u32, hash_fn(&hashes, 0));
lib/std/hash_map.zig+1-1
...@@ -1449,7 +1449,7 @@ pub fn HashMapUnmanaged(...@@ -1449,7 +1449,7 @@ pub fn HashMapUnmanaged(
1449 }1449 }
14501450
1451 fn initMetadatas(self: *Self) void {1451 fn initMetadatas(self: *Self) void {
1452 @memset(@ptrCast([*]u8, self.metadata.?)[0..@sizeOf(Metadata) * self.capacity()], 0);1452 @memset(@ptrCast([*]u8, self.metadata.?)[0 .. @sizeOf(Metadata) * self.capacity()], 0);
1453 }1453 }
14541454
1455 // This counts the number of occupied slots (not counting tombstones), which is1455 // This counts the number of occupied slots (not counting tombstones), which is
lib/std/heap/general_purpose_allocator.zig-1
...@@ -1412,4 +1412,3 @@ test "bug 9995 fix, large allocs count requested size not backing size" {...@@ -1412,4 +1412,3 @@ test "bug 9995 fix, large allocs count requested size not backing size" {
1412 buf = try allocator.realloc(buf, 2);1412 buf = try allocator.realloc(buf, 2);
1413 try std.testing.expect(gpa.total_requested_bytes == 2);1413 try std.testing.expect(gpa.total_requested_bytes == 2);
1414}1414}
1415
lib/std/os/windows.zig+3-3
...@@ -755,9 +755,9 @@ pub fn CreateSymbolicLink(...@@ -755,9 +755,9 @@ pub fn CreateSymbolicLink(
755 };755 };
756756
757 std.mem.copy(u8, buffer[0..], std.mem.asBytes(&symlink_data));757 std.mem.copy(u8, buffer[0..], std.mem.asBytes(&symlink_data));
758 @memcpy(buffer[@sizeOf(SYMLINK_DATA)..][0..target_path.len * 2], @ptrCast([*]const u8, target_path));758 @memcpy(buffer[@sizeOf(SYMLINK_DATA)..][0 .. target_path.len * 2], @ptrCast([*]const u8, target_path));
759 const paths_start = @sizeOf(SYMLINK_DATA) + target_path.len * 2;759 const paths_start = @sizeOf(SYMLINK_DATA) + target_path.len * 2;
760 @memcpy(buffer[paths_start..][0..target_path.len * 2], @ptrCast([*]const u8, target_path));760 @memcpy(buffer[paths_start..][0 .. target_path.len * 2], @ptrCast([*]const u8, target_path));
761 _ = try DeviceIoControl(symlink_handle, FSCTL_SET_REPARSE_POINT, buffer[0..buf_len], null);761 _ = try DeviceIoControl(symlink_handle, FSCTL_SET_REPARSE_POINT, buffer[0..buf_len], null);
762}762}
763763
...@@ -1179,7 +1179,7 @@ pub fn GetFinalPathNameByHandle(...@@ -1179,7 +1179,7 @@ pub fn GetFinalPathNameByHandle(
1179 var input_struct = @ptrCast(*MOUNTMGR_MOUNT_POINT, &input_buf[0]);1179 var input_struct = @ptrCast(*MOUNTMGR_MOUNT_POINT, &input_buf[0]);
1180 input_struct.DeviceNameOffset = @sizeOf(MOUNTMGR_MOUNT_POINT);1180 input_struct.DeviceNameOffset = @sizeOf(MOUNTMGR_MOUNT_POINT);
1181 input_struct.DeviceNameLength = @intCast(USHORT, volume_name_u16.len * 2);1181 input_struct.DeviceNameLength = @intCast(USHORT, volume_name_u16.len * 2);
1182 @memcpy(input_buf[@sizeOf(MOUNTMGR_MOUNT_POINT)..][0..volume_name_u16.len * 2], @ptrCast([*]const u8, volume_name_u16.ptr));1182 @memcpy(input_buf[@sizeOf(MOUNTMGR_MOUNT_POINT)..][0 .. volume_name_u16.len * 2], @ptrCast([*]const u8, volume_name_u16.ptr));
11831183
1184 DeviceIoControl(mgmt_handle, IOCTL_MOUNTMGR_QUERY_POINTS, &input_buf, &output_buf) catch |err| switch (err) {1184 DeviceIoControl(mgmt_handle, IOCTL_MOUNTMGR_QUERY_POINTS, &input_buf, &output_buf) catch |err| switch (err) {
1185 error.AccessDenied => unreachable,1185 error.AccessDenied => unreachable,