authorgravatar for johnnymarler@gmail.comJonathan Marler <johnnymarler@gmail.com> 2022-01-24 00:52:25-07:00
committergravatar for git@vexu.euVeikka Tuominen <git@vexu.eu> 2022-01-24 17:35:15+02:00
log2fc2d88fc659f456e21d40a11e1d7bdcfa243f53
tree9b9ed1f130a26b9087bce6efa16385f83d6bd9e4
parentda8d4d922518300a8e041f59cf994f1f83ce1f48

use explicit integer bit widths for windows GUID

The size of a GUID is not platform-dependent, it's always a fixed number of bits. So I've updated guid to use fixed bit integer types rather than platform-dependent C integer types.

1 files changed, 6 insertions(+), 6 deletions(-)

lib/std/os/windows.zig+6-6
......@@ -2733,9 +2733,9 @@ pub const HRESULT = c_long;
27332733
27342734pub const KNOWNFOLDERID = GUID;
27352735pub const GUID = extern struct {
2736 Data1: c_ulong,
2737 Data2: c_ushort,
2738 Data3: c_ushort,
2736 Data1: u32,
2737 Data2: u16,
2738 Data3: u16,
27392739 Data4: [8]u8,
27402740
27412741 pub fn parse(str: []const u8) GUID {
......@@ -2744,19 +2744,19 @@ pub const GUID = extern struct {
27442744 assert(str[index] == '{');
27452745 index += 1;
27462746
2747 guid.Data1 = std.fmt.parseUnsigned(c_ulong, str[index .. index + 8], 16) catch unreachable;
2747 guid.Data1 = std.fmt.parseUnsigned(u32, str[index .. index + 8], 16) catch unreachable;
27482748 index += 8;
27492749
27502750 assert(str[index] == '-');
27512751 index += 1;
27522752
2753 guid.Data2 = std.fmt.parseUnsigned(c_ushort, str[index .. index + 4], 16) catch unreachable;
2753 guid.Data2 = std.fmt.parseUnsigned(u16, str[index .. index + 4], 16) catch unreachable;
27542754 index += 4;
27552755
27562756 assert(str[index] == '-');
27572757 index += 1;
27582758
2759 guid.Data3 = std.fmt.parseUnsigned(c_ushort, str[index .. index + 4], 16) catch unreachable;
2759 guid.Data3 = std.fmt.parseUnsigned(u16, str[index .. index + 4], 16) catch unreachable;
27602760 index += 4;
27612761
27622762 assert(str[index] == '-');