| author | |
| committer | |
| log | 507a8096d2f9624bafaf963c3e189a477ef6b7bf |
| tree | c21e3d54e1389fe44ecc7d5f230e792e26ab322d |
| parent | 7c453b91b85bab6800d24feb57c4f35b8ce48d57 |
* `comptime const` is redundant
* don't use `extern enum`; specify a tag type.
`extern enum` is only when you need tags to alias. But aliasing tags
is a smell. I will be making a proposal shortly to remove `extern enum`
from the language.
* there is no such thing as `packed enum`.
* instead of `catch |_|`, omit the capture entirely.
* unused function definition with missing parameter name
* using `try` outside of a function or test40 files changed, 101 insertions(+), 103 deletions(-)
BRANCH_TODO+2| ... | @@ -32,6 +32,8 @@ | ... | @@ -32,6 +32,8 @@ |
| 32 | compile error for a local shadowing a decl with Sema looking up the decl name. | 32 | compile error for a local shadowing a decl with Sema looking up the decl name. |
| 33 | - this means LocalVal and LocalPtr should use the string table | 33 | - this means LocalVal and LocalPtr should use the string table |
| 34 | 34 | ||
| 35 | * sort compile errors before presenting them to eliminate nondeterministic error reporting | ||
| 36 | |||
| 35 | const container_name_hash: Scope.NameHash = if (found_pkg) |pkg| | 37 | const container_name_hash: Scope.NameHash = if (found_pkg) |pkg| |
| 36 | pkg.namespace_hash | 38 | pkg.namespace_hash |
| 37 | else | 39 | else |
lib/std/array_hash_map.zig+1-1| ... | @@ -1310,7 +1310,7 @@ test "reIndex" { | ... | @@ -1310,7 +1310,7 @@ test "reIndex" { |
| 1310 | } | 1310 | } |
| 1311 | 1311 | ||
| 1312 | test "fromOwnedArrayList" { | 1312 | test "fromOwnedArrayList" { |
| 1313 | comptime const array_hash_map_type = AutoArrayHashMap(i32, i32); | 1313 | const array_hash_map_type = AutoArrayHashMap(i32, i32); |
| 1314 | var al = std.ArrayListUnmanaged(array_hash_map_type.Entry){}; | 1314 | var al = std.ArrayListUnmanaged(array_hash_map_type.Entry){}; |
| 1315 | const hash = getAutoHashFn(i32); | 1315 | const hash = getAutoHashFn(i32); |
| 1316 | 1316 |
lib/std/crypto/25519/edwards25519.zig+3-3| ... | @@ -238,7 +238,7 @@ pub const Edwards25519 = struct { | ... | @@ -238,7 +238,7 @@ pub const Edwards25519 = struct { |
| 238 | pub fn mul(p: Edwards25519, s: [32]u8) Error!Edwards25519 { | 238 | pub fn mul(p: Edwards25519, s: [32]u8) Error!Edwards25519 { |
| 239 | const pc = if (p.is_base) basePointPc else pc: { | 239 | const pc = if (p.is_base) basePointPc else pc: { |
| 240 | const xpc = precompute(p, 15); | 240 | const xpc = precompute(p, 15); |
| 241 | xpc[4].rejectIdentity() catch |_| return error.WeakPublicKey; | 241 | xpc[4].rejectIdentity() catch return error.WeakPublicKey; |
| 242 | break :pc xpc; | 242 | break :pc xpc; |
| 243 | }; | 243 | }; |
| 244 | return pcMul16(pc, s, false); | 244 | return pcMul16(pc, s, false); |
| ... | @@ -251,7 +251,7 @@ pub const Edwards25519 = struct { | ... | @@ -251,7 +251,7 @@ pub const Edwards25519 = struct { |
| 251 | return pcMul16(basePointPc, s, true); | 251 | return pcMul16(basePointPc, s, true); |
| 252 | } else { | 252 | } else { |
| 253 | const pc = precompute(p, 8); | 253 | const pc = precompute(p, 8); |
| 254 | pc[4].rejectIdentity() catch |_| return error.WeakPublicKey; | 254 | pc[4].rejectIdentity() catch return error.WeakPublicKey; |
| 255 | return pcMul(pc, s, true); | 255 | return pcMul(pc, s, true); |
| 256 | } | 256 | } |
| 257 | } | 257 | } |
| ... | @@ -266,7 +266,7 @@ pub const Edwards25519 = struct { | ... | @@ -266,7 +266,7 @@ pub const Edwards25519 = struct { |
| 266 | pcs[i] = comptime precompute(Edwards25519.basePoint, 8); | 266 | pcs[i] = comptime precompute(Edwards25519.basePoint, 8); |
| 267 | } else { | 267 | } else { |
| 268 | pcs[i] = precompute(p, 8); | 268 | pcs[i] = precompute(p, 8); |
| 269 | pcs[i][4].rejectIdentity() catch |_| return error.WeakPublicKey; | 269 | pcs[i][4].rejectIdentity() catch return error.WeakPublicKey; |
| 270 | } | 270 | } |
| 271 | } | 271 | } |
| 272 | var es: [count][2 * 32]i8 = undefined; | 272 | var es: [count][2 * 32]i8 = undefined; |
lib/std/crypto/utils.zig+6-6| ... | @@ -16,9 +16,9 @@ pub fn timingSafeEql(comptime T: type, a: T, b: T) bool { | ... | @@ -16,9 +16,9 @@ pub fn timingSafeEql(comptime T: type, a: T, b: T) bool { |
| 16 | for (a) |x, i| { | 16 | for (a) |x, i| { |
| 17 | acc |= x ^ b[i]; | 17 | acc |= x ^ b[i]; |
| 18 | } | 18 | } |
| 19 | comptime const s = @typeInfo(C).Int.bits; | 19 | const s = @typeInfo(C).Int.bits; |
| 20 | comptime const Cu = std.meta.Int(.unsigned, s); | 20 | const Cu = std.meta.Int(.unsigned, s); |
| 21 | comptime const Cext = std.meta.Int(.unsigned, s + 1); | 21 | const Cext = std.meta.Int(.unsigned, s + 1); |
| 22 | return @bitCast(bool, @truncate(u1, (@as(Cext, @bitCast(Cu, acc)) -% 1) >> s)); | 22 | return @bitCast(bool, @truncate(u1, (@as(Cext, @bitCast(Cu, acc)) -% 1) >> s)); |
| 23 | }, | 23 | }, |
| 24 | .Vector => |info| { | 24 | .Vector => |info| { |
| ... | @@ -27,9 +27,9 @@ pub fn timingSafeEql(comptime T: type, a: T, b: T) bool { | ... | @@ -27,9 +27,9 @@ pub fn timingSafeEql(comptime T: type, a: T, b: T) bool { |
| 27 | @compileError("Elements to be compared must be integers"); | 27 | @compileError("Elements to be compared must be integers"); |
| 28 | } | 28 | } |
| 29 | const acc = @reduce(.Or, a ^ b); | 29 | const acc = @reduce(.Or, a ^ b); |
| 30 | comptime const s = @typeInfo(C).Int.bits; | 30 | const s = @typeInfo(C).Int.bits; |
| 31 | comptime const Cu = std.meta.Int(.unsigned, s); | 31 | const Cu = std.meta.Int(.unsigned, s); |
| 32 | comptime const Cext = std.meta.Int(.unsigned, s + 1); | 32 | const Cext = std.meta.Int(.unsigned, s + 1); |
| 33 | return @bitCast(bool, @truncate(u1, (@as(Cext, @bitCast(Cu, acc)) -% 1) >> s)); | 33 | return @bitCast(bool, @truncate(u1, (@as(Cext, @bitCast(Cu, acc)) -% 1) >> s)); |
| 34 | }, | 34 | }, |
| 35 | else => { | 35 | else => { |
lib/std/elf.zig+2-2| ... | @@ -311,7 +311,7 @@ pub const VER_FLG_BASE = 0x1; | ... | @@ -311,7 +311,7 @@ pub const VER_FLG_BASE = 0x1; |
| 311 | pub const VER_FLG_WEAK = 0x2; | 311 | pub const VER_FLG_WEAK = 0x2; |
| 312 | 312 | ||
| 313 | /// File types | 313 | /// File types |
| 314 | pub const ET = extern enum(u16) { | 314 | pub const ET = enum(u16) { |
| 315 | /// No file type | 315 | /// No file type |
| 316 | NONE = 0, | 316 | NONE = 0, |
| 317 | 317 | ||
| ... | @@ -991,7 +991,7 @@ pub const Half = switch (@sizeOf(usize)) { | ... | @@ -991,7 +991,7 @@ pub const Half = switch (@sizeOf(usize)) { |
| 991 | /// See current registered ELF machine architectures at: | 991 | /// See current registered ELF machine architectures at: |
| 992 | /// http://www.uxsglobal.com/developers/gabi/latest/ch4.eheader.html | 992 | /// http://www.uxsglobal.com/developers/gabi/latest/ch4.eheader.html |
| 993 | /// The underscore prefix is because many of these start with numbers. | 993 | /// The underscore prefix is because many of these start with numbers. |
| 994 | pub const EM = extern enum(u16) { | 994 | pub const EM = enum(u16) { |
| 995 | /// No machine | 995 | /// No machine |
| 996 | _NONE = 0, | 996 | _NONE = 0, |
| 997 | 997 |
lib/std/fmt.zig+14-14| ... | @@ -187,7 +187,7 @@ pub fn format( | ... | @@ -187,7 +187,7 @@ pub fn format( |
| 187 | 187 | ||
| 188 | comptime var i = 0; | 188 | comptime var i = 0; |
| 189 | inline while (i < fmt.len) { | 189 | inline while (i < fmt.len) { |
| 190 | comptime const start_index = i; | 190 | const start_index = i; |
| 191 | 191 | ||
| 192 | inline while (i < fmt.len) : (i += 1) { | 192 | inline while (i < fmt.len) : (i += 1) { |
| 193 | switch (fmt[i]) { | 193 | switch (fmt[i]) { |
| ... | @@ -226,10 +226,10 @@ pub fn format( | ... | @@ -226,10 +226,10 @@ pub fn format( |
| 226 | comptime assert(fmt[i] == '{'); | 226 | comptime assert(fmt[i] == '{'); |
| 227 | i += 1; | 227 | i += 1; |
| 228 | 228 | ||
| 229 | comptime const fmt_begin = i; | 229 | const fmt_begin = i; |
| 230 | // Find the closing brace | 230 | // Find the closing brace |
| 231 | inline while (i < fmt.len and fmt[i] != '}') : (i += 1) {} | 231 | inline while (i < fmt.len and fmt[i] != '}') : (i += 1) {} |
| 232 | comptime const fmt_end = i; | 232 | const fmt_end = i; |
| 233 | 233 | ||
| 234 | if (i >= fmt.len) { | 234 | if (i >= fmt.len) { |
| 235 | @compileError("Missing closing }"); | 235 | @compileError("Missing closing }"); |
| ... | @@ -246,23 +246,23 @@ pub fn format( | ... | @@ -246,23 +246,23 @@ pub fn format( |
| 246 | parser.pos = 0; | 246 | parser.pos = 0; |
| 247 | 247 | ||
| 248 | // Parse the positional argument number | 248 | // Parse the positional argument number |
| 249 | comptime const opt_pos_arg = init: { | 249 | const opt_pos_arg = comptime init: { |
| 250 | if (comptime parser.maybe('[')) { | 250 | if (parser.maybe('[')) { |
| 251 | comptime const arg_name = parser.until(']'); | 251 | const arg_name = parser.until(']'); |
| 252 | 252 | ||
| 253 | if (!comptime parser.maybe(']')) { | 253 | if (!parser.maybe(']')) { |
| 254 | @compileError("Expected closing ]"); | 254 | @compileError("Expected closing ]"); |
| 255 | } | 255 | } |
| 256 | 256 | ||
| 257 | break :init comptime meta.fieldIndex(ArgsType, arg_name) orelse | 257 | break :init meta.fieldIndex(ArgsType, arg_name) orelse |
| 258 | @compileError("No argument with name '" ++ arg_name ++ "'"); | 258 | @compileError("No argument with name '" ++ arg_name ++ "'"); |
| 259 | } else { | 259 | } else { |
| 260 | break :init comptime parser.number(); | 260 | break :init parser.number(); |
| 261 | } | 261 | } |
| 262 | }; | 262 | }; |
| 263 | 263 | ||
| 264 | // Parse the format specifier | 264 | // Parse the format specifier |
| 265 | comptime const specifier_arg = comptime parser.until(':'); | 265 | const specifier_arg = comptime parser.until(':'); |
| 266 | 266 | ||
| 267 | // Skip the colon, if present | 267 | // Skip the colon, if present |
| 268 | if (comptime parser.char()) |ch| { | 268 | if (comptime parser.char()) |ch| { |
| ... | @@ -302,13 +302,13 @@ pub fn format( | ... | @@ -302,13 +302,13 @@ pub fn format( |
| 302 | // Parse the width parameter | 302 | // Parse the width parameter |
| 303 | options.width = init: { | 303 | options.width = init: { |
| 304 | if (comptime parser.maybe('[')) { | 304 | if (comptime parser.maybe('[')) { |
| 305 | comptime const arg_name = parser.until(']'); | 305 | const arg_name = parser.until(']'); |
| 306 | 306 | ||
| 307 | if (!comptime parser.maybe(']')) { | 307 | if (!comptime parser.maybe(']')) { |
| 308 | @compileError("Expected closing ]"); | 308 | @compileError("Expected closing ]"); |
| 309 | } | 309 | } |
| 310 | 310 | ||
| 311 | comptime const index = meta.fieldIndex(ArgsType, arg_name) orelse | 311 | const index = meta.fieldIndex(ArgsType, arg_name) orelse |
| 312 | @compileError("No argument with name '" ++ arg_name ++ "'"); | 312 | @compileError("No argument with name '" ++ arg_name ++ "'"); |
| 313 | const arg_index = comptime arg_state.nextArg(index); | 313 | const arg_index = comptime arg_state.nextArg(index); |
| 314 | 314 | ||
| ... | @@ -328,13 +328,13 @@ pub fn format( | ... | @@ -328,13 +328,13 @@ pub fn format( |
| 328 | // Parse the precision parameter | 328 | // Parse the precision parameter |
| 329 | options.precision = init: { | 329 | options.precision = init: { |
| 330 | if (comptime parser.maybe('[')) { | 330 | if (comptime parser.maybe('[')) { |
| 331 | comptime const arg_name = parser.until(']'); | 331 | const arg_name = parser.until(']'); |
| 332 | 332 | ||
| 333 | if (!comptime parser.maybe(']')) { | 333 | if (!comptime parser.maybe(']')) { |
| 334 | @compileError("Expected closing ]"); | 334 | @compileError("Expected closing ]"); |
| 335 | } | 335 | } |
| 336 | 336 | ||
| 337 | comptime const arg_i = meta.fieldIndex(ArgsType, arg_name) orelse | 337 | const arg_i = meta.fieldIndex(ArgsType, arg_name) orelse |
| 338 | @compileError("No argument with name '" ++ arg_name ++ "'"); | 338 | @compileError("No argument with name '" ++ arg_name ++ "'"); |
| 339 | const arg_to_use = comptime arg_state.nextArg(arg_i); | 339 | const arg_to_use = comptime arg_state.nextArg(arg_i); |
| 340 | 340 |
lib/std/json.zig+2-2| ... | @@ -195,7 +195,7 @@ pub const StreamingParser = struct { | ... | @@ -195,7 +195,7 @@ pub const StreamingParser = struct { |
| 195 | p.number_is_integer = undefined; | 195 | p.number_is_integer = undefined; |
| 196 | } | 196 | } |
| 197 | 197 | ||
| 198 | pub const State = enum { | 198 | pub const State = enum(u8) { |
| 199 | // These must be first with these explicit values as we rely on them for indexing the | 199 | // These must be first with these explicit values as we rely on them for indexing the |
| 200 | // bit-stack directly and avoiding a branch. | 200 | // bit-stack directly and avoiding a branch. |
| 201 | ObjectSeparator = 0, | 201 | ObjectSeparator = 0, |
| ... | @@ -1765,7 +1765,7 @@ test "parse" { | ... | @@ -1765,7 +1765,7 @@ test "parse" { |
| 1765 | } | 1765 | } |
| 1766 | 1766 | ||
| 1767 | test "parse into enum" { | 1767 | test "parse into enum" { |
| 1768 | const T = extern enum { | 1768 | const T = enum(u32) { |
| 1769 | Foo = 42, | 1769 | Foo = 42, |
| 1770 | Bar, | 1770 | Bar, |
| 1771 | @"with\\escape", | 1771 | @"with\\escape", |
lib/std/macho.zig+5-5| ... | @@ -1314,13 +1314,13 @@ pub const BIND_OPCODE_SET_SYMBOL_TRAILING_FLAGS_IMM: u8 = 0x40; | ... | @@ -1314,13 +1314,13 @@ pub const BIND_OPCODE_SET_SYMBOL_TRAILING_FLAGS_IMM: u8 = 0x40; |
| 1314 | pub const BIND_OPCODE_SET_TYPE_IMM: u8 = 0x50; | 1314 | pub const BIND_OPCODE_SET_TYPE_IMM: u8 = 0x50; |
| 1315 | pub const BIND_OPCODE_SET_ADDEND_SLEB: u8 = 0x60; | 1315 | pub const BIND_OPCODE_SET_ADDEND_SLEB: u8 = 0x60; |
| 1316 | pub const BIND_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB: u8 = 0x70; | 1316 | pub const BIND_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB: u8 = 0x70; |
| 1317 | pub const BIND_OPCODE_ADD_ADDR_ULEB: 0x80; | 1317 | pub const BIND_OPCODE_ADD_ADDR_ULEB: u8 = 0x80; |
| 1318 | pub const BIND_OPCODE_DO_BIND: u8 = 0x90; | 1318 | pub const BIND_OPCODE_DO_BIND: u8 = 0x90; |
| 1319 | pub const BIND_OPCODE_DO_BIND_ADD_ADDR_ULEB: u8 = 0xa0; | 1319 | pub const BIND_OPCODE_DO_BIND_ADD_ADDR_ULEB: u8 = 0xa0; |
| 1320 | pub const BIND_OPCODE_DO_BIND_ADD_ADDR_IMM_SCALED: u8 = 0xb0; | 1320 | pub const BIND_OPCODE_DO_BIND_ADD_ADDR_IMM_SCALED: u8 = 0xb0; |
| 1321 | pub const BIND_OPCODE_DO_BIND_ULEB_TIMES_SKIPPING_ULEB: u8 = xc0; | 1321 | pub const BIND_OPCODE_DO_BIND_ULEB_TIMES_SKIPPING_ULEB: u8 = 0xc0; |
| 1322 | 1322 | ||
| 1323 | pub const reloc_type_x86_64 = packed enum(u4) { | 1323 | pub const reloc_type_x86_64 = enum(u4) { |
| 1324 | /// for absolute addresses | 1324 | /// for absolute addresses |
| 1325 | X86_64_RELOC_UNSIGNED = 0, | 1325 | X86_64_RELOC_UNSIGNED = 0, |
| 1326 | 1326 | ||
| ... | @@ -1352,9 +1352,9 @@ pub const reloc_type_x86_64 = packed enum(u4) { | ... | @@ -1352,9 +1352,9 @@ pub const reloc_type_x86_64 = packed enum(u4) { |
| 1352 | X86_64_RELOC_TLV, | 1352 | X86_64_RELOC_TLV, |
| 1353 | }; | 1353 | }; |
| 1354 | 1354 | ||
| 1355 | pub const reloc_type_arm64 = packed enum(u4) { | 1355 | pub const reloc_type_arm64 = enum(u4) { |
| 1356 | /// For pointers. | 1356 | /// For pointers. |
| 1357 | ARM64_RELOC_UNSIGNED = 0, | 1357 | ARM64_RELOC_UNSIGNED, |
| 1358 | 1358 | ||
| 1359 | /// Must be followed by a ARM64_RELOC_UNSIGNED. | 1359 | /// Must be followed by a ARM64_RELOC_UNSIGNED. |
| 1360 | ARM64_RELOC_SUBTRACTOR, | 1360 | ARM64_RELOC_SUBTRACTOR, |
lib/std/mem.zig+1-1| ... | @@ -356,7 +356,7 @@ test "mem.zeroes" { | ... | @@ -356,7 +356,7 @@ test "mem.zeroes" { |
| 356 | /// If the field is present in the provided initial values, it will have that value instead. | 356 | /// If the field is present in the provided initial values, it will have that value instead. |
| 357 | /// Structs are initialized recursively. | 357 | /// Structs are initialized recursively. |
| 358 | pub fn zeroInit(comptime T: type, init: anytype) T { | 358 | pub fn zeroInit(comptime T: type, init: anytype) T { |
| 359 | comptime const Init = @TypeOf(init); | 359 | const Init = @TypeOf(init); |
| 360 | 360 | ||
| 361 | switch (@typeInfo(T)) { | 361 | switch (@typeInfo(T)) { |
| 362 | .Struct => |struct_info| { | 362 | .Struct => |struct_info| { |
lib/std/meta.zig-4| ... | @@ -335,9 +335,6 @@ test "std.meta.containerLayout" { | ... | @@ -335,9 +335,6 @@ test "std.meta.containerLayout" { |
| 335 | const E1 = enum { | 335 | const E1 = enum { |
| 336 | A, | 336 | A, |
| 337 | }; | 337 | }; |
| 338 | const E2 = packed enum { | ||
| 339 | A, | ||
| 340 | }; | ||
| 341 | const E3 = extern enum { | 338 | const E3 = extern enum { |
| 342 | A, | 339 | A, |
| 343 | }; | 340 | }; |
| ... | @@ -355,7 +352,6 @@ test "std.meta.containerLayout" { | ... | @@ -355,7 +352,6 @@ test "std.meta.containerLayout" { |
| 355 | }; | 352 | }; |
| 356 | 353 | ||
| 357 | testing.expect(containerLayout(E1) == .Auto); | 354 | testing.expect(containerLayout(E1) == .Auto); |
| 358 | testing.expect(containerLayout(E2) == .Packed); | ||
| 359 | testing.expect(containerLayout(E3) == .Extern); | 355 | testing.expect(containerLayout(E3) == .Extern); |
| 360 | testing.expect(containerLayout(S1) == .Auto); | 356 | testing.expect(containerLayout(S1) == .Auto); |
| 361 | testing.expect(containerLayout(S2) == .Packed); | 357 | testing.expect(containerLayout(S2) == .Packed); |
lib/std/os/bits/darwin.zig+4-4| ... | @@ -1521,19 +1521,19 @@ pub const rusage = extern struct { | ... | @@ -1521,19 +1521,19 @@ pub const rusage = extern struct { |
| 1521 | nivcsw: isize, | 1521 | nivcsw: isize, |
| 1522 | }; | 1522 | }; |
| 1523 | 1523 | ||
| 1524 | pub const rlimit_resource = extern enum(c_int) { | 1524 | pub const rlimit_resource = enum(c_int) { |
| 1525 | CPU = 0, | 1525 | CPU = 0, |
| 1526 | FSIZE = 1, | 1526 | FSIZE = 1, |
| 1527 | DATA = 2, | 1527 | DATA = 2, |
| 1528 | STACK = 3, | 1528 | STACK = 3, |
| 1529 | CORE = 4, | 1529 | CORE = 4, |
| 1530 | AS = 5, | ||
| 1531 | RSS = 5, | 1530 | RSS = 5, |
| 1532 | MEMLOCK = 6, | 1531 | MEMLOCK = 6, |
| 1533 | NPROC = 7, | 1532 | NPROC = 7, |
| 1534 | NOFILE = 8, | 1533 | NOFILE = 8, |
| 1535 | |||
| 1536 | _, | 1534 | _, |
| 1535 | |||
| 1536 | pub const AS: rlimit_resource = .RSS; | ||
| 1537 | }; | 1537 | }; |
| 1538 | 1538 | ||
| 1539 | pub const rlim_t = u64; | 1539 | pub const rlim_t = u64; |
| ... | @@ -1669,7 +1669,7 @@ pub const TCSANOW = 0; // make change immediate | ... | @@ -1669,7 +1669,7 @@ pub const TCSANOW = 0; // make change immediate |
| 1669 | pub const TCSADRAIN = 1; // drain output, then change | 1669 | pub const TCSADRAIN = 1; // drain output, then change |
| 1670 | pub const TCSAFLUSH = 2; // drain output, flush input | 1670 | pub const TCSAFLUSH = 2; // drain output, flush input |
| 1671 | pub const TCSASOFT = 0x10; // flag - don't alter h.w. state | 1671 | pub const TCSASOFT = 0x10; // flag - don't alter h.w. state |
| 1672 | pub const TCSA = extern enum(c_uint) { | 1672 | pub const TCSA = enum(c_uint) { |
| 1673 | NOW, | 1673 | NOW, |
| 1674 | DRAIN, | 1674 | DRAIN, |
| 1675 | FLUSH, | 1675 | FLUSH, |
lib/std/os/bits/dragonfly.zig+3-3| ... | @@ -734,7 +734,7 @@ pub const Flock = extern struct { | ... | @@ -734,7 +734,7 @@ pub const Flock = extern struct { |
| 734 | l_whence: c_short, | 734 | l_whence: c_short, |
| 735 | }; | 735 | }; |
| 736 | 736 | ||
| 737 | pub const rlimit_resource = extern enum(c_int) { | 737 | pub const rlimit_resource = enum(c_int) { |
| 738 | CPU = 0, | 738 | CPU = 0, |
| 739 | FSIZE = 1, | 739 | FSIZE = 1, |
| 740 | DATA = 2, | 740 | DATA = 2, |
| ... | @@ -745,11 +745,11 @@ pub const rlimit_resource = extern enum(c_int) { | ... | @@ -745,11 +745,11 @@ pub const rlimit_resource = extern enum(c_int) { |
| 745 | NPROC = 7, | 745 | NPROC = 7, |
| 746 | NOFILE = 8, | 746 | NOFILE = 8, |
| 747 | SBSIZE = 9, | 747 | SBSIZE = 9, |
| 748 | AS = 10, | ||
| 749 | VMEM = 10, | 748 | VMEM = 10, |
| 750 | POSIXLOCKS = 11, | 749 | POSIXLOCKS = 11, |
| 751 | |||
| 752 | _, | 750 | _, |
| 751 | |||
| 752 | pub const AS: rlimit_resource = .VMEM; | ||
| 753 | }; | 753 | }; |
| 754 | 754 | ||
| 755 | pub const rlim_t = i64; | 755 | pub const rlim_t = i64; |
lib/std/os/bits/freebsd.zig+3-3| ... | @@ -1459,7 +1459,7 @@ pub const IPPROTO_RESERVED_253 = 253; | ... | @@ -1459,7 +1459,7 @@ pub const IPPROTO_RESERVED_253 = 253; |
| 1459 | /// Reserved | 1459 | /// Reserved |
| 1460 | pub const IPPROTO_RESERVED_254 = 254; | 1460 | pub const IPPROTO_RESERVED_254 = 254; |
| 1461 | 1461 | ||
| 1462 | pub const rlimit_resource = extern enum(c_int) { | 1462 | pub const rlimit_resource = enum(c_int) { |
| 1463 | CPU = 0, | 1463 | CPU = 0, |
| 1464 | FSIZE = 1, | 1464 | FSIZE = 1, |
| 1465 | DATA = 2, | 1465 | DATA = 2, |
| ... | @@ -1471,13 +1471,13 @@ pub const rlimit_resource = extern enum(c_int) { | ... | @@ -1471,13 +1471,13 @@ pub const rlimit_resource = extern enum(c_int) { |
| 1471 | NOFILE = 8, | 1471 | NOFILE = 8, |
| 1472 | SBSIZE = 9, | 1472 | SBSIZE = 9, |
| 1473 | VMEM = 10, | 1473 | VMEM = 10, |
| 1474 | AS = 10, | ||
| 1475 | NPTS = 11, | 1474 | NPTS = 11, |
| 1476 | SWAP = 12, | 1475 | SWAP = 12, |
| 1477 | KQUEUES = 13, | 1476 | KQUEUES = 13, |
| 1478 | UMTXP = 14, | 1477 | UMTXP = 14, |
| 1479 | |||
| 1480 | _, | 1478 | _, |
| 1479 | |||
| 1480 | pub const AS: rlimit_resource = .VMEM; | ||
| 1481 | }; | 1481 | }; |
| 1482 | 1482 | ||
| 1483 | pub const rlim_t = i64; | 1483 | pub const rlim_t = i64; |
lib/std/os/bits/haiku.zig+4-4| ... | @@ -1401,7 +1401,7 @@ pub const IPPROTO_RESERVED_253 = 253; | ... | @@ -1401,7 +1401,7 @@ pub const IPPROTO_RESERVED_253 = 253; |
| 1401 | /// Reserved | 1401 | /// Reserved |
| 1402 | pub const IPPROTO_RESERVED_254 = 254; | 1402 | pub const IPPROTO_RESERVED_254 = 254; |
| 1403 | 1403 | ||
| 1404 | pub const rlimit_resource = extern enum(c_int) { | 1404 | pub const rlimit_resource = enum(c_int) { |
| 1405 | CPU = 0, | 1405 | CPU = 0, |
| 1406 | FSIZE = 1, | 1406 | FSIZE = 1, |
| 1407 | DATA = 2, | 1407 | DATA = 2, |
| ... | @@ -1413,13 +1413,13 @@ pub const rlimit_resource = extern enum(c_int) { | ... | @@ -1413,13 +1413,13 @@ pub const rlimit_resource = extern enum(c_int) { |
| 1413 | NOFILE = 8, | 1413 | NOFILE = 8, |
| 1414 | SBSIZE = 9, | 1414 | SBSIZE = 9, |
| 1415 | VMEM = 10, | 1415 | VMEM = 10, |
| 1416 | AS = 10, | ||
| 1417 | NPTS = 11, | 1416 | NPTS = 11, |
| 1418 | SWAP = 12, | 1417 | SWAP = 12, |
| 1419 | KQUEUES = 13, | 1418 | KQUEUES = 13, |
| 1420 | UMTXP = 14, | 1419 | UMTXP = 14, |
| 1421 | |||
| 1422 | _, | 1420 | _, |
| 1421 | |||
| 1422 | pub const AS: rlimit_resource = .VMEM; | ||
| 1423 | }; | 1423 | }; |
| 1424 | 1424 | ||
| 1425 | pub const rlim_t = i64; | 1425 | pub const rlim_t = i64; |
| ... | @@ -1442,7 +1442,7 @@ pub const SHUT_WR = 1; | ... | @@ -1442,7 +1442,7 @@ pub const SHUT_WR = 1; |
| 1442 | pub const SHUT_RDWR = 2; | 1442 | pub const SHUT_RDWR = 2; |
| 1443 | 1443 | ||
| 1444 | // TODO fill out if needed | 1444 | // TODO fill out if needed |
| 1445 | pub const directory_which = extern enum(c_int) { | 1445 | pub const directory_which = enum(c_int) { |
| 1446 | B_USER_SETTINGS_DIRECTORY = 0xbbe, | 1446 | B_USER_SETTINGS_DIRECTORY = 0xbbe, |
| 1447 | 1447 | ||
| 1448 | _, | 1448 | _, |
lib/std/os/bits/linux.zig+8-8| ... | @@ -1487,7 +1487,7 @@ pub const io_uring_sqe = extern struct { | ... | @@ -1487,7 +1487,7 @@ pub const io_uring_sqe = extern struct { |
| 1487 | __pad2: [2]u64, | 1487 | __pad2: [2]u64, |
| 1488 | }; | 1488 | }; |
| 1489 | 1489 | ||
| 1490 | pub const IOSQE_BIT = extern enum(u8) { | 1490 | pub const IOSQE_BIT = enum(u8) { |
| 1491 | FIXED_FILE, | 1491 | FIXED_FILE, |
| 1492 | IO_DRAIN, | 1492 | IO_DRAIN, |
| 1493 | IO_LINK, | 1493 | IO_LINK, |
| ... | @@ -1518,7 +1518,7 @@ pub const IOSQE_ASYNC = 1 << @enumToInt(IOSQE_BIT.ASYNC); | ... | @@ -1518,7 +1518,7 @@ pub const IOSQE_ASYNC = 1 << @enumToInt(IOSQE_BIT.ASYNC); |
| 1518 | /// select buffer from buf_group | 1518 | /// select buffer from buf_group |
| 1519 | pub const IOSQE_BUFFER_SELECT = 1 << @enumToInt(IOSQE_BIT.BUFFER_SELECT); | 1519 | pub const IOSQE_BUFFER_SELECT = 1 << @enumToInt(IOSQE_BIT.BUFFER_SELECT); |
| 1520 | 1520 | ||
| 1521 | pub const IORING_OP = extern enum(u8) { | 1521 | pub const IORING_OP = enum(u8) { |
| 1522 | NOP, | 1522 | NOP, |
| 1523 | READV, | 1523 | READV, |
| 1524 | WRITEV, | 1524 | WRITEV, |
| ... | @@ -1587,7 +1587,7 @@ pub const IORING_ENTER_GETEVENTS = 1 << 0; | ... | @@ -1587,7 +1587,7 @@ pub const IORING_ENTER_GETEVENTS = 1 << 0; |
| 1587 | pub const IORING_ENTER_SQ_WAKEUP = 1 << 1; | 1587 | pub const IORING_ENTER_SQ_WAKEUP = 1 << 1; |
| 1588 | 1588 | ||
| 1589 | // io_uring_register opcodes and arguments | 1589 | // io_uring_register opcodes and arguments |
| 1590 | pub const IORING_REGISTER = extern enum(u8) { | 1590 | pub const IORING_REGISTER = enum(u8) { |
| 1591 | REGISTER_BUFFERS, | 1591 | REGISTER_BUFFERS, |
| 1592 | UNREGISTER_BUFFERS, | 1592 | UNREGISTER_BUFFERS, |
| 1593 | REGISTER_FILES, | 1593 | REGISTER_FILES, |
| ... | @@ -1654,7 +1654,7 @@ pub const io_uring_restriction = extern struct { | ... | @@ -1654,7 +1654,7 @@ pub const io_uring_restriction = extern struct { |
| 1654 | }; | 1654 | }; |
| 1655 | 1655 | ||
| 1656 | /// io_uring_restriction->opcode values | 1656 | /// io_uring_restriction->opcode values |
| 1657 | pub const IORING_RESTRICTION = extern enum(u8) { | 1657 | pub const IORING_RESTRICTION = enum(u8) { |
| 1658 | /// Allow an io_uring_register(2) opcode | 1658 | /// Allow an io_uring_register(2) opcode |
| 1659 | REGISTER_OP = 0, | 1659 | REGISTER_OP = 0, |
| 1660 | 1660 | ||
| ... | @@ -1909,7 +1909,7 @@ pub const tcp_repair_window = extern struct { | ... | @@ -1909,7 +1909,7 @@ pub const tcp_repair_window = extern struct { |
| 1909 | rcv_wup: u32, | 1909 | rcv_wup: u32, |
| 1910 | }; | 1910 | }; |
| 1911 | 1911 | ||
| 1912 | pub const TcpRepairOption = extern enum { | 1912 | pub const TcpRepairOption = enum { |
| 1913 | TCP_NO_QUEUE, | 1913 | TCP_NO_QUEUE, |
| 1914 | TCP_RECV_QUEUE, | 1914 | TCP_RECV_QUEUE, |
| 1915 | TCP_SEND_QUEUE, | 1915 | TCP_SEND_QUEUE, |
| ... | @@ -1917,7 +1917,7 @@ pub const TcpRepairOption = extern enum { | ... | @@ -1917,7 +1917,7 @@ pub const TcpRepairOption = extern enum { |
| 1917 | }; | 1917 | }; |
| 1918 | 1918 | ||
| 1919 | /// why fastopen failed from client perspective | 1919 | /// why fastopen failed from client perspective |
| 1920 | pub const tcp_fastopen_client_fail = extern enum { | 1920 | pub const tcp_fastopen_client_fail = enum { |
| 1921 | /// catch-all | 1921 | /// catch-all |
| 1922 | TFO_STATUS_UNSPEC, | 1922 | TFO_STATUS_UNSPEC, |
| 1923 | /// if not in TFO_CLIENT_NO_COOKIE mode | 1923 | /// if not in TFO_CLIENT_NO_COOKIE mode |
| ... | @@ -2184,7 +2184,7 @@ pub const NOFLSH = 128; | ... | @@ -2184,7 +2184,7 @@ pub const NOFLSH = 128; |
| 2184 | pub const TOSTOP = 256; | 2184 | pub const TOSTOP = 256; |
| 2185 | pub const IEXTEN = 32768; | 2185 | pub const IEXTEN = 32768; |
| 2186 | 2186 | ||
| 2187 | pub const TCSA = extern enum(c_uint) { | 2187 | pub const TCSA = enum(c_uint) { |
| 2188 | NOW, | 2188 | NOW, |
| 2189 | DRAIN, | 2189 | DRAIN, |
| 2190 | FLUSH, | 2190 | FLUSH, |
| ... | @@ -2235,7 +2235,7 @@ pub const ifreq = extern struct { | ... | @@ -2235,7 +2235,7 @@ pub const ifreq = extern struct { |
| 2235 | }; | 2235 | }; |
| 2236 | 2236 | ||
| 2237 | // doc comments copied from musl | 2237 | // doc comments copied from musl |
| 2238 | pub const rlimit_resource = extern enum(c_int) { | 2238 | pub const rlimit_resource = enum(c_int) { |
| 2239 | /// Per-process CPU limit, in seconds. | 2239 | /// Per-process CPU limit, in seconds. |
| 2240 | CPU, | 2240 | CPU, |
| 2241 | 2241 |
lib/std/os/bits/linux/arm-eabi.zig+1-1| ... | @@ -15,7 +15,7 @@ const uid_t = linux.uid_t; | ... | @@ -15,7 +15,7 @@ const uid_t = linux.uid_t; |
| 15 | const gid_t = linux.gid_t; | 15 | const gid_t = linux.gid_t; |
| 16 | const pid_t = linux.pid_t; | 16 | const pid_t = linux.pid_t; |
| 17 | 17 | ||
| 18 | pub const SYS = extern enum(usize) { | 18 | pub const SYS = enum(usize) { |
| 19 | restart_syscall = 0, | 19 | restart_syscall = 0, |
| 20 | exit = 1, | 20 | exit = 1, |
| 21 | fork = 2, | 21 | fork = 2, |
lib/std/os/bits/linux/arm64.zig+1-1| ... | @@ -16,7 +16,7 @@ const gid_t = linux.gid_t; | ... | @@ -16,7 +16,7 @@ const gid_t = linux.gid_t; |
| 16 | const pid_t = linux.pid_t; | 16 | const pid_t = linux.pid_t; |
| 17 | const stack_t = linux.stack_t; | 17 | const stack_t = linux.stack_t; |
| 18 | const sigset_t = linux.sigset_t; | 18 | const sigset_t = linux.sigset_t; |
| 19 | pub const SYS = extern enum(usize) { | 19 | pub const SYS = enum(usize) { |
| 20 | io_setup = 0, | 20 | io_setup = 0, |
| 21 | io_destroy = 1, | 21 | io_destroy = 1, |
| 22 | io_submit = 2, | 22 | io_submit = 2, |
lib/std/os/bits/linux/i386.zig+1-1| ... | @@ -17,7 +17,7 @@ const pid_t = linux.pid_t; | ... | @@ -17,7 +17,7 @@ const pid_t = linux.pid_t; |
| 17 | const stack_t = linux.stack_t; | 17 | const stack_t = linux.stack_t; |
| 18 | const sigset_t = linux.sigset_t; | 18 | const sigset_t = linux.sigset_t; |
| 19 | 19 | ||
| 20 | pub const SYS = extern enum(usize) { | 20 | pub const SYS = enum(usize) { |
| 21 | restart_syscall = 0, | 21 | restart_syscall = 0, |
| 22 | exit = 1, | 22 | exit = 1, |
| 23 | fork = 2, | 23 | fork = 2, |
lib/std/os/bits/linux/mips.zig+1-1| ... | @@ -12,7 +12,7 @@ const uid_t = linux.uid_t; | ... | @@ -12,7 +12,7 @@ const uid_t = linux.uid_t; |
| 12 | const gid_t = linux.gid_t; | 12 | const gid_t = linux.gid_t; |
| 13 | const pid_t = linux.pid_t; | 13 | const pid_t = linux.pid_t; |
| 14 | 14 | ||
| 15 | pub const SYS = extern enum(usize) { | 15 | pub const SYS = enum(usize) { |
| 16 | pub const Linux = 4000; | 16 | pub const Linux = 4000; |
| 17 | 17 | ||
| 18 | syscall = Linux + 0, | 18 | syscall = Linux + 0, |
lib/std/os/bits/linux/netlink.zig+5-4| ... | @@ -126,7 +126,7 @@ pub const NLM_F_CAPPED = 0x100; | ... | @@ -126,7 +126,7 @@ pub const NLM_F_CAPPED = 0x100; |
| 126 | /// extended ACK TVLs were included | 126 | /// extended ACK TVLs were included |
| 127 | pub const NLM_F_ACK_TLVS = 0x200; | 127 | pub const NLM_F_ACK_TLVS = 0x200; |
| 128 | 128 | ||
| 129 | pub const NetlinkMessageType = extern enum(u16) { | 129 | pub const NetlinkMessageType = enum(u16) { |
| 130 | /// < 0x10: reserved control messages | 130 | /// < 0x10: reserved control messages |
| 131 | pub const MIN_TYPE = 0x10; | 131 | pub const MIN_TYPE = 0x10; |
| 132 | 132 | ||
| ... | @@ -287,7 +287,7 @@ pub const rtattr = extern struct { | ... | @@ -287,7 +287,7 @@ pub const rtattr = extern struct { |
| 287 | pub const ALIGNTO = 4; | 287 | pub const ALIGNTO = 4; |
| 288 | }; | 288 | }; |
| 289 | 289 | ||
| 290 | pub const IFLA = extern enum(c_ushort) { | 290 | pub const IFLA = enum(c_ushort) { |
| 291 | UNSPEC, | 291 | UNSPEC, |
| 292 | ADDRESS, | 292 | ADDRESS, |
| 293 | BROADCAST, | 293 | BROADCAST, |
| ... | @@ -351,8 +351,7 @@ pub const IFLA = extern enum(c_ushort) { | ... | @@ -351,8 +351,7 @@ pub const IFLA = extern enum(c_ushort) { |
| 351 | EVENT, | 351 | EVENT, |
| 352 | 352 | ||
| 353 | NEW_NETNSID, | 353 | NEW_NETNSID, |
| 354 | IF_NETNSID = 46, | 354 | IF_NETNSID, |
| 355 | TARGET_NETNSID = 46, // new alias | ||
| 356 | 355 | ||
| 357 | CARRIER_UP_COUNT, | 356 | CARRIER_UP_COUNT, |
| 358 | CARRIER_DOWN_COUNT, | 357 | CARRIER_DOWN_COUNT, |
| ... | @@ -361,6 +360,8 @@ pub const IFLA = extern enum(c_ushort) { | ... | @@ -361,6 +360,8 @@ pub const IFLA = extern enum(c_ushort) { |
| 361 | MAX_MTU, | 360 | MAX_MTU, |
| 362 | 361 | ||
| 363 | _, | 362 | _, |
| 363 | |||
| 364 | pub const TARGET_NETNSID: IFLA = .IF_NETNSID; | ||
| 364 | }; | 365 | }; |
| 365 | 366 | ||
| 366 | pub const rtnl_link_ifmap = extern struct { | 367 | pub const rtnl_link_ifmap = extern struct { |
lib/std/os/bits/linux/powerpc.zig+1-1| ... | @@ -14,7 +14,7 @@ const gid_t = linux.gid_t; | ... | @@ -14,7 +14,7 @@ const gid_t = linux.gid_t; |
| 14 | const pid_t = linux.pid_t; | 14 | const pid_t = linux.pid_t; |
| 15 | const stack_t = linux.stack_t; | 15 | const stack_t = linux.stack_t; |
| 16 | const sigset_t = linux.sigset_t; | 16 | const sigset_t = linux.sigset_t; |
| 17 | pub const SYS = extern enum(usize) { | 17 | pub const SYS = enum(usize) { |
| 18 | restart_syscall = 0, | 18 | restart_syscall = 0, |
| 19 | exit = 1, | 19 | exit = 1, |
| 20 | fork = 2, | 20 | fork = 2, |
lib/std/os/bits/linux/powerpc64.zig+2-2| ... | @@ -14,7 +14,7 @@ const gid_t = linux.gid_t; | ... | @@ -14,7 +14,7 @@ const gid_t = linux.gid_t; |
| 14 | const pid_t = linux.pid_t; | 14 | const pid_t = linux.pid_t; |
| 15 | const stack_t = linux.stack_t; | 15 | const stack_t = linux.stack_t; |
| 16 | const sigset_t = linux.sigset_t; | 16 | const sigset_t = linux.sigset_t; |
| 17 | pub const SYS = extern enum(usize) { | 17 | pub const SYS = enum(usize) { |
| 18 | restart_syscall = 0, | 18 | restart_syscall = 0, |
| 19 | exit = 1, | 19 | exit = 1, |
| 20 | fork = 2, | 20 | fork = 2, |
| ... | @@ -295,7 +295,7 @@ pub const SYS = extern enum(usize) { | ... | @@ -295,7 +295,7 @@ pub const SYS = extern enum(usize) { |
| 295 | mknodat = 288, | 295 | mknodat = 288, |
| 296 | fchownat = 289, | 296 | fchownat = 289, |
| 297 | futimesat = 290, | 297 | futimesat = 290, |
| 298 | newfstatat = 291, | 298 | fstatat = 291, |
| 299 | unlinkat = 292, | 299 | unlinkat = 292, |
| 300 | renameat = 293, | 300 | renameat = 293, |
| 301 | linkat = 294, | 301 | linkat = 294, |
lib/std/os/bits/linux/prctl.zig+1-1| ... | @@ -4,7 +4,7 @@ | ... | @@ -4,7 +4,7 @@ |
| 4 | // The MIT license requires this copyright notice to be included in all copies | 4 | // The MIT license requires this copyright notice to be included in all copies |
| 5 | // and substantial portions of the software. | 5 | // and substantial portions of the software. |
| 6 | 6 | ||
| 7 | pub const PR = extern enum(i32) { | 7 | pub const PR = enum(i32) { |
| 8 | SET_PDEATHSIG = 1, | 8 | SET_PDEATHSIG = 1, |
| 9 | GET_PDEATHSIG = 2, | 9 | GET_PDEATHSIG = 2, |
| 10 | 10 |
lib/std/os/bits/linux/riscv64.zig+1-1| ... | @@ -9,7 +9,7 @@ const uid_t = std.os.linux.uid_t; | ... | @@ -9,7 +9,7 @@ const uid_t = std.os.linux.uid_t; |
| 9 | const gid_t = std.os.linux.gid_t; | 9 | const gid_t = std.os.linux.gid_t; |
| 10 | const pid_t = std.os.linux.pid_t; | 10 | const pid_t = std.os.linux.pid_t; |
| 11 | 11 | ||
| 12 | pub const SYS = extern enum(usize) { | 12 | pub const SYS = enum(usize) { |
| 13 | pub const arch_specific_syscall = 244; | 13 | pub const arch_specific_syscall = 244; |
| 14 | 14 | ||
| 15 | io_setup = 0, | 15 | io_setup = 0, |
lib/std/os/bits/linux/sparc64.zig+1-1| ... | @@ -12,7 +12,7 @@ const socklen_t = linux.socklen_t; | ... | @@ -12,7 +12,7 @@ const socklen_t = linux.socklen_t; |
| 12 | const iovec = linux.iovec; | 12 | const iovec = linux.iovec; |
| 13 | const iovec_const = linux.iovec_const; | 13 | const iovec_const = linux.iovec_const; |
| 14 | 14 | ||
| 15 | pub const SYS = extern enum(usize) { | 15 | pub const SYS = enum(usize) { |
| 16 | restart_syscall = 0, | 16 | restart_syscall = 0, |
| 17 | exit = 1, | 17 | exit = 1, |
| 18 | fork = 2, | 18 | fork = 2, |
lib/std/os/bits/linux/x86_64.zig+1-2| ... | @@ -21,7 +21,7 @@ const iovec_const = linux.iovec_const; | ... | @@ -21,7 +21,7 @@ const iovec_const = linux.iovec_const; |
| 21 | pub const mode_t = usize; | 21 | pub const mode_t = usize; |
| 22 | pub const time_t = isize; | 22 | pub const time_t = isize; |
| 23 | 23 | ||
| 24 | pub const SYS = extern enum(usize) { | 24 | pub const SYS = enum(usize) { |
| 25 | read = 0, | 25 | read = 0, |
| 26 | write = 1, | 26 | write = 1, |
| 27 | open = 2, | 27 | open = 2, |
| ... | @@ -284,7 +284,6 @@ pub const SYS = extern enum(usize) { | ... | @@ -284,7 +284,6 @@ pub const SYS = extern enum(usize) { |
| 284 | mknodat = 259, | 284 | mknodat = 259, |
| 285 | fchownat = 260, | 285 | fchownat = 260, |
| 286 | futimesat = 261, | 286 | futimesat = 261, |
| 287 | newfstatat = 262, | ||
| 288 | fstatat = 262, | 287 | fstatat = 262, |
| 289 | unlinkat = 263, | 288 | unlinkat = 263, |
| 290 | renameat = 264, | 289 | renameat = 264, |
lib/std/os/bits/netbsd.zig+4-4| ... | @@ -60,7 +60,7 @@ pub const addrinfo = extern struct { | ... | @@ -60,7 +60,7 @@ pub const addrinfo = extern struct { |
| 60 | next: ?*addrinfo, | 60 | next: ?*addrinfo, |
| 61 | }; | 61 | }; |
| 62 | 62 | ||
| 63 | pub const EAI = extern enum(c_int) { | 63 | pub const EAI = enum(c_int) { |
| 64 | /// address family for hostname not supported | 64 | /// address family for hostname not supported |
| 65 | ADDRFAMILY = 1, | 65 | ADDRFAMILY = 1, |
| 66 | 66 | ||
| ... | @@ -1179,7 +1179,7 @@ pub const IPPROTO_PFSYNC = 240; | ... | @@ -1179,7 +1179,7 @@ pub const IPPROTO_PFSYNC = 240; |
| 1179 | /// raw IP packet | 1179 | /// raw IP packet |
| 1180 | pub const IPPROTO_RAW = 255; | 1180 | pub const IPPROTO_RAW = 255; |
| 1181 | 1181 | ||
| 1182 | pub const rlimit_resource = extern enum(c_int) { | 1182 | pub const rlimit_resource = enum(c_int) { |
| 1183 | CPU = 0, | 1183 | CPU = 0, |
| 1184 | FSIZE = 1, | 1184 | FSIZE = 1, |
| 1185 | DATA = 2, | 1185 | DATA = 2, |
| ... | @@ -1190,11 +1190,11 @@ pub const rlimit_resource = extern enum(c_int) { | ... | @@ -1190,11 +1190,11 @@ pub const rlimit_resource = extern enum(c_int) { |
| 1190 | NPROC = 7, | 1190 | NPROC = 7, |
| 1191 | NOFILE = 8, | 1191 | NOFILE = 8, |
| 1192 | SBSIZE = 9, | 1192 | SBSIZE = 9, |
| 1193 | AS = 10, | ||
| 1194 | VMEM = 10, | 1193 | VMEM = 10, |
| 1195 | NTHR = 11, | 1194 | NTHR = 11, |
| 1196 | |||
| 1197 | _, | 1195 | _, |
| 1196 | |||
| 1197 | pub const AS: rlimit_resource = .VMEM; | ||
| 1198 | }; | 1198 | }; |
| 1199 | 1199 | ||
| 1200 | pub const rlim_t = u64; | 1200 | pub const rlim_t = u64; |
lib/std/os/bits/openbsd.zig+3-3| ... | @@ -76,7 +76,7 @@ pub const addrinfo = extern struct { | ... | @@ -76,7 +76,7 @@ pub const addrinfo = extern struct { |
| 76 | next: ?*addrinfo, | 76 | next: ?*addrinfo, |
| 77 | }; | 77 | }; |
| 78 | 78 | ||
| 79 | pub const EAI = extern enum(c_int) { | 79 | pub const EAI = enum(c_int) { |
| 80 | /// address family for hostname not supported | 80 | /// address family for hostname not supported |
| 81 | ADDRFAMILY = -9, | 81 | ADDRFAMILY = -9, |
| 82 | 82 | ||
| ... | @@ -805,7 +805,7 @@ comptime { | ... | @@ -805,7 +805,7 @@ comptime { |
| 805 | if (@sizeOf(usize) == 4) | 805 | if (@sizeOf(usize) == 4) |
| 806 | std.debug.assert(@sizeOf(siginfo_t) == 128) | 806 | std.debug.assert(@sizeOf(siginfo_t) == 128) |
| 807 | else | 807 | else |
| 808 | // Take into account the padding between errno and data fields. | 808 | // Take into account the padding between errno and data fields. |
| 809 | std.debug.assert(@sizeOf(siginfo_t) == 136); | 809 | std.debug.assert(@sizeOf(siginfo_t) == 136); |
| 810 | } | 810 | } |
| 811 | 811 | ||
| ... | @@ -1177,7 +1177,7 @@ pub const IPPROTO_PFSYNC = 240; | ... | @@ -1177,7 +1177,7 @@ pub const IPPROTO_PFSYNC = 240; |
| 1177 | /// raw IP packet | 1177 | /// raw IP packet |
| 1178 | pub const IPPROTO_RAW = 255; | 1178 | pub const IPPROTO_RAW = 255; |
| 1179 | 1179 | ||
| 1180 | pub const rlimit_resource = extern enum(c_int) { | 1180 | pub const rlimit_resource = enum(c_int) { |
| 1181 | CPU, | 1181 | CPU, |
| 1182 | FSIZE, | 1182 | FSIZE, |
| 1183 | DATA, | 1183 | DATA, |
lib/std/os/linux.zig-2| ... | @@ -1143,8 +1143,6 @@ pub fn lstat(pathname: [*:0]const u8, statbuf: *kernel_stat) usize { | ... | @@ -1143,8 +1143,6 @@ pub fn lstat(pathname: [*:0]const u8, statbuf: *kernel_stat) usize { |
| 1143 | pub fn fstatat(dirfd: i32, path: [*:0]const u8, stat_buf: *kernel_stat, flags: u32) usize { | 1143 | pub fn fstatat(dirfd: i32, path: [*:0]const u8, stat_buf: *kernel_stat, flags: u32) usize { |
| 1144 | if (@hasField(SYS, "fstatat64")) { | 1144 | if (@hasField(SYS, "fstatat64")) { |
| 1145 | return syscall4(.fstatat64, @bitCast(usize, @as(isize, dirfd)), @ptrToInt(path), @ptrToInt(stat_buf), flags); | 1145 | return syscall4(.fstatat64, @bitCast(usize, @as(isize, dirfd)), @ptrToInt(path), @ptrToInt(stat_buf), flags); |
| 1146 | } else if (@hasField(SYS, "newfstatat")) { | ||
| 1147 | return syscall4(.newfstatat, @bitCast(usize, @as(isize, dirfd)), @ptrToInt(path), @ptrToInt(stat_buf), flags); | ||
| 1148 | } else { | 1146 | } else { |
| 1149 | return syscall4(.fstatat, @bitCast(usize, @as(isize, dirfd)), @ptrToInt(path), @ptrToInt(stat_buf), flags); | 1147 | return syscall4(.fstatat, @bitCast(usize, @as(isize, dirfd)), @ptrToInt(path), @ptrToInt(stat_buf), flags); |
| 1150 | } | 1148 | } |
lib/std/os/uefi/status.zig+1-1| ... | @@ -5,7 +5,7 @@ | ... | @@ -5,7 +5,7 @@ |
| 5 | // and substantial portions of the software. | 5 | // and substantial portions of the software. |
| 6 | const high_bit = 1 << @typeInfo(usize).Int.bits - 1; | 6 | const high_bit = 1 << @typeInfo(usize).Int.bits - 1; |
| 7 | 7 | ||
| 8 | pub const Status = extern enum(usize) { | 8 | pub const Status = enum(usize) { |
| 9 | /// The operation completed successfully. | 9 | /// The operation completed successfully. |
| 10 | Success = 0, | 10 | Success = 0, |
| 11 | 11 |
lib/std/os/windows/bits.zig+3-3| ... | @@ -281,7 +281,7 @@ pub const IO_STATUS_BLOCK = extern struct { | ... | @@ -281,7 +281,7 @@ pub const IO_STATUS_BLOCK = extern struct { |
| 281 | Information: ULONG_PTR, | 281 | Information: ULONG_PTR, |
| 282 | }; | 282 | }; |
| 283 | 283 | ||
| 284 | pub const FILE_INFORMATION_CLASS = extern enum { | 284 | pub const FILE_INFORMATION_CLASS = enum(c_int) { |
| 285 | FileDirectoryInformation = 1, | 285 | FileDirectoryInformation = 1, |
| 286 | FileFullDirectoryInformation, | 286 | FileFullDirectoryInformation, |
| 287 | FileBothDirectoryInformation, | 287 | FileBothDirectoryInformation, |
| ... | @@ -901,7 +901,7 @@ pub const COINIT_APARTMENTTHREADED = COINIT.COINIT_APARTMENTTHREADED; | ... | @@ -901,7 +901,7 @@ pub const COINIT_APARTMENTTHREADED = COINIT.COINIT_APARTMENTTHREADED; |
| 901 | pub const COINIT_MULTITHREADED = COINIT.COINIT_MULTITHREADED; | 901 | pub const COINIT_MULTITHREADED = COINIT.COINIT_MULTITHREADED; |
| 902 | pub const COINIT_DISABLE_OLE1DDE = COINIT.COINIT_DISABLE_OLE1DDE; | 902 | pub const COINIT_DISABLE_OLE1DDE = COINIT.COINIT_DISABLE_OLE1DDE; |
| 903 | pub const COINIT_SPEED_OVER_MEMORY = COINIT.COINIT_SPEED_OVER_MEMORY; | 903 | pub const COINIT_SPEED_OVER_MEMORY = COINIT.COINIT_SPEED_OVER_MEMORY; |
| 904 | pub const COINIT = extern enum { | 904 | pub const COINIT = enum(c_int) { |
| 905 | COINIT_APARTMENTTHREADED = 2, | 905 | COINIT_APARTMENTTHREADED = 2, |
| 906 | COINIT_MULTITHREADED = 0, | 906 | COINIT_MULTITHREADED = 0, |
| 907 | COINIT_DISABLE_OLE1DDE = 4, | 907 | COINIT_DISABLE_OLE1DDE = 4, |
| ... | @@ -1623,7 +1623,7 @@ pub const SD_RECEIVE = 0; | ... | @@ -1623,7 +1623,7 @@ pub const SD_RECEIVE = 0; |
| 1623 | pub const SD_SEND = 1; | 1623 | pub const SD_SEND = 1; |
| 1624 | pub const SD_BOTH = 2; | 1624 | pub const SD_BOTH = 2; |
| 1625 | 1625 | ||
| 1626 | pub const OBJECT_INFORMATION_CLASS = extern enum { | 1626 | pub const OBJECT_INFORMATION_CLASS = enum(c_int) { |
| 1627 | ObjectBasicInformation = 0, | 1627 | ObjectBasicInformation = 0, |
| 1628 | ObjectNameInformation = 1, | 1628 | ObjectNameInformation = 1, |
| 1629 | ObjectTypeInformation = 2, | 1629 | ObjectTypeInformation = 2, |
lib/std/os/windows/ntstatus.zig+1-1| ... | @@ -4,7 +4,7 @@ | ... | @@ -4,7 +4,7 @@ |
| 4 | // The MIT license requires this copyright notice to be included in all copies | 4 | // The MIT license requires this copyright notice to be included in all copies |
| 5 | // and substantial portions of the software. | 5 | // and substantial portions of the software. |
| 6 | // NTSTATUS codes from https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-erref/596a1078-e883-4972-9bbc-49e60bebca55? | 6 | // NTSTATUS codes from https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-erref/596a1078-e883-4972-9bbc-49e60bebca55? |
| 7 | pub const NTSTATUS = extern enum(u32) { | 7 | pub const NTSTATUS = enum(u32) { |
| 8 | /// The operation completed successfully. | 8 | /// The operation completed successfully. |
| 9 | SUCCESS = 0x00000000, | 9 | SUCCESS = 0x00000000, |
| 10 | 10 |
lib/std/os/windows/win32error.zig+1-1| ... | @@ -4,7 +4,7 @@ | ... | @@ -4,7 +4,7 @@ |
| 4 | // The MIT license requires this copyright notice to be included in all copies | 4 | // The MIT license requires this copyright notice to be included in all copies |
| 5 | // and substantial portions of the software. | 5 | // and substantial portions of the software. |
| 6 | // Codes are from https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-erref/18d8fbe8-a967-4f1c-ae50-99ca8e491d2d | 6 | // Codes are from https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-erref/18d8fbe8-a967-4f1c-ae50-99ca8e491d2d |
| 7 | pub const Win32Error = extern enum(u16) { | 7 | pub const Win32Error = enum(u16) { |
| 8 | /// The operation completed successfully. | 8 | /// The operation completed successfully. |
| 9 | SUCCESS = 0, | 9 | SUCCESS = 0, |
| 10 | 10 |
lib/std/os/windows/ws2_32.zig+1-1| ... | @@ -256,7 +256,7 @@ pub const POLLHUP = 0x0002; | ... | @@ -256,7 +256,7 @@ pub const POLLHUP = 0x0002; |
| 256 | pub const POLLNVAL = 0x0004; | 256 | pub const POLLNVAL = 0x0004; |
| 257 | 257 | ||
| 258 | // https://docs.microsoft.com/en-au/windows/win32/winsock/windows-sockets-error-codes-2 | 258 | // https://docs.microsoft.com/en-au/windows/win32/winsock/windows-sockets-error-codes-2 |
| 259 | pub const WinsockError = extern enum(u16) { | 259 | pub const WinsockError = enum(u16) { |
| 260 | /// Specified event object handle is invalid. | 260 | /// Specified event object handle is invalid. |
| 261 | /// An application attempts to use an event object, but the specified handle is not valid. | 261 | /// An application attempts to use an event object, but the specified handle is not valid. |
| 262 | WSA_INVALID_HANDLE = 6, | 262 | WSA_INVALID_HANDLE = 6, |
lib/std/pdb.zig+2-2| ... | @@ -115,7 +115,7 @@ pub const StreamType = enum(u16) { | ... | @@ -115,7 +115,7 @@ pub const StreamType = enum(u16) { |
| 115 | 115 | ||
| 116 | /// Duplicate copy of SymbolRecordKind, but using the official CV names. Useful | 116 | /// Duplicate copy of SymbolRecordKind, but using the official CV names. Useful |
| 117 | /// for reference purposes and when dealing with unknown record types. | 117 | /// for reference purposes and when dealing with unknown record types. |
| 118 | pub const SymbolKind = packed enum(u16) { | 118 | pub const SymbolKind = enum(u16) { |
| 119 | S_COMPILE = 1, | 119 | S_COMPILE = 1, |
| 120 | S_REGISTER_16t = 2, | 120 | S_REGISTER_16t = 2, |
| 121 | S_CONSTANT_16t = 3, | 121 | S_CONSTANT_16t = 3, |
| ... | @@ -426,7 +426,7 @@ pub const FileChecksumEntryHeader = packed struct { | ... | @@ -426,7 +426,7 @@ pub const FileChecksumEntryHeader = packed struct { |
| 426 | ChecksumKind: u8, | 426 | ChecksumKind: u8, |
| 427 | }; | 427 | }; |
| 428 | 428 | ||
| 429 | pub const DebugSubsectionKind = packed enum(u32) { | 429 | pub const DebugSubsectionKind = enum(u32) { |
| 430 | None = 0, | 430 | None = 0, |
| 431 | Symbols = 0xf1, | 431 | Symbols = 0xf1, |
| 432 | Lines = 0xf2, | 432 | Lines = 0xf2, |
lib/std/valgrind.zig+4-4| ... | @@ -48,7 +48,7 @@ pub fn doClientRequest(default: usize, request: usize, a1: usize, a2: usize, a3: | ... | @@ -48,7 +48,7 @@ pub fn doClientRequest(default: usize, request: usize, a1: usize, a2: usize, a3: |
| 48 | } | 48 | } |
| 49 | } | 49 | } |
| 50 | 50 | ||
| 51 | pub const ClientRequest = extern enum { | 51 | pub const ClientRequest = enum(u32) { |
| 52 | RunningOnValgrind = 4097, | 52 | RunningOnValgrind = 4097, |
| 53 | DiscardTranslations = 4098, | 53 | DiscardTranslations = 4098, |
| 54 | ClientCall0 = 4353, | 54 | ClientCall0 = 4353, |
| ... | @@ -156,9 +156,9 @@ pub fn freeLikeBlock(addr: [*]u8, rzB: usize) void { | ... | @@ -156,9 +156,9 @@ pub fn freeLikeBlock(addr: [*]u8, rzB: usize) void { |
| 156 | } | 156 | } |
| 157 | 157 | ||
| 158 | /// Create a memory pool. | 158 | /// Create a memory pool. |
| 159 | pub const MempoolFlags = extern enum { | 159 | pub const MempoolFlags = struct { |
| 160 | AutoFree = 1, | 160 | pub const AutoFree = 1; |
| 161 | MetaPool = 2, | 161 | pub const MetaPool = 2; |
| 162 | }; | 162 | }; |
| 163 | pub fn createMempool(pool: [*]u8, rzB: usize, is_zeroed: bool, flags: usize) void { | 163 | pub fn createMempool(pool: [*]u8, rzB: usize, is_zeroed: bool, flags: usize) void { |
| 164 | doClientRequestStmt(.CreateMempool, @ptrToInt(pool), rzB, @boolToInt(is_zeroed), flags, 0); | 164 | doClientRequestStmt(.CreateMempool, @ptrToInt(pool), rzB, @boolToInt(is_zeroed), flags, 0); |
lib/std/valgrind/callgrind.zig+1-1| ... | @@ -6,7 +6,7 @@ | ... | @@ -6,7 +6,7 @@ |
| 6 | const std = @import("../std.zig"); | 6 | const std = @import("../std.zig"); |
| 7 | const valgrind = std.valgrind; | 7 | const valgrind = std.valgrind; |
| 8 | 8 | ||
| 9 | pub const CallgrindClientRequest = extern enum { | 9 | pub const CallgrindClientRequest = enum(usize) { |
| 10 | DumpStats = valgrind.ToolBase("CT"), | 10 | DumpStats = valgrind.ToolBase("CT"), |
| 11 | ZeroStats, | 11 | ZeroStats, |
| 12 | ToggleCollect, | 12 | ToggleCollect, |
lib/std/valgrind/memcheck.zig+2-2| ... | @@ -7,7 +7,7 @@ const std = @import("../std.zig"); | ... | @@ -7,7 +7,7 @@ const std = @import("../std.zig"); |
| 7 | const testing = std.testing; | 7 | const testing = std.testing; |
| 8 | const valgrind = std.valgrind; | 8 | const valgrind = std.valgrind; |
| 9 | 9 | ||
| 10 | pub const MemCheckClientRequest = extern enum { | 10 | pub const MemCheckClientRequest = enum(usize) { |
| 11 | MakeMemNoAccess = valgrind.ToolBase("MC".*), | 11 | MakeMemNoAccess = valgrind.ToolBase("MC".*), |
| 12 | MakeMemUndefined, | 12 | MakeMemUndefined, |
| 13 | MakeMemDefined, | 13 | MakeMemDefined, |
| ... | @@ -76,7 +76,7 @@ pub fn createBlock(qzz: []u8, desc: [*]u8) usize { | ... | @@ -76,7 +76,7 @@ pub fn createBlock(qzz: []u8, desc: [*]u8) usize { |
| 76 | 76 | ||
| 77 | /// Discard a block-description-handle. Returns 1 for an | 77 | /// Discard a block-description-handle. Returns 1 for an |
| 78 | /// invalid handle, 0 for a valid handle. | 78 | /// invalid handle, 0 for a valid handle. |
| 79 | pub fn discard(blkindex) bool { | 79 | pub fn discard(blkindex: usize) bool { |
| 80 | return doMemCheckClientRequestExpr(0, // default return | 80 | return doMemCheckClientRequestExpr(0, // default return |
| 81 | .Discard, 0, blkindex, 0, 0, 0) != 0; | 81 | .Discard, 0, blkindex, 0, 0, 0) != 0; |
| 82 | } | 82 | } |
src/AstGen.zig+3-1| ... | @@ -2658,7 +2658,9 @@ fn fnDecl( | ... | @@ -2658,7 +2658,9 @@ fn fnDecl( |
| 2658 | var i: usize = 0; | 2658 | var i: usize = 0; |
| 2659 | var it = fn_proto.iterate(tree.*); | 2659 | var it = fn_proto.iterate(tree.*); |
| 2660 | while (it.next()) |param| : (i += 1) { | 2660 | while (it.next()) |param| : (i += 1) { |
| 2661 | const name_token = param.name_token.?; | 2661 | const name_token = param.name_token orelse { |
| 2662 | return astgen.failNode(param.type_expr, "missing parameter name", .{}); | ||
| 2663 | }; | ||
| 2662 | const param_name = try astgen.identifierTokenString(name_token); | 2664 | const param_name = try astgen.identifierTokenString(name_token); |
| 2663 | const sub_scope = try astgen.arena.create(Scope.LocalVal); | 2665 | const sub_scope = try astgen.arena.create(Scope.LocalVal); |
| 2664 | sub_scope.* = .{ | 2666 | sub_scope.* = .{ |
src/Compilation.zig+1-1| ... | @@ -3220,7 +3220,7 @@ pub fn generateBuiltinZigSource(comp: *Compilation, allocator: *Allocator) Alloc | ... | @@ -3220,7 +3220,7 @@ pub fn generateBuiltinZigSource(comp: *Compilation, allocator: *Allocator) Alloc |
| 3220 | \\const std = @import("std"); | 3220 | \\const std = @import("std"); |
| 3221 | \\/// Zig version. When writing code that supports multiple versions of Zig, prefer | 3221 | \\/// Zig version. When writing code that supports multiple versions of Zig, prefer |
| 3222 | \\/// feature detection (i.e. with `@hasDecl` or `@hasField`) over version checks. | 3222 | \\/// feature detection (i.e. with `@hasDecl` or `@hasField`) over version checks. |
| 3223 | \\pub const zig_version = try std.SemanticVersion.parse("{s}"); | 3223 | \\pub const zig_version = std.SemanticVersion.parse("{s}") catch unreachable; |
| 3224 | \\/// Temporary until self-hosted is feature complete. | 3224 | \\/// Temporary until self-hosted is feature complete. |
| 3225 | \\pub const zig_is_stage2 = {}; | 3225 | \\pub const zig_is_stage2 = {}; |
| 3226 | \\/// Temporary until self-hosted supports the `cpu.arch` value. | 3226 | \\/// Temporary until self-hosted supports the `cpu.arch` value. |