authorgravatar for mail@linusgroh.deLinus Groh <mail@linusgroh.de> 2023-04-30 18:02:08+01:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-04-30 18:16:04-07:00
log94e30a756edc4c2182168dabd97d481b8aec0ff2
tree50d4273d99ddd7a442d62b615cf9dc6128e71fef
parentec6ffaa1e47388a59035277dafbe3d9999a80fca

std: fix a bunch of typos

The majority of these are in comments, some in doc comments which might affect the generated documentation, and a few in parameter names - nothing that should be breaking, however.

50 files changed, 97 insertions(+), 97 deletions(-)

lib/std/Build/Cache/DepTokenizer.zig+1-1
......@@ -829,7 +829,7 @@ test "error illegal char at position - bad target escape" {
829829 );
830830}
831831
832test "error illegal char at position - execting dollar_sign" {
832test "error illegal char at position - expecting dollar_sign" {
833833 try depTokenizer("$\t",
834834 \\ERROR: illegal char \x09 at position 1: expecting '$'
835835 );
lib/std/Build/CheckObjectStep.zig+1-1
......@@ -68,7 +68,7 @@ const SearchPhrase = struct {
6868 }
6969};
7070
71/// There two types of actions currently suported:
71/// There two types of actions currently supported:
7272/// * `.match` - is the main building block of standard matchers with optional eat-all token `{*}`
7373/// and extractors by name such as `{n_value}`. Please note this action is very simplistic in nature
7474/// i.e., it won't really handle edge cases/nontrivial examples. But given that we do want to use
lib/std/Build/RunStep.zig+1-1
......@@ -90,7 +90,7 @@ pub const StdIo = union(enum) {
9090 /// certain conditions, and the step will succeed or fail based on these
9191 /// conditions.
9292 /// Note that an explicit check for exit code 0 needs to be added to this
93 /// list if such a check is desireable.
93 /// list if such a check is desirable.
9494 check: std.ArrayList(Check),
9595 /// This RunStep is running a zig unit test binary and will communicate
9696 /// extra metadata over the IPC protocol.
lib/std/Build/Step.zig+1-1
......@@ -37,7 +37,7 @@ result_duration_ns: ?u64,
3737result_peak_rss: usize,
3838test_results: TestResults,
3939
40/// The return addresss associated with creation of this step that can be useful
40/// The return address associated with creation of this step that can be useful
4141/// to print along with debugging messages.
4242debug_stack_trace: [n_debug_stack_frames]usize,
4343
lib/std/Thread.zig+2-2
......@@ -469,8 +469,8 @@ const UnsupportedImpl = struct {
469469 return unsupported(self);
470470 }
471471
472 fn unsupported(unusued: anytype) noreturn {
473 _ = unusued;
472 fn unsupported(unused: anytype) noreturn {
473 _ = unused;
474474 @compileError("Unsupported operating system " ++ @tagName(target.os.tag));
475475 }
476476};
lib/std/Thread/Condition.zig+1-1
......@@ -261,7 +261,7 @@ const FutexImpl = struct {
261261 const signals = (state & signal_mask) / one_signal;
262262
263263 // Reserves which waiters to wake up by incrementing the signals count.
264 // Therefor, the signals count is always less than or equal to the waiters count.
264 // Therefore, the signals count is always less than or equal to the waiters count.
265265 // We don't need to Futex.wake if there's nothing to wake up or if other wake() threads have reserved to wake up the current waiters.
266266 const wakeable = waiters - signals;
267267 if (wakeable == 0) {
lib/std/Thread/Futex.zig+1-1
......@@ -772,7 +772,7 @@ const PosixImpl = struct {
772772
773773 waiter.event.wait(timeout) catch {
774774 // If we fail to cancel after a timeout, it means a wake() thread dequeued us and will wake us up.
775 // We must wait until the event is set as that's a signal that the wake() thread wont access the waiter memory anymore.
775 // We must wait until the event is set as that's a signal that the wake() thread won't access the waiter memory anymore.
776776 // If we return early without waiting, the waiter on the stack would be invalidated and the wake() thread risks a UAF.
777777 defer if (!cancelled) waiter.event.wait(null) catch unreachable;
778778
lib/std/atomic/Atomic.zig+1-1
......@@ -31,7 +31,7 @@ pub fn Atomic(comptime T: type) type {
3131 /// // Release ensures code before unref() happens-before the count is decremented as dropFn could be called by then.
3232 /// if (self.count.fetchSub(1, .Release)) {
3333 /// // Acquire ensures count decrement and code before previous unrefs()s happens-before we call dropFn below.
34 /// // NOTE: another alterative is to use .AcqRel on the fetchSub count decrement but it's extra barrier in possibly hot path.
34 /// // NOTE: another alternative is to use .AcqRel on the fetchSub count decrement but it's extra barrier in possibly hot path.
3535 /// self.count.fence(.Acquire);
3636 /// (self.dropFn)(self);
3737 /// }
lib/std/builtin.zig+1-1
......@@ -749,7 +749,7 @@ pub const PrefetchOptions = struct {
749749 /// 3 means high temporal locality. That is, the data should be kept in
750750 /// the cache as it is likely to be accessed again soon.
751751 locality: u2 = 3,
752 /// The cache that the prefetch should be preformed on.
752 /// The cache that the prefetch should be performed on.
753753 cache: Cache = .data,
754754
755755 pub const Rw = enum(u1) {
lib/std/c/darwin.zig+4-4
......@@ -178,13 +178,13 @@ pub extern "c" fn __getdirentries64(fd: c_int, buf_ptr: [*]u8, buf_len: usize, b
178178
179179const private = struct {
180180 extern "c" fn fstat(fd: fd_t, buf: *Stat) c_int;
181 /// On x86_64 Darwin, fstat has to be manully linked with $INODE64 suffix to
181 /// On x86_64 Darwin, fstat has to be manually linked with $INODE64 suffix to
182182 /// force 64bit version.
183183 /// Note that this is fixed on aarch64 and no longer necessary.
184184 extern "c" fn @"fstat$INODE64"(fd: fd_t, buf: *Stat) c_int;
185185
186186 extern "c" fn fstatat(dirfd: fd_t, path: [*:0]const u8, stat_buf: *Stat, flags: u32) c_int;
187 /// On x86_64 Darwin, fstatat has to be manully linked with $INODE64 suffix to
187 /// On x86_64 Darwin, fstatat has to be manually linked with $INODE64 suffix to
188188 /// force 64bit version.
189189 /// Note that this is fixed on aarch64 and no longer necessary.
190190 extern "c" fn @"fstatat$INODE64"(dirfd: fd_t, path_name: [*:0]const u8, buf: *Stat, flags: u32) c_int;
......@@ -2643,7 +2643,7 @@ pub const F = struct {
26432643 pub const ADDSIGS = 59;
26442644 /// add signature from same file (used by dyld for shared libs)
26452645 pub const ADDFILESIGS = 61;
2646 /// used in conjunction with F.NOCACHE to indicate that DIRECT, synchonous writes
2646 /// used in conjunction with F.NOCACHE to indicate that DIRECT, synchronous writes
26472647 /// should not be used (i.e. its ok to temporaily create cached pages)
26482648 pub const NODIRECT = 62;
26492649 ///Get the protection class of a file from the EA, returns int
......@@ -3866,4 +3866,4 @@ pub const MIN = struct {
38663866 pub const ANONYMOUS = 0x80;
38673867};
38683868
3869pub extern "c" fn mincore(addr: *align(std.mem.page_size) const anyopaque, lengh: usize, vec: [*]u8) c_int;
3869pub extern "c" fn mincore(addr: *align(std.mem.page_size) const anyopaque, length: usize, vec: [*]u8) c_int;
lib/std/c/solaris.zig+1-1
......@@ -1822,7 +1822,7 @@ pub const file_obj = extern struct {
18221822 name: [*:0]u8,
18231823};
18241824
1825// struct ifreq is marked obsolete, with struct lifreq prefered for interface requests.
1825// struct ifreq is marked obsolete, with struct lifreq preferred for interface requests.
18261826// Here we alias lifreq to ifreq to avoid chainging existing code in os and x.os.IPv6.
18271827pub const SIOCGLIFINDEX = IOWR('i', 133, lifreq);
18281828pub const SIOCGIFINDEX = SIOCGLIFINDEX;
lib/std/child_process.zig+1-1
......@@ -1174,7 +1174,7 @@ fn windowsCreateProcess(app_name: [*:0]u16, cmd_line: [*:0]u16, envp_ptr: ?[*]u1
11741174 );
11751175}
11761176
1177/// Case-insenstive UTF-16 lookup
1177/// Case-insensitive UTF-16 lookup
11781178fn windowsCreateProcessSupportsExtension(ext: []const u16) bool {
11791179 if (ext.len != 4) return false;
11801180 const State = enum {
lib/std/compress/deflate/huffman_code.zig+1-1
......@@ -421,7 +421,7 @@ test "generate a Huffman code from an array of frequencies" {
421421 try testing.expectEqual(@as(u16, 0x3f), enc.codes[16].code);
422422}
423423
424test "generate a Huffman code for the fixed litteral table specific to Deflate" {
424test "generate a Huffman code for the fixed literal table specific to Deflate" {
425425 var enc = try generateFixedLiteralEncoding(testing.allocator);
426426 defer enc.deinit();
427427}
lib/std/crypto/25519/edwards25519.zig+2-2
......@@ -137,7 +137,7 @@ pub const Edwards25519 = struct {
137137 };
138138 }
139139
140 /// Substract two Edwards25519 points.
140 /// Subtract two Edwards25519 points.
141141 pub fn sub(p: Edwards25519, q: Edwards25519) Edwards25519 {
142142 return p.add(q.neg());
143143 }
......@@ -529,7 +529,7 @@ test "edwards25519 packing/unpacking" {
529529 }
530530}
531531
532test "edwards25519 point addition/substraction" {
532test "edwards25519 point addition/subtraction" {
533533 var s1: [32]u8 = undefined;
534534 var s2: [32]u8 = undefined;
535535 crypto.random.bytes(&s1);
lib/std/crypto/25519/field.zig+1-1
......@@ -179,7 +179,7 @@ pub const Fe = struct {
179179 return fe;
180180 }
181181
182 /// Substract a field element
182 /// Subtract a field element
183183 pub inline fn sub(a: Fe, b: Fe) Fe {
184184 var fe = b;
185185 comptime var i = 0;
lib/std/crypto/Certificate.zig+2-2
......@@ -1134,9 +1134,9 @@ pub const rsa = struct {
11341134 return res;
11351135 }
11361136
1137 fn setBytes(r: *BigInt, bytes: []const u8, allcator: std.mem.Allocator) !void {
1137 fn setBytes(r: *BigInt, bytes: []const u8, allocator: std.mem.Allocator) !void {
11381138 try r.set(0);
1139 var tmp = try BigInt.init(allcator);
1139 var tmp = try BigInt.init(allocator);
11401140 defer tmp.deinit();
11411141 for (bytes) |b| {
11421142 try r.shiftLeft(r, 8);
lib/std/crypto/errors.zig+1-1
......@@ -10,7 +10,7 @@ pub const IdentityElementError = error{IdentityElement};
1010/// Encoded input cannot be decoded
1111pub const EncodingError = error{InvalidEncoding};
1212
13/// The signature does't verify for the given message and public key
13/// The signature doesn't verify for the given message and public key
1414pub const SignatureVerificationError = error{SignatureVerificationFailed};
1515
1616/// Both a public and secret key have been provided, but they are incompatible
lib/std/crypto/kyber_d00.zig+2-2
......@@ -80,7 +80,7 @@
8080//! m = Compress(Decompress(c_2, d_v) - s^T Decompress(c_1, d_u), 1).
8181//!
8282//! It it not straight-forward to see that this formula is correct. In
83//! fact, there is negligable but non-zero probability that a ciphertext
83//! fact, there is negligible but non-zero probability that a ciphertext
8484//! does not decrypt correctly given by the DFP column in Table 4. This
8585//! failure probability can be computed by a careful automated analysis
8686//! of the probabilities involved, see kyber_failure.py of [SecEst].
......@@ -640,7 +640,7 @@ fn montReduce(x: i32) i16 {
640640 // we have int32(int64(a)*int64(b)) = int32(a*b) and so the result is ok.
641641 const m = @truncate(i16, @truncate(i32, x *% qInv));
642642
643 // Note that x - m q is divisable by R; indeed modulo R we have
643 // Note that x - m q is divisible by R; indeed modulo R we have
644644 //
645645 // x - m q ≡ x - x q' q ≡ x - x q⁻¹ q ≡ x - x = 0.
646646 //
lib/std/event/lock.zig+2-2
......@@ -36,7 +36,7 @@ pub const Lock = struct {
3636
3737 // self.head transitions from multiple stages depending on the value:
3838 // UNLOCKED -> LOCKED:
39 // acquire Lock ownership when theres no waiters
39 // acquire Lock ownership when there are no waiters
4040 // LOCKED -> <Waiter head ptr>:
4141 // Lock is already owned, enqueue first Waiter
4242 // <head ptr> -> <head ptr>:
......@@ -87,7 +87,7 @@ pub const Lock = struct {
8787
8888 // self.head goes through the reverse transition from acquire():
8989 // <head ptr> -> <new head ptr>:
90 // pop a waiter from the queue to give Lock ownership when theres still others pending
90 // pop a waiter from the queue to give Lock ownership when there are still others pending
9191 // <head ptr> -> LOCKED:
9292 // pop the laster waiter from the queue, while also giving it lock ownership when awaken
9393 // LOCKED -> UNLOCKED:
lib/std/event/loop.zig+3-3
......@@ -903,7 +903,7 @@ pub const Loop = struct {
903903 }
904904 }
905905
906 // TODO: use a tickless heirarchical timer wheel:
906 // TODO: use a tickless hierarchical timer wheel:
907907 // https://github.com/wahern/timeout/
908908 const Waiters = struct {
909909 entries: std.atomic.Queue(anyframe),
......@@ -947,7 +947,7 @@ pub const Loop = struct {
947947 // starting from the head
948948 var head = self.entries.head orelse return null;
949949
950 // traverse the list of waiting entires to
950 // traverse the list of waiting entries to
951951 // find the Node with the smallest `expires` field
952952 var min = head;
953953 while (head.next) |node| {
......@@ -1756,7 +1756,7 @@ test "std.event.Loop - runDetached" {
17561756 try loop.runDetached(std.testing.allocator, testRunDetached, .{});
17571757
17581758 // Now we can start the event loop. The function will return only
1759 // after all tasks have been completed, allowing us to synchonize
1759 // after all tasks have been completed, allowing us to synchronize
17601760 // with the previous runDetached.
17611761 loop.run();
17621762
lib/std/fmt/parse_float/convert_fast.zig+1-1
......@@ -1,4 +1,4 @@
1//! Representation of a float as the signficant digits and exponent.
1//! Representation of a float as the significant digits and exponent.
22//! The fast path algorithm using machine-sized integers and floats.
33//!
44//! This only works if both the mantissa and the exponent can be exactly
lib/std/fs/file.zig+2-2
......@@ -92,7 +92,7 @@ pub const File = struct {
9292 /// processes from acquiring a exclusive lock, but does not prevent
9393 /// other process from getting their own shared locks.
9494 ///
95 /// The lock is advisory, except on Linux in very specific cirsumstances[1].
95 /// The lock is advisory, except on Linux in very specific circumstances[1].
9696 /// This means that a process that does not respect the locking API can still get access
9797 /// to the file, despite the lock.
9898 ///
......@@ -156,7 +156,7 @@ pub const File = struct {
156156 /// processes from acquiring a exclusive lock, but does not prevent
157157 /// other process from getting their own shared locks.
158158 ///
159 /// The lock is advisory, except on Linux in very specific cirsumstances[1].
159 /// The lock is advisory, except on Linux in very specific circumstances[1].
160160 /// This means that a process that does not respect the locking API can still get access
161161 /// to the file, despite the lock.
162162 ///
lib/std/fs/path.zig+2-2
......@@ -105,13 +105,13 @@ fn joinSepMaybeZ(allocator: Allocator, separator: u8, comptime sepPredicate: fn
105105 return buf;
106106}
107107
108/// Naively combines a series of paths with the native path seperator.
108/// Naively combines a series of paths with the native path separator.
109109/// Allocates memory for the result, which must be freed by the caller.
110110pub fn join(allocator: Allocator, paths: []const []const u8) ![]u8 {
111111 return joinSepMaybeZ(allocator, sep, isSep, paths, false);
112112}
113113
114/// Naively combines a series of paths with the native path seperator and null terminator.
114/// Naively combines a series of paths with the native path separator and null terminator.
115115/// Allocates memory for the result, which must be freed by the caller.
116116pub fn joinZ(allocator: Allocator, paths: []const []const u8) ![:0]u8 {
117117 const out = try joinSepMaybeZ(allocator, sep, isSep, paths, true);
lib/std/hash_map.zig+1-1
......@@ -690,7 +690,7 @@ pub fn HashMap(
690690/// It achieves good performance with quite high load factors (by default,
691691/// grow is triggered at 80% full) and only one byte of overhead per element.
692692/// The struct itself is only 16 bytes for a small footprint. This comes at
693/// the price of handling size with u32, which should be reasonnable enough
693/// the price of handling size with u32, which should be reasonable enough
694694/// for almost all uses.
695695/// Deletions are achieved with tombstones.
696696pub fn HashMapUnmanaged(
lib/std/heap.zig+1-1
......@@ -79,7 +79,7 @@ const CAllocator = struct {
7979 }
8080
8181 // Thin wrapper around regular malloc, overallocate to account for
82 // alignment padding and store the orignal malloc()'ed pointer before
82 // alignment padding and store the original malloc()'ed pointer before
8383 // the aligned address.
8484 var unaligned_ptr = @ptrCast([*]u8, c.malloc(len + alignment - 1 + @sizeOf(usize)) orelse return null);
8585 const unaligned_addr = @ptrToInt(unaligned_ptr);
lib/std/heap/arena_allocator.zig+1-1
......@@ -136,7 +136,7 @@ pub const ArenaAllocator = struct {
136136 it = next_it;
137137 } else null;
138138 std.debug.assert(maybe_first_node == null or maybe_first_node.?.next == null);
139 // reset the state before we try resizing the buffers, so we definitly have reset the arena to 0.
139 // reset the state before we try resizing the buffers, so we definitely have reset the arena to 0.
140140 self.state.end_index = 0;
141141 if (maybe_first_node) |first_node| {
142142 // perfect, no need to invoke the child_allocator
lib/std/heap/general_purpose_allocator.zig+2-2
......@@ -130,7 +130,7 @@ pub const Config = struct {
130130 thread_safe: bool = !builtin.single_threaded,
131131
132132 /// What type of mutex you'd like to use, for thread safety.
133 /// when specfied, the mutex type must have the same shape as `std.Thread.Mutex` and
133 /// when specified, the mutex type must have the same shape as `std.Thread.Mutex` and
134134 /// `DummyMutex`, and have no required fields. Specifying this field causes
135135 /// the `thread_safe` field to be ignored.
136136 ///
......@@ -1241,7 +1241,7 @@ test "realloc large object to small object" {
12411241 try std.testing.expect(slice[16] == 0x34);
12421242}
12431243
1244test "overrideable mutexes" {
1244test "overridable mutexes" {
12451245 var gpa = GeneralPurposeAllocator(.{ .MutexType = std.Thread.Mutex }){
12461246 .backing_allocator = std.testing.allocator,
12471247 .mutex = std.Thread.Mutex{},
lib/std/heap/memory_pool.zig+1-1
......@@ -150,7 +150,7 @@ test "memory pool: basic" {
150150 pool.destroy(p2);
151151 const p4 = try pool.create();
152152
153 // Assert memory resuse
153 // Assert memory reuse
154154 try std.testing.expect(p2 == p4);
155155}
156156
lib/std/http.zig+1-1
......@@ -12,7 +12,7 @@ pub const Version = enum {
1212};
1313
1414/// https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods
15/// https://datatracker.ietf.org/doc/html/rfc7231#section-4 Initial definiton
15/// https://datatracker.ietf.org/doc/html/rfc7231#section-4 Initial definition
1616/// https://datatracker.ietf.org/doc/html/rfc5789#section-2 PATCH
1717pub const Method = enum {
1818 GET,
lib/std/json.zig+1-1
......@@ -1603,7 +1603,7 @@ fn parseInternal(
16031603 if (fields_seen[i]) {
16041604 switch (options.duplicate_field_behavior) {
16051605 .UseFirst => {
1606 // unconditonally ignore value. for comptime fields, this skips check against default_value
1606 // unconditionally ignore value. for comptime fields, this skips check against default_value
16071607 parseFree(field.type, try parse(field.type, tokens, child_options), child_options);
16081608 found = true;
16091609 break;
lib/std/linked_list.zig+1-1
......@@ -406,7 +406,7 @@ test "TailQueue concatenation" {
406406 }
407407 }
408408
409 // Swap them back, this verifies that concating to an empty list works.
409 // Swap them back, this verifies that concatenating to an empty list works.
410410 list2.concatByMoving(&list1);
411411
412412 // Traverse forwards.
lib/std/macho.zig+6-6
......@@ -356,7 +356,7 @@ pub const dysymtab_command = extern struct {
356356
357357 // All the local relocation entries are grouped together (they are not
358358 // grouped by their module since they are only used if the object is moved
359 // from it staticly link edited address).
359 // from its statically link edited address).
360360
361361 /// offset to local relocation entries
362362 locreloff: u32 = 0,
......@@ -418,7 +418,7 @@ pub const dyld_info_command = extern struct {
418418 // <seg-index, seg-offset, type, symbol-library-ordinal, symbol-name, addend>
419419 // The opcodes are a compressed way to encode the table by only
420420 // encoding when a column changes. In addition simple patterns
421 // like for runs of pointers initialzed to the same value can be
421 // like for runs of pointers initialized to the same value can be
422422 // encoded in a few bytes.
423423
424424 /// file offset to binding info
......@@ -1141,7 +1141,7 @@ pub const MH_NOUNDEFS = 0x1;
11411141/// the object file is the output of an incremental link against a base file and can't be link edited again
11421142pub const MH_INCRLINK = 0x2;
11431143
1144/// the object file is input for the dynamic linker and can't be staticly link edited again
1144/// the object file is input for the dynamic linker and can't be statically link edited again
11451145pub const MH_DYLDLINK = 0x4;
11461146
11471147/// the object file's undefined references are bound by the dynamic linker when loaded.
......@@ -1162,7 +1162,7 @@ pub const MH_TWOLEVEL = 0x80;
11621162/// the executable is forcing all images to use flat name space bindings
11631163pub const MH_FORCE_FLAT = 0x100;
11641164
1165/// this umbrella guarantees no multiple defintions of symbols in its sub-images so the two-level namespace hints can always be used.
1165/// this umbrella guarantees no multiple definitions of symbols in its sub-images so the two-level namespace hints can always be used.
11661166pub const MH_NOMULTIDEFS = 0x200;
11671167
11681168/// do not have dyld notify the prebinding agent about this executable
......@@ -1658,7 +1658,7 @@ pub const EXPORT_SYMBOL_FLAGS_REEXPORT: u8 = 0x08;
16581658pub const EXPORT_SYMBOL_FLAGS_STUB_AND_RESOLVER: u8 = 0x10;
16591659
16601660// An indirect symbol table entry is simply a 32bit index into the symbol table
1661// to the symbol that the pointer or stub is refering to. Unless it is for a
1661// to the symbol that the pointer or stub is referring to. Unless it is for a
16621662// non-lazy symbol pointer section for a defined symbol which strip(1) as
16631663// removed. In which case it has the value INDIRECT_SYMBOL_LOCAL. If the
16641664// symbol was also absolute INDIRECT_SYMBOL_ABS is or'ed with that.
......@@ -1741,7 +1741,7 @@ pub const CS_LINKER_SIGNED: u32 = 0x20000;
17411741
17421742pub const CS_EXECSEG_MAIN_BINARY: u32 = 0x1;
17431743
1744/// This CodeDirectory is tailored specfically at version 0x20400.
1744/// This CodeDirectory is tailored specifically at version 0x20400.
17451745pub const CodeDirectory = extern struct {
17461746 /// Magic number (CSMAGIC_CODEDIRECTORY)
17471747 magic: u32,
lib/std/math/big/int.zig+10-10
......@@ -408,7 +408,7 @@ pub const Mutable = struct {
408408 }
409409
410410 /// Base implementation for addition. Adds `max(a.limbs.len, b.limbs.len)` elements from a and b,
411 /// and returns whether any overflow occured.
411 /// and returns whether any overflow occurred.
412412 /// r, a and b may be aliases.
413413 ///
414414 /// Asserts r has enough elements to hold the result. The upper bound is `max(a.limbs.len, b.limbs.len)`.
......@@ -467,7 +467,7 @@ pub const Mutable = struct {
467467 const req_limbs = calcTwosCompLimbCount(bit_count);
468468
469469 // Slice of the upper bits if they exist, these will be ignored and allows us to use addCarry to determine
470 // if an overflow occured.
470 // if an overflow occurred.
471471 const x = Const{
472472 .positive = a.positive,
473473 .limbs = a.limbs[0..math.min(req_limbs, a.limbs.len)],
......@@ -512,7 +512,7 @@ pub const Mutable = struct {
512512 const req_limbs = calcTwosCompLimbCount(bit_count);
513513
514514 // Slice of the upper bits if they exist, these will be ignored and allows us to use addCarry to determine
515 // if an overflow occured.
515 // if an overflow occurred.
516516 const x = Const{
517517 .positive = a.positive,
518518 .limbs = a.limbs[0..math.min(req_limbs, a.limbs.len)],
......@@ -544,7 +544,7 @@ pub const Mutable = struct {
544544 }
545545
546546 /// Base implementation for subtraction. Subtracts `max(a.limbs.len, b.limbs.len)` elements from a and b,
547 /// and returns whether any overflow occured.
547 /// and returns whether any overflow occurred.
548548 /// r, a and b may be aliases.
549549 ///
550550 /// Asserts r has enough elements to hold the result. The upper bound is `max(a.limbs.len, b.limbs.len)`.
......@@ -605,7 +605,7 @@ pub const Mutable = struct {
605605 r.add(a, b.negate());
606606 }
607607
608 /// r = a - b with 2s-complement wrapping semantics. Returns whether any overflow occured.
608 /// r = a - b with 2s-complement wrapping semantics. Returns whether any overflow occurred.
609609 ///
610610 /// r, a and b may be aliases
611611 /// Asserts the result fits in `r`. An upper bound on the number of limbs needed by
......@@ -1141,7 +1141,7 @@ pub const Mutable = struct {
11411141 return;
11421142 }
11431143
1144 // Generate a mask with the bits to check in the most signficant limb. We'll need to check
1144 // Generate a mask with the bits to check in the most significant limb. We'll need to check
11451145 // all bits with equal or more significance than checkbit.
11461146 // const msb = @truncate(Log2Limb, checkbit);
11471147 // const checkmask = (@as(Limb, 1) << msb) -% 1;
......@@ -2037,7 +2037,7 @@ pub const Const = struct {
20372037 add_res = ov[0];
20382038 carry = ov[1];
20392039 sum += @popCount(add_res);
2040 remaining_bits -= limb_bits; // Asserted not to undeflow by fitsInTwosComp
2040 remaining_bits -= limb_bits; // Asserted not to underflow by fitsInTwosComp
20412041 }
20422042
20432043 // The most significant limb may have fewer than @bitSizeOf(Limb) meaningful bits,
......@@ -2813,7 +2813,7 @@ pub const Managed = struct {
28132813 r.setMetadata(m.positive, m.len);
28142814 }
28152815
2816 /// r = a + b with 2s-complement wrapping semantics. Returns whether any overflow occured.
2816 /// r = a + b with 2s-complement wrapping semantics. Returns whether any overflow occurred.
28172817 ///
28182818 /// r, a and b may be aliases.
28192819 ///
......@@ -2856,7 +2856,7 @@ pub const Managed = struct {
28562856 r.setMetadata(m.positive, m.len);
28572857 }
28582858
2859 /// r = a - b with 2s-complement wrapping semantics. Returns whether any overflow occured.
2859 /// r = a - b with 2s-complement wrapping semantics. Returns whether any overflow occurred.
28602860 ///
28612861 /// r, a and b may be aliases.
28622862 ///
......@@ -4010,7 +4010,7 @@ fn llsquareBasecase(r: []Limb, x: []const Limb) void {
40104010 assert(r.len >= 2 * x_norm.len + 1);
40114011
40124012 // Compute the square of a N-limb bigint with only (N^2 + N)/2
4013 // multiplications by exploting the symmetry of the coefficients around the
4013 // multiplications by exploiting the symmetry of the coefficients around the
40144014 // diagonal:
40154015 //
40164016 // a b c *
lib/std/math/complex/tan.zig+1-1
......@@ -4,7 +4,7 @@ const math = std.math;
44const cmath = math.complex;
55const Complex = cmath.Complex;
66
7/// Returns the tanget of z.
7/// Returns the tangent of z.
88pub fn tan(z: anytype) Complex(@TypeOf(z.re)) {
99 const T = @TypeOf(z.re);
1010 const q = Complex(T).init(-z.im, z.re);
lib/std/math/log10.zig+1-1
......@@ -58,7 +58,7 @@ pub fn log10_int(x: anytype) Log2Int(@TypeOf(x)) {
5858 var log: u32 = 0;
5959
6060 inline for (0..11) |i| {
61 // Unnecesary branches should be removed by the compiler
61 // Unnecessary branches should be removed by the compiler
6262 if (bit_size > (1 << (11 - i)) * 5 * @log2(10.0) and val >= pow10((1 << (11 - i)) * 5)) {
6363 const num_digits = (1 << (11 - i)) * 5;
6464 val /= pow10(num_digits);
lib/std/math/sqrt.zig+1-1
......@@ -11,7 +11,7 @@ const maxInt = std.math.maxInt;
1111/// - sqrt(+-0) = +-0
1212/// - sqrt(x) = nan if x < 0
1313/// - sqrt(nan) = nan
14/// TODO Decide if all this logic should be implemented directly in the @sqrt bultin function.
14/// TODO Decide if all this logic should be implemented directly in the @sqrt builtin function.
1515pub fn sqrt(x: anytype) Sqrt(@TypeOf(x)) {
1616 const T = @TypeOf(x);
1717 switch (@typeInfo(T)) {
lib/std/mem.zig+5-5
......@@ -114,7 +114,7 @@ pub fn validationWrap(allocator: anytype) ValidationAllocator(@TypeOf(allocator)
114114
115115/// An allocator helper function. Adjusts an allocation length satisfy `len_align`.
116116/// `full_len` should be the full capacity of the allocation which may be greater
117/// than the `len` that was requsted. This function should only be used by allocators
117/// than the `len` that was requested. This function should only be used by allocators
118118/// that are unaffected by `len_align`.
119119pub fn alignAllocLen(full_len: usize, alloc_len: usize, len_align: u29) usize {
120120 assert(alloc_len > 0);
......@@ -427,7 +427,7 @@ pub fn zeroInit(comptime T: type, init: anytype) T {
427427 .Struct => |init_info| {
428428 if (init_info.is_tuple) {
429429 if (init_info.fields.len > struct_info.fields.len) {
430 @compileError("Tuple initializer has more elments than there are fields in `" ++ @typeName(T) ++ "`");
430 @compileError("Tuple initializer has more elements than there are fields in `" ++ @typeName(T) ++ "`");
431431 }
432432 } else {
433433 inline for (init_info.fields) |field| {
......@@ -668,7 +668,7 @@ test "Span" {
668668
669669/// Takes a sentinel-terminated pointer and returns a slice, iterating over the
670670/// memory to find the sentinel and determine the length.
671/// Ponter attributes such as const are preserved.
671/// Pointer attributes such as const are preserved.
672672/// `[*c]` pointers are assumed to be non-null and 0-terminated.
673673pub fn span(ptr: anytype) Span(@TypeOf(ptr)) {
674674 if (@typeInfo(@TypeOf(ptr)) == .Optional) {
......@@ -1835,7 +1835,7 @@ test "writeIntBig and writeIntLittle" {
18351835}
18361836
18371837/// Swap the byte order of all the members of the fields of a struct
1838/// (Changing their endianess)
1838/// (Changing their endianness)
18391839pub fn byteSwapAllFields(comptime S: type, ptr: *S) void {
18401840 if (@typeInfo(S) != .Struct) @compileError("byteSwapAllFields expects a struct as the first argument");
18411841 inline for (std.meta.fields(S)) |f| {
......@@ -3168,7 +3168,7 @@ test "replace" {
31683168 try testing.expectEqualStrings(expected, output[0..expected.len]);
31693169}
31703170
3171/// Replace all occurences of `needle` with `replacement`.
3171/// Replace all occurrences of `needle` with `replacement`.
31723172pub fn replaceScalar(comptime T: type, slice: []T, needle: T, replacement: T) void {
31733173 for (slice, 0..) |e, i| {
31743174 if (e == needle) {
lib/std/os.zig+3-3
......@@ -659,7 +659,7 @@ pub fn exit(status: u8) noreturn {
659659 linux.exit_group(status);
660660 }
661661 if (builtin.os.tag == .uefi) {
662 // exit() is only avaliable if exitBootServices() has not been called yet.
662 // exit() is only available if exitBootServices() has not been called yet.
663663 // This call to exit should not fail, so we don't care about its return value.
664664 if (uefi.system_table.boot_services) |bs| {
665665 _ = bs.exit(uefi.handle, @intToEnum(uefi.Status, status), 0, null);
......@@ -2978,7 +2978,7 @@ pub fn chdirZ(dir_path: [*:0]const u8) ChangeCurDirError!void {
29782978 }
29792979}
29802980
2981/// Windows-only. Same as `chdir` except the paramter is WTF16 encoded.
2981/// Windows-only. Same as `chdir` except the parameter is WTF16 encoded.
29822982pub fn chdirW(dir_path: []const u16) ChangeCurDirError!void {
29832983 windows.SetCurrentDirectory(dir_path) catch |err| switch (err) {
29842984 error.NoDevice => return error.FileSystem,
......@@ -6925,7 +6925,7 @@ pub const PrctlError = error{
69256925 /// Can only occur with PR_SET_SPECULATION_CTRL, PR_MPX_ENABLE_MANAGEMENT,
69266926 /// or PR_MPX_DISABLE_MANAGEMENT
69276927 UnsupportedFeature,
6928 /// Can only occur wih PR_SET_FP_MODE
6928 /// Can only occur with PR_SET_FP_MODE
69296929 OperationNotSupported,
69306930 PermissionDenied,
69316931} || UnexpectedError;
lib/std/os/linux.zig+3-3
......@@ -472,7 +472,7 @@ pub fn preadv(fd: i32, iov: [*]const iovec, count: usize, offset: i64) usize {
472472 @bitCast(usize, @as(isize, fd)),
473473 @ptrToInt(iov),
474474 count,
475 // Kernel expects the offset is splitted into largest natural word-size.
475 // Kernel expects the offset is split into largest natural word-size.
476476 // See following link for detail:
477477 // https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=601cc11d054ae4b5e9b5babec3d8e4667a2cb9b5
478478 @truncate(usize, offset_u),
......@@ -3912,7 +3912,7 @@ pub const io_uring_cqe = extern struct {
39123912/// If set, the upper 16 bits are the buffer ID
39133913pub const IORING_CQE_F_BUFFER = 1 << 0;
39143914/// If set, parent SQE will generate more CQE entries.
3915/// Avaiable since Linux 5.13.
3915/// Available since Linux 5.13.
39163916pub const IORING_CQE_F_MORE = 1 << 1;
39173917/// If set, more data to read after socket recv
39183918pub const IORING_CQE_F_SOCK_NONEMPTY = 1 << 2;
......@@ -4234,7 +4234,7 @@ pub const tcp_fastopen_client_fail = enum {
42344234pub const TCPI_OPT_TIMESTAMPS = 1;
42354235pub const TCPI_OPT_SACK = 2;
42364236pub const TCPI_OPT_WSCALE = 4;
4237/// ECN was negociated at TCP session init
4237/// ECN was negotiated at TCP session init
42384238pub const TCPI_OPT_ECN = 8;
42394239/// we received at least one packet with ECT
42404240pub const TCPI_OPT_ECN_SEEN = 16;
lib/std/os/linux/bpf/btf.zig+3-3
......@@ -109,7 +109,7 @@ pub const Enum64 = extern struct {
109109 val_hi32: i32,
110110};
111111
112/// array kind is followd by this struct
112/// array kind is followed by this struct
113113pub const Array = extern struct {
114114 typ: u32,
115115 index_type: u32,
......@@ -149,13 +149,13 @@ pub const FuncLinkage = enum {
149149 external,
150150};
151151
152/// var kind is followd by a single Var struct to describe additional
152/// var kind is followed by a single Var struct to describe additional
153153/// information related to the variable such as its linkage
154154pub const Var = extern struct {
155155 linkage: u32,
156156};
157157
158/// datasec kind is followed by multible VarSecInfo to describe all Var kind
158/// datasec kind is followed by multiple VarSecInfo to describe all Var kind
159159/// types it contains along with it's in-section offset as well as size.
160160pub const VarSecInfo = extern struct {
161161 typ: u32,
lib/std/os/linux/seccomp.zig+1-1
......@@ -65,7 +65,7 @@
6565//!
6666//! Unfortunately, there is no easy solution for issue 5. The most reliable
6767//! strategy is to keep testing; test newer Zig versions, different libcs,
68//! different distros, and design your filter to accomidate all of them.
68//! different distros, and design your filter to accommodate all of them.
6969//! Alternatively, you could inject a filter at runtime. Since filters are
7070//! preserved across execve(2), a filter could be setup before executing your
7171//! program, without your program having any knowledge of this happening. This
lib/std/os/windows.zig+1-1
......@@ -2114,7 +2114,7 @@ pub fn loadWinsockExtensionFunction(comptime T: type, sock: ws2_32.SOCKET, guid:
21142114/// and you get an unexpected error.
21152115pub fn unexpectedError(err: Win32Error) std.os.UnexpectedError {
21162116 if (std.os.unexpected_error_tracing) {
2117 // 614 is the length of the longest windows error desciption
2117 // 614 is the length of the longest windows error description
21182118 var buf_wstr: [614]WCHAR = undefined;
21192119 var buf_utf8: [614]u8 = undefined;
21202120 const len = kernel32.FormatMessageW(
lib/std/packed_int_array.zig+2-2
......@@ -33,7 +33,7 @@ pub fn PackedIntIo(comptime Int: type, comptime endian: Endian) type {
3333 // In the worst case, this is the number of bytes we need to touch
3434 // to read or write a value, as bits. To calculate for int_bits > 1,
3535 // set aside 2 bits to touch the first and last bytes, then divide
36 // by 8 to see how many bytes can be filled up inbetween.
36 // by 8 to see how many bytes can be filled up in between.
3737 const max_io_bits = switch (int_bits) {
3838 0 => 0,
3939 1 => 8,
......@@ -298,7 +298,7 @@ pub fn PackedIntSliceEndian(comptime Int: type, comptime endian: Endian) type {
298298 }
299299
300300 /// Initialize a packed slice using the memory at `bytes`, with `int_count`
301 /// elements. `bytes` must be large enough to accomodate the requested
301 /// elements. `bytes` must be large enough to accommodate the requested
302302 /// count.
303303 pub fn init(bytes: []u8, int_count: usize) Self {
304304 debug.assert(bytes.len >= bytesRequired(int_count));
lib/std/pdb.zig+1-1
......@@ -912,7 +912,7 @@ const Msf = struct {
912912 const stream_sizes = try allocator.alloc(u32, stream_count);
913913 defer allocator.free(stream_sizes);
914914
915 // Microsoft's implementation uses @as(u32, -1) for inexistant streams.
915 // Microsoft's implementation uses @as(u32, -1) for inexistent streams.
916916 // These streams are not used, but still participate in the file
917917 // and must be taken into account when resolving stream indices.
918918 const Nil = 0xFFFFFFFF;
lib/std/simd.zig+1-1
......@@ -159,7 +159,7 @@ pub fn interlace(vecs: anytype) @Vector(vectorLength(@TypeOf(vecs[0])) * vecs.le
159159}
160160
161161/// The contents of `interlaced` is evenly split between vec_count vectors that are returned as an array. They "take turns",
162/// recieving one element from `interlaced` at a time.
162/// receiving one element from `interlaced` at a time.
163163pub fn deinterlace(
164164 comptime vec_count: usize,
165165 interlaced: anytype,
lib/std/target/csky.zig+7-7
......@@ -214,7 +214,7 @@ pub const all_features = blk: {
214214 };
215215 result[@enumToInt(Feature.dsp_silan)] = .{
216216 .llvm_name = "dsp_silan",
217 .description = "Enable DSP Silan instrutions",
217 .description = "Enable DSP Silan instructions",
218218 .dependencies = featureSet(&[_]Feature{}),
219219 };
220220 result[@enumToInt(Feature.dspe60)] = .{
......@@ -224,7 +224,7 @@ pub const all_features = blk: {
224224 };
225225 result[@enumToInt(Feature.dspv2)] = .{
226226 .llvm_name = "dspv2",
227 .description = "Enable DSP V2.0 instrutions",
227 .description = "Enable DSP V2.0 instructions",
228228 .dependencies = featureSet(&[_]Feature{}),
229229 };
230230 result[@enumToInt(Feature.e1)] = .{
......@@ -243,7 +243,7 @@ pub const all_features = blk: {
243243 };
244244 result[@enumToInt(Feature.edsp)] = .{
245245 .llvm_name = "edsp",
246 .description = "Enable DSP instrutions",
246 .description = "Enable DSP instructions",
247247 .dependencies = featureSet(&[_]Feature{}),
248248 };
249249 result[@enumToInt(Feature.elrw)] = .{
......@@ -333,12 +333,12 @@ pub const all_features = blk: {
333333 };
334334 result[@enumToInt(Feature.hwdiv)] = .{
335335 .llvm_name = "hwdiv",
336 .description = "Enable divide instrutions",
336 .description = "Enable divide instructions",
337337 .dependencies = featureSet(&[_]Feature{}),
338338 };
339339 result[@enumToInt(Feature.istack)] = .{
340340 .llvm_name = "istack",
341 .description = "Enable interrput attribute",
341 .description = "Enable interrupt attribute",
342342 .dependencies = featureSet(&[_]Feature{}),
343343 };
344344 result[@enumToInt(Feature.java)] = .{
......@@ -362,7 +362,7 @@ pub const all_features = blk: {
362362 };
363363 result[@enumToInt(Feature.multiple_stld)] = .{
364364 .llvm_name = "multiple_stld",
365 .description = "Enable multiple load/store instrutions",
365 .description = "Enable multiple load/store instructions",
366366 .dependencies = featureSet(&[_]Feature{}),
367367 };
368368 result[@enumToInt(Feature.nvic)] = .{
......@@ -372,7 +372,7 @@ pub const all_features = blk: {
372372 };
373373 result[@enumToInt(Feature.pushpop)] = .{
374374 .llvm_name = "pushpop",
375 .description = "Enable push/pop instrutions",
375 .description = "Enable push/pop instructions",
376376 .dependencies = featureSet(&[_]Feature{}),
377377 };
378378 result[@enumToInt(Feature.smart)] = .{
lib/std/time.zig+1-1
......@@ -258,7 +258,7 @@ pub const Instant = struct {
258258
259259/// A monotonic, high performance timer.
260260///
261/// Timer.start() is used to initalize the timer
261/// Timer.start() is used to initialize the timer
262262/// and gives the caller an opportunity to check for the existence of a supported clock.
263263/// Once a supported clock is discovered,
264264/// it is assumed that it will be available for the duration of the Timer's use.
lib/std/valgrind/memcheck.zig+2-2
......@@ -77,7 +77,7 @@ pub fn discard(blkindex: usize) bool {
7777}
7878
7979/// Check that memory at qzz.ptr is addressable for qzz.len bytes.
80/// If suitable addressibility is not established, Valgrind prints an
80/// If suitable addressability is not established, Valgrind prints an
8181/// error message and returns the address of the first offending byte.
8282/// Otherwise it returns zero.
8383pub fn checkMemIsAddressable(qzz: []u8) usize {
......@@ -85,7 +85,7 @@ pub fn checkMemIsAddressable(qzz: []u8) usize {
8585}
8686
8787/// Check that memory at qzz.ptr is addressable and defined for
88/// qzz.len bytes. If suitable addressibility and definedness are not
88/// qzz.len bytes. If suitable addressability and definedness are not
8989/// established, Valgrind prints an error message and returns the
9090/// address of the first offending byte. Otherwise it returns zero.
9191pub fn checkMemIsDefined(qzz: []u8) usize {
lib/std/zig/parser_test.zig+3-3
......@@ -239,7 +239,7 @@ test "zig fmt: file ends in comment after var decl" {
239239 );
240240}
241241
242test "zig fmt: if statment" {
242test "zig fmt: if statement" {
243243 try testCanonical(
244244 \\test "" {
245245 \\ if (optional()) |some|
......@@ -529,7 +529,7 @@ test "zig fmt: remove empty lines at start/end of block" {
529529 );
530530}
531531
532test "zig fmt: allow empty line before commment at start of block" {
532test "zig fmt: allow empty line before comment at start of block" {
533533 try testCanonical(
534534 \\test {
535535 \\
......@@ -4371,7 +4371,7 @@ test "zig fmt: same line doc comment returns error" {
43714371 \\const Foo = struct{
43724372 \\ bar: u32, /// comment
43734373 \\ foo: u32, /// comment
4374 \\ /// commment
4374 \\ /// comment
43754375 \\};
43764376 \\
43774377 \\const a = 42; /// comment
lib/std/zig/render.zig+1-1
......@@ -681,7 +681,7 @@ fn renderExpression(gpa: Allocator, ais: *Ais, tree: Ast, node: Ast.Node.Index,
681681
682682 try renderToken(ais, tree, switch_token, .space); // switch keyword
683683 try renderToken(ais, tree, switch_token + 1, .none); // lparen
684 try renderExpression(gpa, ais, tree, condition, .none); // condtion expression
684 try renderExpression(gpa, ais, tree, condition, .none); // condition expression
685685 try renderToken(ais, tree, rparen, .space); // rparen
686686
687687 ais.pushIndentNextLine();