| author | |
| committer | |
| log | 4330c405963ad7db2bfdb639c556e04793d386a1 |
| tree | c29d9a3e800815062540ab6f3ab3768200bf8646 |
| parent | 401910a2ca8e4b9689180c63d0b8e190adcf7cfa |
| signature |
Most of these changes seem like improvements. The PDB thing had a TODO
saying it used to crash; I anticipate it works now, we'll see what CI
does.
The `std.os.uefi` field renames are a notable breaking change.7 files changed, 42 insertions(+), 48 deletions(-)
lib/std/crypto/poly1305.zig+5-5| ... | ... | @@ -12,7 +12,7 @@ pub const Poly1305 = struct { |
| 12 | 12 | // accumulated hash |
| 13 | 13 | h: [3]u64 = [_]u64{ 0, 0, 0 }, |
| 14 | 14 | // random number added at the end (from the secret key) |
| 15 | pad: [2]u64, | |
| 15 | end_pad: [2]u64, | |
| 16 | 16 | // how many bytes are waiting to be processed in a partial block |
| 17 | 17 | leftover: usize = 0, |
| 18 | 18 | // partial block buffer |
| ... | ... | @@ -24,7 +24,7 @@ pub const Poly1305 = struct { |
| 24 | 24 | mem.readInt(u64, key[0..8], .little) & 0x0ffffffc0fffffff, |
| 25 | 25 | mem.readInt(u64, key[8..16], .little) & 0x0ffffffc0ffffffc, |
| 26 | 26 | }, |
| 27 | .pad = [_]u64{ | |
| 27 | .end_pad = [_]u64{ | |
| 28 | 28 | mem.readInt(u64, key[16..24], .little), |
| 29 | 29 | mem.readInt(u64, key[24..32], .little), |
| 30 | 30 | }, |
| ... | ... | @@ -177,9 +177,9 @@ pub const Poly1305 = struct { |
| 177 | 177 | h1 ^= mask & (h1 ^ h_p1); |
| 178 | 178 | |
| 179 | 179 | // Add the first half of the key, we intentionally don't use @addWithOverflow() here. |
| 180 | st.h[0] = h0 +% st.pad[0]; | |
| 181 | const c = ((h0 & st.pad[0]) | ((h0 | st.pad[0]) & ~st.h[0])) >> 63; | |
| 182 | st.h[1] = h1 +% st.pad[1] +% c; | |
| 180 | st.h[0] = h0 +% st.end_pad[0]; | |
| 181 | const c = ((h0 & st.end_pad[0]) | ((h0 | st.end_pad[0]) & ~st.h[0])) >> 63; | |
| 182 | st.h[1] = h1 +% st.end_pad[1] +% c; | |
| 183 | 183 | |
| 184 | 184 | mem.writeInt(u64, out[0..8], st.h[0], .little); |
| 185 | 185 | mem.writeInt(u64, out[8..16], st.h[1], .little); |
lib/std/debug/Pdb.zig+1-2| ... | ... | @@ -300,11 +300,10 @@ pub fn getLineNumberInfo(self: *Pdb, module: *Module, address: u64) !std.debug.S |
| 300 | 300 | |
| 301 | 301 | const found_line_index = start_line_index + line_entry_idx * @sizeOf(pdb.LineNumberEntry); |
| 302 | 302 | const line_num_entry: *align(1) pdb.LineNumberEntry = @ptrCast(&subsect_info[found_line_index]); |
| 303 | const flags: *align(1) pdb.LineNumberEntry.Flags = @ptrCast(&line_num_entry.Flags); | |
| 304 | 303 | |
| 305 | 304 | return .{ |
| 306 | 305 | .file_name = source_file_name, |
| 307 | .line = flags.Start, | |
| 306 | .line = line_num_entry.Flags.Start, | |
| 308 | 307 | .column = column, |
| 309 | 308 | }; |
| 310 | 309 | } |
lib/std/enums.zig+1-1| ... | ... | @@ -1501,7 +1501,7 @@ test values { |
| 1501 | 1501 | X, |
| 1502 | 1502 | Y, |
| 1503 | 1503 | Z, |
| 1504 | pub const X = 1; | |
| 1504 | const A = 1; | |
| 1505 | 1505 | }; |
| 1506 | 1506 | try testing.expectEqualSlices(E, &.{ .X, .Y, .Z }, values(E)); |
| 1507 | 1507 | } |
lib/std/heap/sbrk_allocator.zig+1-3| ... | ... | @@ -7,7 +7,7 @@ const assert = std.debug.assert; |
| 7 | 7 | |
| 8 | 8 | pub fn SbrkAllocator(comptime sbrk: *const fn (n: usize) usize) type { |
| 9 | 9 | return struct { |
| 10 | pub const vtable = Allocator.VTable{ | |
| 10 | pub const vtable: Allocator.VTable = .{ | |
| 11 | 11 | .alloc = alloc, |
| 12 | 12 | .resize = resize, |
| 13 | 13 | .free = free, |
| ... | ... | @@ -15,8 +15,6 @@ pub fn SbrkAllocator(comptime sbrk: *const fn (n: usize) usize) type { |
| 15 | 15 | |
| 16 | 16 | pub const Error = Allocator.Error; |
| 17 | 17 | |
| 18 | lock: std.Thread.Mutex = .{}, | |
| 19 | ||
| 20 | 18 | const max_usize = math.maxInt(usize); |
| 21 | 19 | const ushift = math.Log2Int(usize); |
| 22 | 20 | const bigpage_size = 64 * 1024; |
lib/std/meta.zig+2-2| ... | ... | @@ -294,7 +294,7 @@ test declarations { |
| 294 | 294 | pub fn a() void {} |
| 295 | 295 | }; |
| 296 | 296 | const U1 = union { |
| 297 | a: u8, | |
| 297 | b: u8, | |
| 298 | 298 | |
| 299 | 299 | pub fn a() void {} |
| 300 | 300 | }; |
| ... | ... | @@ -334,7 +334,7 @@ test declarationInfo { |
| 334 | 334 | pub fn a() void {} |
| 335 | 335 | }; |
| 336 | 336 | const U1 = union { |
| 337 | a: u8, | |
| 337 | b: u8, | |
| 338 | 338 | |
| 339 | 339 | pub fn a() void {} |
| 340 | 340 | }; |
lib/std/os/uefi/device_path.zig+30-30| ... | ... | @@ -4,38 +4,38 @@ const uefi = std.os.uefi; |
| 4 | 4 | const Guid = uefi.Guid; |
| 5 | 5 | |
| 6 | 6 | pub const DevicePath = union(Type) { |
| 7 | Hardware: Hardware, | |
| 8 | Acpi: Acpi, | |
| 9 | Messaging: Messaging, | |
| 10 | Media: Media, | |
| 11 | BiosBootSpecification: BiosBootSpecification, | |
| 12 | End: End, | |
| 7 | hardware: Hardware, | |
| 8 | acpi: Acpi, | |
| 9 | messaging: Messaging, | |
| 10 | media: Media, | |
| 11 | bios_boot_specification: BiosBootSpecification, | |
| 12 | end: End, | |
| 13 | 13 | |
| 14 | 14 | pub const Type = enum(u8) { |
| 15 | Hardware = 0x01, | |
| 16 | Acpi = 0x02, | |
| 17 | Messaging = 0x03, | |
| 18 | Media = 0x04, | |
| 19 | BiosBootSpecification = 0x05, | |
| 20 | End = 0x7f, | |
| 15 | hardware = 0x01, | |
| 16 | acpi = 0x02, | |
| 17 | messaging = 0x03, | |
| 18 | media = 0x04, | |
| 19 | bios_boot_specification = 0x05, | |
| 20 | end = 0x7f, | |
| 21 | 21 | _, |
| 22 | 22 | }; |
| 23 | 23 | |
| 24 | 24 | pub const Hardware = union(Subtype) { |
| 25 | Pci: *const PciDevicePath, | |
| 26 | PcCard: *const PcCardDevicePath, | |
| 27 | MemoryMapped: *const MemoryMappedDevicePath, | |
| 28 | Vendor: *const VendorDevicePath, | |
| 29 | Controller: *const ControllerDevicePath, | |
| 30 | Bmc: *const BmcDevicePath, | |
| 25 | pci: *const PciDevicePath, | |
| 26 | pc_card: *const PcCardDevicePath, | |
| 27 | memory_mapped: *const MemoryMappedDevicePath, | |
| 28 | vendor: *const VendorDevicePath, | |
| 29 | controller: *const ControllerDevicePath, | |
| 30 | bmc: *const BmcDevicePath, | |
| 31 | 31 | |
| 32 | 32 | pub const Subtype = enum(u8) { |
| 33 | Pci = 1, | |
| 34 | PcCard = 2, | |
| 35 | MemoryMapped = 3, | |
| 36 | Vendor = 4, | |
| 37 | Controller = 5, | |
| 38 | Bmc = 6, | |
| 33 | pci = 1, | |
| 34 | pc_card = 2, | |
| 35 | memory_mapped = 3, | |
| 36 | vendor = 4, | |
| 37 | controller = 5, | |
| 38 | bmc = 6, | |
| 39 | 39 | _, |
| 40 | 40 | }; |
| 41 | 41 | |
| ... | ... | @@ -151,14 +151,14 @@ pub const DevicePath = union(Type) { |
| 151 | 151 | }; |
| 152 | 152 | |
| 153 | 153 | pub const Acpi = union(Subtype) { |
| 154 | Acpi: *const BaseAcpiDevicePath, | |
| 155 | ExpandedAcpi: *const ExpandedAcpiDevicePath, | |
| 156 | Adr: *const AdrDevicePath, | |
| 154 | acpi: *const BaseAcpiDevicePath, | |
| 155 | expanded_acpi: *const ExpandedAcpiDevicePath, | |
| 156 | adr: *const AdrDevicePath, | |
| 157 | 157 | |
| 158 | 158 | pub const Subtype = enum(u8) { |
| 159 | Acpi = 1, | |
| 160 | ExpandedAcpi = 2, | |
| 161 | Adr = 3, | |
| 159 | acpi = 1, | |
| 160 | expanded_acpi = 2, | |
| 161 | adr = 3, | |
| 162 | 162 | _, |
| 163 | 163 | }; |
| 164 | 164 |
lib/std/pdb.zig+2-5| ... | ... | @@ -399,17 +399,14 @@ pub const LineBlockFragmentHeader = extern struct { |
| 399 | 399 | pub const LineNumberEntry = extern struct { |
| 400 | 400 | /// Offset to start of code bytes for line number |
| 401 | 401 | Offset: u32, |
| 402 | Flags: u32, | |
| 403 | ||
| 404 | /// TODO runtime crash when I make the actual type of Flags this | |
| 405 | pub const Flags = packed struct { | |
| 402 | Flags: packed struct(u32) { | |
| 406 | 403 | /// Start line number |
| 407 | 404 | Start: u24, |
| 408 | 405 | /// Delta of lines to the end of the expression. Still unclear. |
| 409 | 406 | // TODO figure out the point of this field. |
| 410 | 407 | End: u7, |
| 411 | 408 | IsStatement: bool, |
| 412 | }; | |
| 409 | }, | |
| 413 | 410 | }; |
| 414 | 411 | |
| 415 | 412 | pub const ColumnNumberEntry = extern struct { |