authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-02-24 21:29:01-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-02-24 21:29:23-07:00
log5f35dc0c0d0530d5a1d028c56a763def3d1fd250
tree75a0872005d2f0e5a1c12c31072a471e9ea185d8
parentd7049fc8e0709619b8aa6766b37abeae946703b2

zig fmt the std lib


20 files changed, 176 insertions(+), 139 deletions(-)

lib/std/Thread.zig+7-16
......@@ -70,16 +70,8 @@ else switch (std.Target.current.os.tag) {
7070/// Signals the processor that it is inside a busy-wait spin-loop ("spin lock").
7171pub fn spinLoopHint() void {
7272 switch (std.Target.current.cpu.arch) {
73 .i386, .x86_64 => asm volatile ("pause"
74 :
75 :
76 : "memory"
77 ),
78 .arm, .aarch64 => asm volatile ("yield"
79 :
80 :
81 : "memory"
82 ),
73 .i386, .x86_64 => asm volatile ("pause" ::: "memory"),
74 .arm, .aarch64 => asm volatile ("yield" ::: "memory"),
8375 else => {},
8476 }
8577}
......@@ -90,12 +82,11 @@ pub fn spinLoopHint() void {
9082pub fn getCurrentId() Id {
9183 if (use_pthreads) {
9284 return c.pthread_self();
93 } else
94 return switch (std.Target.current.os.tag) {
95 .linux => os.linux.gettid(),
96 .windows => windows.kernel32.GetCurrentThreadId(),
97 else => @compileError("Unsupported OS"),
98 };
85 } else return switch (std.Target.current.os.tag) {
86 .linux => os.linux.gettid(),
87 .windows => windows.kernel32.GetCurrentThreadId(),
88 else => @compileError("Unsupported OS"),
89 };
9990}
10091
10192/// Returns the handle of this thread.
lib/std/Thread/Semaphore.zig+1-1
......@@ -10,7 +10,7 @@
1010
1111mutex: Mutex = .{},
1212cond: Condition = .{},
13//! It is OK to initialize this field to any value.
13/// It is OK to initialize this field to any value.
1414permits: usize = 0,
1515
1616const Semaphore = @This();
lib/std/array_hash_map.zig+2-4
......@@ -1237,8 +1237,7 @@ test "shrink" {
12371237 if (i < 17) {
12381238 testing.expect(gop.found_existing == true);
12391239 testing.expect(gop.entry.value == i * 10);
1240 } else
1241 testing.expect(gop.found_existing == false);
1240 } else testing.expect(gop.found_existing == false);
12421241 }
12431242
12441243 // Test `shrinkAndFree`.
......@@ -1251,8 +1250,7 @@ test "shrink" {
12511250 if (i < 15) {
12521251 testing.expect(gop.found_existing == true);
12531252 testing.expect(gop.entry.value == i * 10);
1254 } else
1255 testing.expect(gop.found_existing == false);
1253 } else testing.expect(gop.found_existing == false);
12561254 }
12571255}
12581256
lib/std/base64.zig+2-4
......@@ -222,12 +222,10 @@ pub const Base64DecoderWithIgnore = struct {
222222 } else if (decoder_with_ignore.char_is_ignored[c]) {
223223 // we can even ignore chars during the padding
224224 continue;
225 } else
226 return error.InvalidCharacter;
225 } else return error.InvalidCharacter;
227226 }
228227 break;
229 } else
230 return error.InvalidCharacter;
228 } else return error.InvalidCharacter;
231229 }
232230
233231 switch (available_chars) {
lib/std/build.zig+3-1
......@@ -2763,7 +2763,9 @@ pub const InstallDirectoryOptions = struct {
27632763 .install_dir = self.install_dir.dupe(b),
27642764 .install_subdir = b.dupe(self.install_subdir),
27652765 .exclude_extensions = if (self.exclude_extensions) |extensions|
2766 b.dupeStrings(extensions) else null,
2766 b.dupeStrings(extensions)
2767 else
2768 null,
27672769 };
27682770 }
27692771};
lib/std/c/builtins.zig+101-35
......@@ -6,12 +6,22 @@
66
77const std = @import("std");
88
9pub fn __builtin_bswap16(val: u16) callconv(.Inline) u16 { return @byteSwap(u16, val); }
10pub fn __builtin_bswap32(val: u32) callconv(.Inline) u32 { return @byteSwap(u32, val); }
11pub fn __builtin_bswap64(val: u64) callconv(.Inline) u64 { return @byteSwap(u64, val); }
9pub fn __builtin_bswap16(val: u16) callconv(.Inline) u16 {
10 return @byteSwap(u16, val);
11}
12pub fn __builtin_bswap32(val: u32) callconv(.Inline) u32 {
13 return @byteSwap(u32, val);
14}
15pub fn __builtin_bswap64(val: u64) callconv(.Inline) u64 {
16 return @byteSwap(u64, val);
17}
1218
13pub fn __builtin_signbit(val: f64) callconv(.Inline) c_int { return @boolToInt(std.math.signbit(val)); }
14pub fn __builtin_signbitf(val: f32) callconv(.Inline) c_int { return @boolToInt(std.math.signbit(val)); }
19pub fn __builtin_signbit(val: f64) callconv(.Inline) c_int {
20 return @boolToInt(std.math.signbit(val));
21}
22pub fn __builtin_signbitf(val: f32) callconv(.Inline) c_int {
23 return @boolToInt(std.math.signbit(val));
24}
1525
1626pub fn __builtin_popcount(val: c_uint) callconv(.Inline) c_int {
1727 // popcount of a c_uint will never exceed the capacity of a c_int
......@@ -31,40 +41,96 @@ pub fn __builtin_clz(val: c_uint) callconv(.Inline) c_int {
3141 return @bitCast(c_int, @as(c_uint, @clz(c_uint, val)));
3242}
3343
34pub fn __builtin_sqrt(val: f64) callconv(.Inline) f64 { return @sqrt(val); }
35pub fn __builtin_sqrtf(val: f32) callconv(.Inline) f32 { return @sqrt(val); }
44pub fn __builtin_sqrt(val: f64) callconv(.Inline) f64 {
45 return @sqrt(val);
46}
47pub fn __builtin_sqrtf(val: f32) callconv(.Inline) f32 {
48 return @sqrt(val);
49}
3650
37pub fn __builtin_sin(val: f64) callconv(.Inline) f64 { return @sin(val); }
38pub fn __builtin_sinf(val: f32) callconv(.Inline) f32 { return @sin(val); }
39pub fn __builtin_cos(val: f64) callconv(.Inline) f64 { return @cos(val); }
40pub fn __builtin_cosf(val: f32) callconv(.Inline) f32 { return @cos(val); }
51pub fn __builtin_sin(val: f64) callconv(.Inline) f64 {
52 return @sin(val);
53}
54pub fn __builtin_sinf(val: f32) callconv(.Inline) f32 {
55 return @sin(val);
56}
57pub fn __builtin_cos(val: f64) callconv(.Inline) f64 {
58 return @cos(val);
59}
60pub fn __builtin_cosf(val: f32) callconv(.Inline) f32 {
61 return @cos(val);
62}
4163
42pub fn __builtin_exp(val: f64) callconv(.Inline) f64 { return @exp(val); }
43pub fn __builtin_expf(val: f32) callconv(.Inline) f32 { return @exp(val); }
44pub fn __builtin_exp2(val: f64) callconv(.Inline) f64 { return @exp2(val); }
45pub fn __builtin_exp2f(val: f32) callconv(.Inline) f32 { return @exp2(val); }
46pub fn __builtin_log(val: f64) callconv(.Inline) f64 { return @log(val); }
47pub fn __builtin_logf(val: f32) callconv(.Inline) f32 { return @log(val); }
48pub fn __builtin_log2(val: f64) callconv(.Inline) f64 { return @log2(val); }
49pub fn __builtin_log2f(val: f32) callconv(.Inline) f32 { return @log2(val); }
50pub fn __builtin_log10(val: f64) callconv(.Inline) f64 { return @log10(val); }
51pub fn __builtin_log10f(val: f32) callconv(.Inline) f32 { return @log10(val); }
64pub fn __builtin_exp(val: f64) callconv(.Inline) f64 {
65 return @exp(val);
66}
67pub fn __builtin_expf(val: f32) callconv(.Inline) f32 {
68 return @exp(val);
69}
70pub fn __builtin_exp2(val: f64) callconv(.Inline) f64 {
71 return @exp2(val);
72}
73pub fn __builtin_exp2f(val: f32) callconv(.Inline) f32 {
74 return @exp2(val);
75}
76pub fn __builtin_log(val: f64) callconv(.Inline) f64 {
77 return @log(val);
78}
79pub fn __builtin_logf(val: f32) callconv(.Inline) f32 {
80 return @log(val);
81}
82pub fn __builtin_log2(val: f64) callconv(.Inline) f64 {
83 return @log2(val);
84}
85pub fn __builtin_log2f(val: f32) callconv(.Inline) f32 {
86 return @log2(val);
87}
88pub fn __builtin_log10(val: f64) callconv(.Inline) f64 {
89 return @log10(val);
90}
91pub fn __builtin_log10f(val: f32) callconv(.Inline) f32 {
92 return @log10(val);
93}
5294
5395// Standard C Library bug: The absolute value of the most negative integer remains negative.
54pub fn __builtin_abs(val: c_int) callconv(.Inline) c_int { return std.math.absInt(val) catch std.math.minInt(c_int); }
55pub fn __builtin_fabs(val: f64) callconv(.Inline) f64 { return @fabs(val); }
56pub fn __builtin_fabsf(val: f32) callconv(.Inline) f32 { return @fabs(val); }
57
58pub fn __builtin_floor(val: f64) callconv(.Inline) f64 { return @floor(val); }
59pub fn __builtin_floorf(val: f32) callconv(.Inline) f32 { return @floor(val); }
60pub fn __builtin_ceil(val: f64) callconv(.Inline) f64 { return @ceil(val); }
61pub fn __builtin_ceilf(val: f32) callconv(.Inline) f32 { return @ceil(val); }
62pub fn __builtin_trunc(val: f64) callconv(.Inline) f64 { return @trunc(val); }
63pub fn __builtin_truncf(val: f32) callconv(.Inline) f32 { return @trunc(val); }
64pub fn __builtin_round(val: f64) callconv(.Inline) f64 { return @round(val); }
65pub fn __builtin_roundf(val: f32) callconv(.Inline) f32 { return @round(val); }
66
67pub fn __builtin_strlen(s: [*c]const u8) callconv(.Inline) usize { return std.mem.lenZ(s); }
96pub fn __builtin_abs(val: c_int) callconv(.Inline) c_int {
97 return std.math.absInt(val) catch std.math.minInt(c_int);
98}
99pub fn __builtin_fabs(val: f64) callconv(.Inline) f64 {
100 return @fabs(val);
101}
102pub fn __builtin_fabsf(val: f32) callconv(.Inline) f32 {
103 return @fabs(val);
104}
105
106pub fn __builtin_floor(val: f64) callconv(.Inline) f64 {
107 return @floor(val);
108}
109pub fn __builtin_floorf(val: f32) callconv(.Inline) f32 {
110 return @floor(val);
111}
112pub fn __builtin_ceil(val: f64) callconv(.Inline) f64 {
113 return @ceil(val);
114}
115pub fn __builtin_ceilf(val: f32) callconv(.Inline) f32 {
116 return @ceil(val);
117}
118pub fn __builtin_trunc(val: f64) callconv(.Inline) f64 {
119 return @trunc(val);
120}
121pub fn __builtin_truncf(val: f32) callconv(.Inline) f32 {
122 return @trunc(val);
123}
124pub fn __builtin_round(val: f64) callconv(.Inline) f64 {
125 return @round(val);
126}
127pub fn __builtin_roundf(val: f32) callconv(.Inline) f32 {
128 return @round(val);
129}
130
131pub fn __builtin_strlen(s: [*c]const u8) callconv(.Inline) usize {
132 return std.mem.lenZ(s);
133}
68134pub fn __builtin_strcmp(s1: [*c]const u8, s2: [*c]const u8) callconv(.Inline) c_int {
69135 return @as(c_int, std.cstr.cmp(s1, s2));
70136}
lib/std/c/parse.zig+1-2
......@@ -300,8 +300,7 @@ const Parser = struct {
300300 try node.initializers.push((try parser.initializer(dr)) orelse return parser.err(.{
301301 .ExpectedInitializer = .{ .token = parser.it.index },
302302 }));
303 } else
304 try node.initializers.push(&dr.base);
303 } else try node.initializers.push(&dr.base);
305304 if (parser.eatToken(.Comma) != null) break;
306305 dr = @fieldParentPtr(Node.Declarator, "base", (try parser.declarator(.Must)) orelse return parser.err(.{
307306 .ExpectedDeclarator = .{ .token = parser.it.index },
lib/std/coff.zig+1-2
......@@ -173,8 +173,7 @@ pub const Coff = struct {
173173 skip_size = 2 * @sizeOf(u8) + 8 * @sizeOf(u16) + 18 * @sizeOf(u32);
174174 } else if (self.pe_header.magic == IMAGE_NT_OPTIONAL_HDR64_MAGIC) {
175175 skip_size = 2 * @sizeOf(u8) + 8 * @sizeOf(u16) + 12 * @sizeOf(u32) + 5 * @sizeOf(u64);
176 } else
177 return error.InvalidPEMagic;
176 } else return error.InvalidPEMagic;
178177
179178 try self.in_file.seekBy(skip_size);
180179
lib/std/crypto/aegis.zig+4-4
......@@ -81,8 +81,8 @@ const State128L = struct {
8181 while (i < 7) : (i += 1) {
8282 state.update(tmp, tmp);
8383 }
84 return blocks[0].xorBlocks(blocks[1]).xorBlocks(blocks[2]).xorBlocks(blocks[3]).xorBlocks(blocks[4]).
85 xorBlocks(blocks[5]).xorBlocks(blocks[6]).toBytes();
84 return blocks[0].xorBlocks(blocks[1]).xorBlocks(blocks[2]).xorBlocks(blocks[3]).xorBlocks(blocks[4])
85 .xorBlocks(blocks[5]).xorBlocks(blocks[6]).toBytes();
8686 }
8787};
8888
......@@ -244,8 +244,8 @@ const State256 = struct {
244244 while (i < 7) : (i += 1) {
245245 state.update(tmp);
246246 }
247 return blocks[0].xorBlocks(blocks[1]).xorBlocks(blocks[2]).xorBlocks(blocks[3]).xorBlocks(blocks[4]).
248 xorBlocks(blocks[5]).toBytes();
247 return blocks[0].xorBlocks(blocks[1]).xorBlocks(blocks[2]).xorBlocks(blocks[3]).xorBlocks(blocks[4])
248 .xorBlocks(blocks[5]).toBytes();
249249 }
250250};
251251
lib/std/crypto/bcrypt.zig+1-3
......@@ -109,9 +109,7 @@ const State = struct {
109109 }
110110 }
111111
112 const Halves = struct {
113 l: u32, r: u32
114 };
112 const Halves = struct { l: u32, r: u32 };
115113
116114 fn feistelF(state: State, x: u32) u32 {
117115 var r = state.sboxes[0][@truncate(u8, x >> 24)];
lib/std/dwarf.zig+2-4
......@@ -213,13 +213,11 @@ const LineNumberProgram = struct {
213213 return error.MissingDebugInfo;
214214 } else if (self.prev_file - 1 >= self.file_entries.items.len) {
215215 return error.InvalidDebugInfo;
216 } else
217 &self.file_entries.items[self.prev_file - 1];
216 } else &self.file_entries.items[self.prev_file - 1];
218217
219218 const dir_name = if (file_entry.dir_index >= self.include_dirs.len) {
220219 return error.InvalidDebugInfo;
221 } else
222 self.include_dirs[file_entry.dir_index];
220 } else self.include_dirs[file_entry.dir_index];
223221 const file_name = try fs.path.join(self.file_entries.allocator, &[_][]const u8{ dir_name, file_entry.file_name });
224222 errdefer self.file_entries.allocator.free(file_name);
225223 return debug.LineInfo{
lib/std/event/batch.zig+10-9
......@@ -98,15 +98,16 @@ pub fn Batch(
9898 /// This function is *not* thread-safe. It must be called from one thread at
9999 /// a time, however, it need not be the same thread.
100100 pub fn wait(self: *Self) CollectedResult {
101 for (self.jobs) |*job| if (job.frame) |f| {
102 job.result = if (async_ok) await f else nosuspend await f;
103 if (CollectedResult != void) {
104 job.result catch |err| {
105 self.collected_result = err;
106 };
107 }
108 job.frame = null;
109 };
101 for (self.jobs) |*job|
102 if (job.frame) |f| {
103 job.result = if (async_ok) await f else nosuspend await f;
104 if (CollectedResult != void) {
105 job.result catch |err| {
106 self.collected_result = err;
107 };
108 }
109 job.frame = null;
110 };
110111 return self.collected_result;
111112 }
112113 };
lib/std/fmt.zig+2-4
......@@ -646,8 +646,7 @@ pub fn formatIntValue(
646646 const int_value = if (@TypeOf(value) == comptime_int) blk: {
647647 const Int = math.IntFittingRange(value, value);
648648 break :blk @as(Int, value);
649 } else
650 value;
649 } else value;
651650
652651 if (fmt.len == 0 or comptime std.mem.eql(u8, fmt, "d")) {
653652 radix = 10;
......@@ -1087,8 +1086,7 @@ pub fn formatInt(
10871086 const int_value = if (@TypeOf(value) == comptime_int) blk: {
10881087 const Int = math.IntFittingRange(value, value);
10891088 break :blk @as(Int, value);
1090 } else
1091 value;
1089 } else value;
10921090
10931091 const value_info = @typeInfo(@TypeOf(int_value)).Int;
10941092
lib/std/log.zig+4-3
......@@ -3,9 +3,6 @@
33// This file is part of [zig](https://ziglang.org/), which is MIT licensed.
44// The MIT license requires this copyright notice to be included in all copies
55// and substantial portions of the software.
6const std = @import("std.zig");
7const builtin = std.builtin;
8const root = @import("root");
96
107//! std.log is a standardized interface for logging which allows for the logging
118//! of programs and libraries using this interface to be formatted and filtered
......@@ -77,6 +74,10 @@ const root = @import("root");
7774//! [err] (nice_library): Something went very wrong, sorry
7875//! ```
7976
77const std = @import("std.zig");
78const builtin = std.builtin;
79const root = @import("root");
80
8081pub const Level = enum {
8182 /// Emergency: a condition that cannot be handled, usually followed by a
8283 /// panic.
lib/std/meta.zig+10-11
......@@ -534,9 +534,7 @@ pub fn fieldNames(comptime T: type) *const [fields(T).len][]const u8 {
534534}
535535
536536test "std.meta.fieldNames" {
537 const E1 = enum {
538 A, B
539 };
537 const E1 = enum { A, B };
540538 const E2 = error{A};
541539 const S1 = struct {
542540 a: u8,
......@@ -1002,19 +1000,19 @@ pub fn sizeof(target: anytype) usize {
10021000 // Note: sizeof(void) is 1 on clang/gcc and 0 on MSVC.
10031001 return 1;
10041002 } else {
1005 @compileError("Cannot use C sizeof on opaque type "++@typeName(T));
1003 @compileError("Cannot use C sizeof on opaque type " ++ @typeName(T));
10061004 }
10071005 },
10081006 .Optional => |opt| {
10091007 if (@typeInfo(opt.child) == .Pointer) {
10101008 return sizeof(opt.child);
10111009 } else {
1012 @compileError("Cannot use C sizeof on non-pointer optional "++@typeName(T));
1010 @compileError("Cannot use C sizeof on non-pointer optional " ++ @typeName(T));
10131011 }
10141012 },
10151013 .Pointer => |ptr| {
10161014 if (ptr.size == .Slice) {
1017 @compileError("Cannot use C sizeof on slice type "++@typeName(T));
1015 @compileError("Cannot use C sizeof on slice type " ++ @typeName(T));
10181016 }
10191017 // for strings, sizeof("a") returns 2.
10201018 // normal pointer decay scenarios from C are handled
......@@ -1024,8 +1022,9 @@ pub fn sizeof(target: anytype) usize {
10241022 if (ptr.size == .One and ptr.is_const and @typeInfo(ptr.child) == .Array) {
10251023 const array_info = @typeInfo(ptr.child).Array;
10261024 if ((array_info.child == u8 or array_info.child == u16) and
1027 array_info.sentinel != null and
1028 array_info.sentinel.? == 0) {
1025 array_info.sentinel != null and
1026 array_info.sentinel.? == 0)
1027 {
10291028 // length of the string plus one for the null terminator.
10301029 return (array_info.len + 1) * @sizeOf(array_info.child);
10311030 }
......@@ -1067,10 +1066,10 @@ test "sizeof" {
10671066
10681067 testing.expect(sizeof(S) == 4);
10691068
1070 testing.expect(sizeof([_]u32{4, 5, 6}) == 12);
1069 testing.expect(sizeof([_]u32{ 4, 5, 6 }) == 12);
10711070 testing.expect(sizeof([3]u32) == 12);
10721071 testing.expect(sizeof([3:0]u32) == 16);
1073 testing.expect(sizeof(&[_]u32{4, 5, 6}) == ptr_size);
1072 testing.expect(sizeof(&[_]u32{ 4, 5, 6 }) == ptr_size);
10741073
10751074 testing.expect(sizeof(*u32) == ptr_size);
10761075 testing.expect(sizeof([*]u32) == ptr_size);
......@@ -1082,7 +1081,7 @@ test "sizeof" {
10821081 testing.expect(sizeof(null) == ptr_size);
10831082
10841083 testing.expect(sizeof("foobar") == 7);
1085 testing.expect(sizeof(&[_:0]u16{'f','o','o','b','a','r'}) == 14);
1084 testing.expect(sizeof(&[_:0]u16{ 'f', 'o', 'o', 'b', 'a', 'r' }) == 14);
10861085 testing.expect(sizeof(*const [4:0]u8) == 5);
10871086 testing.expect(sizeof(*[4:0]u8) == ptr_size);
10881087 testing.expect(sizeof([*]const [4:0]u8) == ptr_size);
lib/std/meta/trait.zig+2-6
......@@ -544,15 +544,11 @@ test "std.meta.trait.hasUniqueRepresentation" {
544544
545545 testing.expect(hasUniqueRepresentation(TestStruct3));
546546
547 const TestStruct4 = struct {
548 a: []const u8
549 };
547 const TestStruct4 = struct { a: []const u8 };
550548
551549 testing.expect(!hasUniqueRepresentation(TestStruct4));
552550
553 const TestStruct5 = struct {
554 a: TestStruct4
555 };
551 const TestStruct5 = struct { a: TestStruct4 };
556552
557553 testing.expect(!hasUniqueRepresentation(TestStruct5));
558554
lib/std/os.zig+3-2
......@@ -3263,8 +3263,9 @@ pub fn connect(sock: socket_t, sock_addr: *const sockaddr, len: socklen_t) Conne
32633263 .WSAEADDRNOTAVAIL => return error.AddressNotAvailable,
32643264 .WSAECONNREFUSED => return error.ConnectionRefused,
32653265 .WSAETIMEDOUT => return error.ConnectionTimedOut,
3266 .WSAEHOSTUNREACH // TODO: should we return NetworkUnreachable in this case as well?
3267 , .WSAENETUNREACH => return error.NetworkUnreachable,
3266 .WSAEHOSTUNREACH, // TODO: should we return NetworkUnreachable in this case as well?
3267 .WSAENETUNREACH,
3268 => return error.NetworkUnreachable,
32683269 .WSAEFAULT => unreachable,
32693270 .WSAEINVAL => unreachable,
32703271 .WSAEISCONN => unreachable,
lib/std/os/bits/netbsd.zig+9-7
......@@ -836,13 +836,15 @@ pub const ucontext_t = extern struct {
836836 sigmask: sigset_t,
837837 stack: stack_t,
838838 mcontext: mcontext_t,
839 __pad: [switch (builtin.arch) {
840 .i386 => 4,
841 .mips, .mipsel, .mips64, .mips64el => 14,
842 .arm, .armeb, .thumb, .thumbeb => 1,
843 .sparc, .sparcel, .sparcv9 => if (@sizeOf(usize) == 4) 43 else 8,
844 else => 0,
845 }]u32,
839 __pad: [
840 switch (builtin.arch) {
841 .i386 => 4,
842 .mips, .mipsel, .mips64, .mips64el => 14,
843 .arm, .armeb, .thumb, .thumbeb => 1,
844 .sparc, .sparcel, .sparcv9 => if (@sizeOf(usize) == 4) 43 else 8,
845 else => 0,
846 }
847 ]u32,
846848};
847849
848850pub const EPERM = 1; // Operation not permitted
lib/std/os/windows/bits.zig+7-5
......@@ -1315,11 +1315,13 @@ pub const PEB = extern struct {
13151315 ImageSubSystemMinorVersion: ULONG,
13161316 // note: there is padding here on 64 bit
13171317 ActiveProcessAffinityMask: KAFFINITY,
1318 GdiHandleBuffer: [switch (@sizeOf(usize)) {
1319 4 => 0x22,
1320 8 => 0x3C,
1321 else => unreachable,
1322 }]ULONG,
1318 GdiHandleBuffer: [
1319 switch (@sizeOf(usize)) {
1320 4 => 0x22,
1321 8 => 0x3C,
1322 else => unreachable,
1323 }
1324 ]ULONG,
13231325
13241326 // Fields appended in 5.0 (Windows 2000):
13251327 PostProcessInitRoutine: PVOID,
lib/std/special/compiler_rt/arm.zig+4-16
......@@ -66,10 +66,7 @@ pub fn __aeabi_uidivmod() callconv(.Naked) void {
6666 \\ ldr r1, [sp]
6767 \\ add sp, #4
6868 \\ pop {pc}
69 :
70 :
71 : "memory"
72 );
69 ::: "memory");
7370 unreachable;
7471}
7572
......@@ -86,10 +83,7 @@ pub fn __aeabi_uldivmod() callconv(.Naked) void {
8683 \\ ldr r3, [sp, #12]
8784 \\ add sp, #16
8885 \\ pop {r4, pc}
89 :
90 :
91 : "memory"
92 );
86 ::: "memory");
9387 unreachable;
9488}
9589
......@@ -104,10 +98,7 @@ pub fn __aeabi_idivmod() callconv(.Naked) void {
10498 \\ ldr r1, [sp]
10599 \\ add sp, #4
106100 \\ pop {pc}
107 :
108 :
109 : "memory"
110 );
101 ::: "memory");
111102 unreachable;
112103}
113104
......@@ -124,9 +115,6 @@ pub fn __aeabi_ldivmod() callconv(.Naked) void {
124115 \\ ldr r3, [sp, #12]
125116 \\ add sp, #16
126117 \\ pop {r4, pc}
127 :
128 :
129 : "memory"
130 );
118 ::: "memory");
131119 unreachable;
132120}