authorgravatar for tensorush@gmail.comJora Troosh <tensorush@gmail.com> 2024-07-10 00:25:42+03:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2024-07-09 14:25:42-07:00
log13070448f5f1dba172946e6a1e1a5c885093cad8
tree3a93756f6be0af7361240f461f452cb7372200f6
parent49f2cca872c24d617082e9b21cbd8ac50e96bc50
signaturebadge-check Signed by PGP key B5690EEEBB952194

std: fix typos (#20560)


54 files changed, 95 insertions(+), 95 deletions(-)

doc/langref.html.in+2-2
......@@ -3498,7 +3498,7 @@ void do_a_thing(struct Foo *foo) {
34983498 <p>
34993499 As a motivating example, consider the statement {#syntax#}const x: u32 = 42;{#endsyntax#}. The type
35003500 annotation here provides a result type of {#syntax#}u32{#endsyntax#} to the initialization expression
3501 {#syntax#}42{#endsyntax#}, instructing the compiler to coerce this integer (initally of type
3501 {#syntax#}42{#endsyntax#}, instructing the compiler to coerce this integer (initially of type
35023502 {#syntax#}comptime_int{#endsyntax#}) to this type. We will see more examples shortly.
35033503 </p>
35043504 <p>
......@@ -6833,7 +6833,7 @@ coding style.
68336833 <li>utils, misc, or somebody's initials</li>
68346834 </ul>
68356835 <p>Everything is a value, all types are data, everything is context, all logic manages state.
6836 Nothing is communicated by using a word that applies to all types.</p>
6836 Nothing is communicated by using a word that applies to all types.</p>
68376837 <p>Temptation to use "utilities", "miscellaneous", or somebody's initials
68386838 is a failure to categorize, or more commonly, overcategorization. Such
68396839 declarations can live at the root of a module that needs them with no
doc/langref/test_coerce_tuples_arrays.zig+1-1
......@@ -2,7 +2,7 @@ const std = @import("std");
22const expect = std.testing.expect;
33
44const Tuple = struct { u8, u8 };
5test "coercion from homogenous tuple to array" {
5test "coercion from homogeneous tuple to array" {
66 const tuple: Tuple = .{ 5, 6 };
77 const array: [2]u8 = tuple;
88 _ = array;
lib/std/BitStack.zig+2-2
......@@ -20,8 +20,8 @@ pub fn deinit(self: *@This()) void {
2020 self.* = undefined;
2121}
2222
23pub fn ensureTotalCapacity(self: *@This(), bit_capcity: usize) Allocator.Error!void {
24 const byte_capacity = (bit_capcity + 7) >> 3;
23pub fn ensureTotalCapacity(self: *@This(), bit_capacity: usize) Allocator.Error!void {
24 const byte_capacity = (bit_capacity + 7) >> 3;
2525 try self.bytes.ensureTotalCapacity(byte_capacity);
2626}
2727
lib/std/Build.zig+1-1
......@@ -2055,7 +2055,7 @@ pub fn dependencyFromBuildZig(
20552055 }
20562056
20572057 const full_path = b.pathFromRoot("build.zig.zon");
2058 debug.panic("'{}' is not a build.zig struct of a dependecy in '{s}'", .{ build_zig, full_path });
2058 debug.panic("'{}' is not a build.zig struct of a dependency in '{s}'", .{ build_zig, full_path });
20592059}
20602060
20612061fn userValuesAreSame(lhs: UserValue, rhs: UserValue) bool {
lib/std/Target/aarch64.zig+1-1
......@@ -887,7 +887,7 @@ pub const all_features = blk: {
887887 };
888888 result[@intFromEnum(Feature.nv)] = .{
889889 .llvm_name = "nv",
890 .description = "Enable v8.4-A Nested Virtualization Enchancement (FEAT_NV, FEAT_NV2)",
890 .description = "Enable v8.4-A Nested Virtualization Enhancement (FEAT_NV, FEAT_NV2)",
891891 .dependencies = featureSet(&[_]Feature{}),
892892 };
893893 result[@intFromEnum(Feature.outline_atomics)] = .{
lib/std/Target/arm.zig+1-1
......@@ -446,7 +446,7 @@ pub const all_features = blk: {
446446 };
447447 result[@intFromEnum(Feature.fix_cmse_cve_2021_35465)] = .{
448448 .llvm_name = "fix-cmse-cve-2021-35465",
449 .description = "Mitigate against the cve-2021-35465 security vulnurability",
449 .description = "Mitigate against the cve-2021-35465 security vulnerability",
450450 .dependencies = featureSet(&[_]Feature{}),
451451 };
452452 result[@intFromEnum(Feature.fix_cortex_a57_aes_1742098)] = .{
lib/std/Target/csky.zig+7-7
......@@ -214,7 +214,7 @@ pub const all_features = blk: {
214214 };
215215 result[@intFromEnum(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[@intFromEnum(Feature.dspe60)] = .{
......@@ -224,7 +224,7 @@ pub const all_features = blk: {
224224 };
225225 result[@intFromEnum(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[@intFromEnum(Feature.e1)] = .{
......@@ -243,7 +243,7 @@ pub const all_features = blk: {
243243 };
244244 result[@intFromEnum(Feature.edsp)] = .{
245245 .llvm_name = "edsp",
246 .description = "Enable DSP instrutions",
246 .description = "Enable DSP instructions",
247247 .dependencies = featureSet(&[_]Feature{}),
248248 };
249249 result[@intFromEnum(Feature.elrw)] = .{
......@@ -333,12 +333,12 @@ pub const all_features = blk: {
333333 };
334334 result[@intFromEnum(Feature.hwdiv)] = .{
335335 .llvm_name = "hwdiv",
336 .description = "Enable divide instrutions",
336 .description = "Enable divide instructions",
337337 .dependencies = featureSet(&[_]Feature{}),
338338 };
339339 result[@intFromEnum(Feature.istack)] = .{
340340 .llvm_name = "istack",
341 .description = "Enable interrput attribute",
341 .description = "Enable interrupt attribute",
342342 .dependencies = featureSet(&[_]Feature{}),
343343 };
344344 result[@intFromEnum(Feature.java)] = .{
......@@ -362,7 +362,7 @@ pub const all_features = blk: {
362362 };
363363 result[@intFromEnum(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[@intFromEnum(Feature.nvic)] = .{
......@@ -372,7 +372,7 @@ pub const all_features = blk: {
372372 };
373373 result[@intFromEnum(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[@intFromEnum(Feature.smart)] = .{
lib/std/Target/riscv.zig+2-2
......@@ -823,14 +823,14 @@ pub const all_features = blk: {
823823 };
824824 result[@intFromEnum(Feature.zcmp)] = .{
825825 .llvm_name = "zcmp",
826 .description = "'Zcmp' (sequenced instuctions for code-size reduction)",
826 .description = "'Zcmp' (sequenced instructions for code-size reduction)",
827827 .dependencies = featureSet(&[_]Feature{
828828 .zca,
829829 }),
830830 };
831831 result[@intFromEnum(Feature.zcmt)] = .{
832832 .llvm_name = "zcmt",
833 .description = "'Zcmt' (table jump instuctions for code-size reduction)",
833 .description = "'Zcmt' (table jump instructions for code-size reduction)",
834834 .dependencies = featureSet(&[_]Feature{
835835 .zca,
836836 .zicsr,
lib/std/array_list.zig+4-4
......@@ -170,7 +170,7 @@ pub fn ArrayListAligned(comptime T: type, comptime alignment: ?u29) type {
170170 /// operations.
171171 /// Invalidates pre-existing pointers to elements at and after `index`.
172172 /// Invalidates all pre-existing element pointers if capacity must be
173 /// increased to accomodate the new elements.
173 /// increased to accommodate the new elements.
174174 /// Asserts that the index is in bounds or equal to the length.
175175 pub fn addManyAt(self: *Self, index: usize, count: usize) Allocator.Error![]T {
176176 const new_len = try addOrOom(self.items.len, count);
......@@ -227,7 +227,7 @@ pub fn ArrayListAligned(comptime T: type, comptime alignment: ?u29) type {
227227 /// This operation is O(N).
228228 /// Invalidates pre-existing pointers to elements at and after `index`.
229229 /// Invalidates all pre-existing element pointers if capacity must be
230 /// increased to accomodate the new elements.
230 /// increased to accommodate the new elements.
231231 /// Asserts that the index is in bounds or equal to the length.
232232 pub fn insertSlice(
233233 self: *Self,
......@@ -740,7 +740,7 @@ pub fn ArrayListAlignedUnmanaged(comptime T: type, comptime alignment: ?u29) typ
740740 /// operations.
741741 /// Invalidates pre-existing pointers to elements at and after `index`.
742742 /// Invalidates all pre-existing element pointers if capacity must be
743 /// increased to accomodate the new elements.
743 /// increased to accommodate the new elements.
744744 /// Asserts that the index is in bounds or equal to the length.
745745 pub fn addManyAt(
746746 self: *Self,
......@@ -776,7 +776,7 @@ pub fn ArrayListAlignedUnmanaged(comptime T: type, comptime alignment: ?u29) typ
776776 /// This operation is O(N).
777777 /// Invalidates pre-existing pointers to elements at and after `index`.
778778 /// Invalidates all pre-existing element pointers if capacity must be
779 /// increased to accomodate the new elements.
779 /// increased to accommodate the new elements.
780780 /// Asserts that the index is in bounds or equal to the length.
781781 pub fn insertSlice(
782782 self: *Self,
lib/std/c/darwin.zig+1-1
......@@ -2523,7 +2523,7 @@ pub const F = struct {
25232523 /// add signature from same file (used by dyld for shared libs)
25242524 pub const ADDFILESIGS = 61;
25252525 /// used in conjunction with F.NOCACHE to indicate that DIRECT, synchronous writes
2526 /// should not be used (i.e. its ok to temporaily create cached pages)
2526 /// should not be used (i.e. its ok to temporarily create cached pages)
25272527 pub const NODIRECT = 62;
25282528 ///Get the protection class of a file from the EA, returns int
25292529 pub const GETPROTECTIONCLASS = 63;
lib/std/coff.zig+1-1
......@@ -581,7 +581,7 @@ pub const SectionHeaderFlags = packed struct {
581581 /// This is valid for object files only.
582582 LNK_INFO: u1 = 0,
583583
584 _reserverd_2: u1 = 0,
584 _reserved_2: u1 = 0,
585585
586586 /// The section will not become part of the image.
587587 /// This is valid only for object files.
lib/std/compress/flate.zig+2-2
......@@ -70,8 +70,8 @@ pub const store = struct {
7070 }
7171};
7272
73/// Container defines header/footer arround deflate bit stream. Gzip and zlib
74/// compression algorithms are containers arround deflate bit stream body.
73/// Container defines header/footer around deflate bit stream. Gzip and zlib
74/// compression algorithms are containers around deflate bit stream body.
7575const Container = @import("flate/container.zig").Container;
7676const std = @import("std");
7777const testing = std.testing;
lib/std/compress/flate/CircularBuffer.zig+1-1
......@@ -109,7 +109,7 @@ const ReadBlock = struct {
109109 len: usize,
110110};
111111
112/// Returns position of continous read block data.
112/// Returns position of continuous read block data.
113113fn readBlock(self: *Self, max: usize) ReadBlock {
114114 const r = self.rp & mask;
115115 const w = self.wp & mask;
lib/std/compress/flate/Lookup.zig+1-1
......@@ -26,7 +26,7 @@ pub fn add(self: *Self, data: []const u8, pos: u16) u16 {
2626 return self.set(h, pos);
2727}
2828
29// Retruns previous location with the same hash value given the current
29// Returns previous location with the same hash value given the current
3030// position.
3131pub fn prev(self: *Self, pos: u16) u16 {
3232 return self.chain[pos];
lib/std/compress/flate/SlidingWindow.zig+1-1
......@@ -84,7 +84,7 @@ pub fn match(self: *Self, prev_pos: u16, curr_pos: u16, min_len: u16) u16 {
8484 const prev_lh = self.buffer[prev_pos..][0..max_len];
8585 const curr_lh = self.buffer[curr_pos..][0..max_len];
8686
87 // If we alread have match (min_len > 0),
87 // If we already have match (min_len > 0),
8888 // test the first byte above previous len a[min_len] != b[min_len]
8989 // and then all the bytes from that position to zero.
9090 // That is likely positions to find difference than looping from first bytes.
lib/std/compress/flate/Token.zig+1-1
......@@ -110,7 +110,7 @@ pub fn show(t: Token) void {
110110 }
111111}
112112
113// Retruns index in match_lengths table for each length in range 0-255.
113// Returns index in match_lengths table for each length in range 0-255.
114114const match_lengths_index = [_]u8{
115115 0, 1, 2, 3, 4, 5, 6, 7, 8, 8,
116116 9, 9, 10, 10, 11, 11, 12, 12, 12, 12,
lib/std/compress/flate/bit_reader.zig+4-4
......@@ -57,7 +57,7 @@ pub fn BitReader(comptime T: type, comptime ReaderType: type) type {
5757 /// it may be some extra zero bits in buffer.
5858 pub inline fn fill(self: *Self, nice: u6) !void {
5959 if (self.nbits >= nice and nice != 0) {
60 return; // We have enought bits
60 return; // We have enough bits
6161 }
6262 // Read more bits from forward reader
6363
......@@ -96,7 +96,7 @@ pub fn BitReader(comptime T: type, comptime ReaderType: type) type {
9696 pub const flag = struct {
9797 pub const peek: u3 = 0b001; // dont advance internal buffer, just get bits, leave them in buffer
9898 pub const buffered: u3 = 0b010; // assume that there is no need to fill, fill should be called before
99 pub const reverse: u3 = 0b100; // bit reverse readed bits
99 pub const reverse: u3 = 0b100; // bit reverse read bits
100100 };
101101
102102 /// Alias for readF(U, 0).
......@@ -133,7 +133,7 @@ pub fn BitReader(comptime T: type, comptime ReaderType: type) type {
133133 try self.fill(n);
134134 return @truncate(self.bits);
135135 },
136 flag.buffered => { // no fill, assume that buffer has enought bits
136 flag.buffered => { // no fill, assume that buffer has enough bits
137137 const u: U = @truncate(self.bits);
138138 try self.shift(n);
139139 return u;
......@@ -212,7 +212,7 @@ pub fn BitReader(comptime T: type, comptime ReaderType: type) type {
212212 }
213213
214214 /// Read deflate fixed fixed code.
215 /// Reads first 7 bits, and then mybe 1 or 2 more to get full 7,8 or 9 bit code.
215 /// Reads first 7 bits, and then maybe 1 or 2 more to get full 7,8 or 9 bit code.
216216 /// ref: https://datatracker.ietf.org/doc/html/rfc1951#page-12
217217 /// Lit Value Bits Codes
218218 /// --------- ---- -----
lib/std/compress/flate/block_writer.zig+1-1
......@@ -48,7 +48,7 @@ pub fn BlockWriter(comptime WriterType: type) type {
4848 /// Should be called only when bit stream is at byte boundary.
4949 ///
5050 /// That is after final block; when last byte could be incomplete or
51 /// after stored block; which is aligned to the byte bounday (it has x
51 /// after stored block; which is aligned to the byte boundary (it has x
5252 /// padding bits after first 3 bits).
5353 pub fn flush(self: *Self) Error!void {
5454 try self.bit_writer.flush();
lib/std/compress/flate/consts.zig+1-1
......@@ -1,5 +1,5 @@
11pub const deflate = struct {
2 // Number of tokens to accumlate in deflate before starting block encoding.
2 // Number of tokens to accumulate in deflate before starting block encoding.
33 //
44 // In zlib this depends on memlevel: 6 + memlevel, where default memlevel is
55 // 8 and max 9 that gives 14 or 15 bits.
lib/std/compress/flate/deflate.zig+5-5
......@@ -183,7 +183,7 @@ fn Deflate(comptime container: Container, comptime WriterType: type, comptime Bl
183183 // Write match from previous position.
184184 step = try self.addMatch(m) - 1; // we already advanced 1 from previous position
185185 } else {
186 // No match at previous postition.
186 // No match at previous position.
187187 // Write previous literal if any, and remember this literal.
188188 try self.addPrevLiteral();
189189 self.prev_literal = literal;
......@@ -268,9 +268,9 @@ fn Deflate(comptime container: Container, comptime WriterType: type, comptime Bl
268268 fn flushTokens(self: *Self, flush_opt: FlushOption) !void {
269269 // Pass tokens to the token writer
270270 try self.block_writer.write(self.tokens.tokens(), flush_opt == .final, self.win.tokensBuffer());
271 // Stored block ensures byte aligment.
271 // Stored block ensures byte alignment.
272272 // It has 3 bits (final, block_type) and then padding until byte boundary.
273 // After that everyting is aligned to the boundary in the stored block.
273 // After that everything is aligned to the boundary in the stored block.
274274 // Empty stored block is Ob000 + (0-7) bits of padding + 0x00 0x00 0xFF 0xFF.
275275 // Last 4 bytes are byte aligned.
276276 if (flush_opt == .flush) {
......@@ -572,7 +572,7 @@ test "tokenization" {
572572 }
573573}
574574
575// Tests that tokens writen are equal to expected token list.
575// Tests that tokens written are equal to expected token list.
576576const TestTokenWriter = struct {
577577 const Self = @This();
578578
......@@ -655,7 +655,7 @@ test "file tokenization" {
655655 const TokenWriter = TokenDecoder(@TypeOf(writer));
656656 var cmp = try Deflate(.raw, WriterType, TokenWriter).init(writer, .{ .level = level });
657657
658 // Stream uncompressed `orignal` data to the compressor. It will
658 // Stream uncompressed `original` data to the compressor. It will
659659 // produce tokens list and pass that list to the TokenDecoder. This
660660 // TokenDecoder uses CircularBuffer from inflate to convert list of
661661 // tokens back to the uncompressed stream.
lib/std/compress/flate/huffman_decoder.zig+3-3
......@@ -132,7 +132,7 @@ fn HuffmanDecoder(
132132 if (n > max) max = n;
133133 count[n] += 1;
134134 }
135 if (max == 0) // emtpy tree
135 if (max == 0) // empty tree
136136 return;
137137
138138 // check for an over-subscribed or incomplete set of lengths
......@@ -255,7 +255,7 @@ test "encode/decode literals" {
255255
256256 for (1..286) |j| { // for all different number of codes
257257 var enc: LiteralEncoder = .{};
258 // create freqencies
258 // create frequencies
259259 var freq = [_]u16{0} ** 286;
260260 freq[256] = 1; // ensure we have end of block code
261261 for (&freq, 1..) |*f, i| {
......@@ -263,7 +263,7 @@ test "encode/decode literals" {
263263 f.* = @intCast(i);
264264 }
265265
266 // encoder from freqencies
266 // encoder from frequencies
267267 enc.generate(&freq, 15);
268268
269269 // get code_lens from encoder
lib/std/compress/flate/huffman_encoder.zig+1-1
......@@ -168,7 +168,7 @@ pub fn HuffmanEncoder(comptime size: usize) type {
168168 while (true) {
169169 var l = &levels[level];
170170 if (l.next_pair_freq == math.maxInt(i32) and l.next_char_freq == math.maxInt(i32)) {
171 // We've run out of both leafs and pairs.
171 // We've run out of both leaves and pairs.
172172 // End all calculations for this level.
173173 // To make sure we never come back to this level or any lower level,
174174 // set next_pair_freq impossibly large.
lib/std/compress/flate/inflate.zig+3-3
......@@ -99,7 +99,7 @@ pub fn Inflate(comptime container: Container, comptime LookaheadType: type, comp
9999
100100 fn storedBlock(self: *Self) !bool {
101101 self.bits.alignToByte(); // skip padding until byte boundary
102 // everyting after this is byte aligned in stored block
102 // everything after this is byte aligned in stored block
103103 var len = try self.bits.read(u16);
104104 const nlen = try self.bits.read(u16);
105105 if (len != ~nlen) return error.WrongStoredBlockNlen;
......@@ -155,7 +155,7 @@ pub fn Inflate(comptime container: Container, comptime LookaheadType: type, comp
155155 fn dynamicBlockHeader(self: *Self) !void {
156156 const hlit: u16 = @as(u16, try self.bits.read(u5)) + 257; // number of ll code entries present - 257
157157 const hdist: u16 = @as(u16, try self.bits.read(u5)) + 1; // number of distance code entries - 1
158 const hclen: u8 = @as(u8, try self.bits.read(u4)) + 4; // hclen + 4 code lenths are encoded
158 const hclen: u8 = @as(u8, try self.bits.read(u4)) + 4; // hclen + 4 code lengths are encoded
159159
160160 if (hlit > 286 or hdist > 30)
161161 return error.InvalidDynamicBlockHeader;
......@@ -180,7 +180,7 @@ pub fn Inflate(comptime container: Container, comptime LookaheadType: type, comp
180180 return error.InvalidDynamicBlockHeader;
181181 }
182182
183 // literal code lengts to literal decoder
183 // literal code lengths to literal decoder
184184 try self.lit_dec.generate(dec_lens[0..hlit]);
185185
186186 // distance code lengths to distance decoder
lib/std/crypto/Certificate.zig+1-1
......@@ -977,7 +977,7 @@ pub const rsa = struct {
977977 // the hash function (2^61 - 1 octets for SHA-1), output
978978 // "inconsistent" and stop.
979979 // All the cryptographic hash functions in the standard library have a limit of >= 2^61 - 1.
980 // Even then, this check is only there for paranoia. In the context of TLS certifcates, emBit cannot exceed 4096.
980 // Even then, this check is only there for paranoia. In the context of TLS certificates, emBit cannot exceed 4096.
981981 if (emBit >= 1 << 61) return error.InvalidSignature;
982982
983983 // emLen = \ceil(emBits/8)
lib/std/crypto/ff.zig+1-1
......@@ -41,7 +41,7 @@ pub const OverflowError = error{Overflow};
4141/// Invalid modulus. Modulus must be odd.
4242pub const InvalidModulusError = error{ EvenModulus, ModulusTooSmall };
4343
44/// Exponentation with a null exponent.
44/// Exponentiation with a null exponent.
4545/// Exponentiation in cryptographic protocols is almost always a sign of a bug which can lead to trivial attacks.
4646/// Therefore, this module returns an error when a null exponent is encountered, encouraging applications to handle this case explicitly.
4747pub const NullExponentError = error{NullExponent};
lib/std/crypto/ml_kem.zig+2-2
......@@ -379,7 +379,7 @@ fn Kyber(comptime p: Params) type {
379379
380380 /// Create a new key pair.
381381 /// If seed is null, a random seed will be generated.
382 /// If a seed is provided, the key pair will be determinsitic.
382 /// If a seed is provided, the key pair will be deterministic.
383383 pub fn create(seed_: ?[seed_length]u8) !KeyPair {
384384 const seed = seed_ orelse sk: {
385385 var random_seed: [seed_length]u8 = undefined;
......@@ -1253,7 +1253,7 @@ const Poly = struct {
12531253 t |= @as(T, buf[batch_bytes * i + j]) << (8 * j);
12541254 }
12551255
1256 // Accumelate `a's and `b's together by masking them out, shifting
1256 // Accumulate `a's and `b's together by masking them out, shifting
12571257 // and adding. For η=3, we have d = a₁ + a₂ + a₃ + 8(b₁ + b₂ + b₃) + …
12581258 var d: T = 0;
12591259 inline for (0..eta) |j| {
lib/std/crypto/salsa20.zig+1-1
......@@ -487,7 +487,7 @@ pub const Box = struct {
487487 /// A key pair.
488488 pub const KeyPair = X25519.KeyPair;
489489
490 /// Compute a secret suitable for `secretbox` given a recipent's public key and a sender's secret key.
490 /// Compute a secret suitable for `secretbox` given a recipient's public key and a sender's secret key.
491491 pub fn createSharedSecret(public_key: [public_length]u8, secret_key: [secret_length]u8) (IdentityElementError || WeakPublicKeyError)![shared_length]u8 {
492492 const p = try X25519.scalarmult(secret_key, public_key);
493493 const zero = [_]u8{0} ** 16;
lib/std/crypto/sha2.zig+1-1
......@@ -1,6 +1,6 @@
11//! Secure Hashing Algorithm 2 (SHA2)
22//!
3//! Published by the National Institue of Standards and Technology (NIST) [1] [2].
3//! Published by the National Institute of Standards and Technology (NIST) [1] [2].
44//!
55//! Truncation mitigates length-extension attacks but increases vulnerability to collision
66//! attacks. Collision attacks remain impractical for all types defined here.
lib/std/crypto/tls.zig+2-2
......@@ -40,8 +40,8 @@ const assert = std.debug.assert;
4040pub const Client = @import("tls/Client.zig");
4141
4242pub const record_header_len = 5;
43pub const max_cipertext_inner_record_len = 1 << 14;
44pub const max_ciphertext_len = max_cipertext_inner_record_len + 256;
43pub const max_ciphertext_inner_record_len = 1 << 14;
44pub const max_ciphertext_len = max_ciphertext_inner_record_len + 256;
4545pub const max_ciphertext_record_len = max_ciphertext_len + record_header_len;
4646pub const hello_retry_request_sequence = [32]u8{
4747 0xCF, 0x21, 0xAD, 0x74, 0xE5, 0x9A, 0x61, 0x11, 0xBE, 0x1D, 0x8C, 0x02, 0x1E, 0x65, 0xB8, 0x91,
lib/std/crypto/tls/Client.zig+1-1
......@@ -819,7 +819,7 @@ fn prepareCiphertextRecord(
819819 const close_notify_alert_reserved = tls.close_notify_alert.len + overhead_len;
820820 while (true) {
821821 const encrypted_content_len: u16 = @intCast(@min(
822 @min(bytes.len - bytes_i, tls.max_cipertext_inner_record_len),
822 @min(bytes.len - bytes_i, tls.max_ciphertext_inner_record_len),
823823 ciphertext_buf.len -|
824824 (close_notify_alert_reserved + overhead_len + ciphertext_end),
825825 ));
lib/std/dwarf/abi.zig+1-1
......@@ -38,7 +38,7 @@ pub fn ipRegNum() u8 {
3838
3939pub fn fpRegNum(reg_context: RegisterContext) u8 {
4040 return switch (builtin.cpu.arch) {
41 // GCC on OS X historicaly did the opposite of ELF for these registers (only in .eh_frame), and that is now the convention for MachO
41 // GCC on OS X historically did the opposite of ELF for these registers (only in .eh_frame), and that is now the convention for MachO
4242 .x86 => if (reg_context.eh_frame and reg_context.is_macho) 4 else 5,
4343 .x86_64 => 6,
4444 .arm => 11,
lib/std/dwarf/expressions.zig+3-3
......@@ -15,7 +15,7 @@ pub const ExpressionContext = struct {
1515 /// The dwarf format of the section this expression is in
1616 format: dwarf.Format = .@"32",
1717
18 /// If specified, any addresses will pass through this function before being acccessed
18 /// If specified, any addresses will pass through this function before being accessed
1919 isValidMemory: ?*const fn (address: usize) bool = null,
2020
2121 /// The compilation unit this expression relates to, if any
......@@ -42,14 +42,14 @@ pub const ExpressionOptions = struct {
4242 /// The address size of the target architecture
4343 addr_size: u8 = @sizeOf(usize),
4444
45 /// Endianess of the target architecture
45 /// Endianness of the target architecture
4646 endian: std.builtin.Endian = builtin.target.cpu.arch.endian(),
4747
4848 /// Restrict the stack machine to a subset of opcodes used in call frame instructions
4949 call_frame_context: bool = false,
5050};
5151
52// Explcitly defined to support executing sub-expressions
52// Explicitly defined to support executing sub-expressions
5353pub const ExpressionError = error{
5454 UnimplementedExpressionCall,
5555 UnimplementedOpcode,
lib/std/hash/crc/impl.zig+1-1
......@@ -1,4 +1,4 @@
1// There is a generic CRC implementation "Crc()" which can be paramterized via
1// There is a generic CRC implementation "Crc()" which can be parameterized via
22// the Algorithm struct for a plethora of uses.
33//
44// The primary interface for all of the standard CRC algorithms is the
lib/std/hash/wyhash.zig+1-1
......@@ -79,7 +79,7 @@ pub const Wyhash = struct {
7979 @memcpy(scratch[0..rem], self.buf[self.buf.len - rem ..][0..rem]);
8080 @memcpy(scratch[rem..][0..self.buf_len], self.buf[0..self.buf_len]);
8181
82 // Same as input but with additional bytes preceeding start in case of a short buffer
82 // Same as input but with additional bytes preceding start in case of a short buffer
8383 input = &scratch;
8484 offset = rem;
8585 }
lib/std/meta.zig+1-1
......@@ -902,7 +902,7 @@ pub fn intToEnum(comptime EnumTag: type, tag_int: anytype) IntToEnumError!EnumTa
902902 return error.InvalidEnumTag;
903903 }
904904
905 // We don't direcly iterate over the fields of EnumTag, as that
905 // We don't directly iterate over the fields of EnumTag, as that
906906 // would require an inline loop. Instead, we create an array of
907907 // values that is comptime-know, but can be iterated at runtime
908908 // without requiring an inline loop. This generates better
lib/std/os/linux.zig+4-4
......@@ -570,7 +570,7 @@ pub fn futex_wake(uaddr: *const i32, futex_op: u32, val: i32) usize {
570570/// Returns the array index of one of the woken futexes.
571571/// No further information is provided: any number of other futexes may also
572572/// have been woken by the same event, and if more than one futex was woken,
573/// the retrned index may refer to any one of them.
573/// the returned index may refer to any one of them.
574574/// (It is not necessaryily the futex with the smallest index, nor the one
575575/// most recently woken, nor...)
576576pub fn futex2_waitv(
......@@ -648,7 +648,7 @@ pub fn futex2_wake(
648648pub fn futex2_requeue(
649649 /// Array describing the source and destination futex.
650650 waiters: [*]futex_waitv,
651 /// Unsed.
651 /// Unused.
652652 flags: u32,
653653 /// Number of futexes to wake.
654654 nr_wake: i32,
......@@ -6009,7 +6009,7 @@ else
60096009 /// values of this resource limit.
60106010 NICE,
60116011
6012 /// Maximum realtime priority allowed for non-priviledged
6012 /// Maximum realtime priority allowed for non-privileged
60136013 /// processes.
60146014 RTPRIO,
60156015
......@@ -7228,7 +7228,7 @@ pub const futex_waitv = extern struct {
72287228 uaddr: u64,
72297229 /// Flags for this waiter.
72307230 flags: u32,
7231 /// Reserved memeber to preserve alignment.
7231 /// Reserved member to preserve alignment.
72327232 /// Should be 0.
72337233 __reserved: u32,
72347234};
lib/std/os/linux/IoUring.zig+2-2
......@@ -3938,7 +3938,7 @@ test BufferGroup {
39383938
39393939 // Server uses buffer group receive
39403940 {
3941 // Submit recv operation, buffer will be choosen from buffer group
3941 // Submit recv operation, buffer will be chosen from buffer group
39423942 _ = try buf_grp.recv(2, fds.server, 0);
39433943 const submitted = try ring.submit();
39443944 try testing.expectEqual(1, submitted);
......@@ -3956,7 +3956,7 @@ test BufferGroup {
39563956 // Get buffer from pool
39573957 const buf = buf_grp.get(buffer_id)[0..len];
39583958 try testing.expectEqualSlices(u8, &data, buf);
3959 // Releaase buffer to the kernel when application is done with it
3959 // Release buffer to the kernel when application is done with it
39603960 buf_grp.put(buffer_id);
39613961 }
39623962}
lib/std/os/linux/bpf.zig+1-1
......@@ -140,7 +140,7 @@ pub const F_STRICT_ALIGNMENT = 0x1;
140140
141141/// If BPF_F_ANY_ALIGNMENT is used in BPF_PROF_LOAD command, the verifier will
142142/// allow any alignment whatsoever. On platforms with strict alignment
143/// requirements for loads ands stores (such as sparc and mips) the verifier
143/// requirements for loads and stores (such as sparc and mips) the verifier
144144/// validates that all loads and stores provably follow this requirement. This
145145/// flag turns that checking and enforcement off.
146146///
lib/std/os/linux/mips.zig+1-1
......@@ -385,7 +385,7 @@ pub const rlimit_resource = enum(c_int) {
385385 /// values of this resource limit.
386386 NICE,
387387
388 /// Maximum realtime priority allowed for non-priviledged
388 /// Maximum realtime priority allowed for non-privileged
389389 /// processes.
390390 RTPRIO,
391391
lib/std/os/linux/mips64.zig+1-1
......@@ -370,7 +370,7 @@ pub const rlimit_resource = enum(c_int) {
370370 /// values of this resource limit.
371371 NICE,
372372
373 /// Maximum realtime priority allowed for non-priviledged
373 /// Maximum realtime priority allowed for non-privileged
374374 /// processes.
375375 RTPRIO,
376376
lib/std/os/linux/sparc64.zig+1-1
......@@ -460,7 +460,7 @@ pub const rlimit_resource = enum(c_int) {
460460 /// values of this resource limit.
461461 NICE,
462462
463 /// Maximum realtime priority allowed for non-priviledged
463 /// Maximum realtime priority allowed for non-privileged
464464 /// processes.
465465 RTPRIO,
466466
lib/std/os/plan9.zig+1-1
......@@ -184,7 +184,7 @@ pub const SIG = struct {
184184pub const sigset_t = c_long;
185185pub const empty_sigset = 0;
186186pub const siginfo_t = c_long;
187// TODO plan9 doesn't have sigaction_fn. Sigaction is not a union, but we incude it here to be compatible.
187// TODO plan9 doesn't have sigaction_fn. Sigaction is not a union, but we include it here to be compatible.
188188pub const Sigaction = extern struct {
189189 pub const handler_fn = *const fn (i32) callconv(.C) void;
190190 pub const sigaction_fn = *const fn (i32, *const siginfo_t, ?*anyopaque) callconv(.C) void;
lib/std/posix.zig+1-1
......@@ -3474,7 +3474,7 @@ pub const SocketError = error{
34743474pub fn socket(domain: u32, socket_type: u32, protocol: u32) SocketError!socket_t {
34753475 if (native_os == .windows) {
34763476 // NOTE: windows translates the SOCK.NONBLOCK/SOCK.CLOEXEC flags into
3477 // windows-analagous operations
3477 // windows-analogous operations
34783478 const filtered_sock_type = socket_type & ~@as(u32, SOCK.NONBLOCK | SOCK.CLOEXEC);
34793479 const flags: u32 = if ((socket_type & SOCK.CLOEXEC) != 0)
34803480 windows.ws2_32.WSA_FLAG_NO_HANDLE_INHERIT
lib/std/priority_queue.zig+1-1
......@@ -617,7 +617,7 @@ fn contextLessThan(context: []const u32, a: usize, b: usize) Order {
617617
618618const CPQlt = PriorityQueue(usize, []const u32, contextLessThan);
619619
620test "add and remove min heap with contextful comparator" {
620test "add and remove min heap with context comparator" {
621621 const context = [_]u32{ 5, 3, 4, 2, 2, 8, 0 };
622622
623623 var queue = CPQlt.init(testing.allocator, context[0..]);
lib/std/process.zig+2-2
......@@ -1818,7 +1818,7 @@ pub const CreateEnvironOptions = struct {
18181818 zig_progress_fd: ?i32 = null,
18191819};
18201820
1821/// Creates a null-deliminated environment variable block in the format
1821/// Creates a null-delimited environment variable block in the format
18221822/// expected by POSIX, from a hash map plus options.
18231823pub fn createEnvironFromMap(
18241824 arena: Allocator,
......@@ -1880,7 +1880,7 @@ pub fn createEnvironFromMap(
18801880 return envp_buf;
18811881}
18821882
1883/// Creates a null-deliminated environment variable block in the format
1883/// Creates a null-delimited environment variable block in the format
18841884/// expected by POSIX, from a hash map plus options.
18851885pub fn createEnvironFromExisting(
18861886 arena: Allocator,
lib/std/sort/pdq.zig+1-1
......@@ -268,7 +268,7 @@ fn breakPatterns(a: usize, b: usize, context: anytype) void {
268268 }
269269}
270270
271/// choses a pivot in `items[a..b]`.
271/// chooses a pivot in `items[a..b]`.
272272/// swaps likely_sorted when `items[a..b]` seems to be already sorted.
273273fn chosePivot(a: usize, b: usize, pivot: *usize, context: anytype) Hint {
274274 // minimum length for using the Tukey's ninther method
lib/std/tar.zig+2-2
......@@ -315,7 +315,7 @@ pub const FileKind = enum {
315315 file,
316316};
317317
318/// Iteartor over entries in the tar file represented by reader.
318/// Iterator over entries in the tar file represented by reader.
319319pub fn Iterator(comptime ReaderType: type) type {
320320 return struct {
321321 reader: ReaderType,
......@@ -423,7 +423,7 @@ pub fn Iterator(comptime ReaderType: type) type {
423423 self.padding = blockPadding(size);
424424
425425 switch (kind) {
426 // File types to retrun upstream
426 // File types to return upstream
427427 .directory, .normal, .symbolic_link => {
428428 file.kind = switch (kind) {
429429 .directory => .directory,
lib/std/tar/test.zig+1-1
......@@ -9,7 +9,7 @@ const Case = struct {
99 mode: u32 = 0,
1010 link_name: []const u8 = &[0]u8{},
1111 kind: tar.FileKind = .file,
12 truncated: bool = false, // when there is no file body, just header, usefull for huge files
12 truncated: bool = false, // when there is no file body, just header, useful for huge files
1313 };
1414
1515 data: []const u8, // testdata file content
lib/std/valgrind/callgrind.zig+1-1
......@@ -54,7 +54,7 @@ pub fn startInstrumentation() void {
5454
5555/// Stop full callgrind instrumentation if not already switched off.
5656/// This flushes Valgrinds translation cache, and does no additional
57/// instrumentation afterwards, which effectivly will run at the same
57/// instrumentation afterwards, which effectively will run at the same
5858/// speed as the "none" tool (ie. at minimal slowdown).
5959/// Use this to bypass Callgrind aggregation for uninteresting code parts.
6060/// To start Callgrind in this mode to ignore the setup phase, use
lib/std/zig/AstGen.zig+5-5
......@@ -5085,7 +5085,7 @@ fn structDeclInner(
50855085 any_default_inits = true;
50865086
50875087 // The decl_inst is used as here so that we can easily reconstruct a mapping
5088 // between it and the field type when the fields inits are analzyed.
5088 // between it and the field type when the fields inits are analyzed.
50895089 const ri: ResultInfo = .{ .rl = if (field_type == .none) .none else .{ .coerced_ty = decl_inst.toRef() } };
50905090
50915091 const default_inst = try expr(&block_scope, &namespace.base, ri, member.ast.value_expr);
......@@ -11559,7 +11559,7 @@ fn identAsString(astgen: *AstGen, ident_token: Ast.TokenIndex) !Zir.NullTerminat
1155911559}
1156011560
1156111561/// Adds a doc comment block to `string_bytes` by walking backwards from `end_token`.
11562/// `end_token` must point at the first token after the last doc coment line.
11562/// `end_token` must point at the first token after the last doc comment line.
1156311563/// Returns 0 if no doc comment is present.
1156411564fn docCommentAsString(astgen: *AstGen, end_token: Ast.TokenIndex) !Zir.NullTerminatedString {
1156511565 if (end_token == 0) return .empty;
......@@ -11780,7 +11780,7 @@ const Scope = struct {
1178011780 inst: Zir.Inst.Ref,
1178111781 /// Source location of the corresponding variable declaration.
1178211782 token_src: Ast.TokenIndex,
11783 /// Track the first identifer where it is referenced.
11783 /// Track the first identifier where it is referenced.
1178411784 /// 0 means never referenced.
1178511785 used: Ast.TokenIndex = 0,
1178611786 /// Track the identifier where it is discarded, like this `_ = foo;`.
......@@ -11803,13 +11803,13 @@ const Scope = struct {
1180311803 ptr: Zir.Inst.Ref,
1180411804 /// Source location of the corresponding variable declaration.
1180511805 token_src: Ast.TokenIndex,
11806 /// Track the first identifer where it is referenced.
11806 /// Track the first identifier where it is referenced.
1180711807 /// 0 means never referenced.
1180811808 used: Ast.TokenIndex = 0,
1180911809 /// Track the identifier where it is discarded, like this `_ = foo;`.
1181011810 /// 0 means never discarded.
1181111811 discarded: Ast.TokenIndex = 0,
11812 /// Whether this value is used as an lvalue after inititialization.
11812 /// Whether this value is used as an lvalue after initialization.
1181311813 /// If not, we know it can be `const`, so will emit a compile error if it is `var`.
1181411814 used_as_lvalue: bool = false,
1181511815 /// String table index.
lib/std/zig/AstRlAnnotate.zig+2-2
......@@ -7,8 +7,8 @@
77//! occur. Thus, we want to provide a real result pointer (from an alloc) only
88//! when necessary.
99//!
10//! To achive this, we need to determine which expressions require a result
11//! pointer. This pass is reponsible for analyzing all syntax forms which may
10//! To achieve this, we need to determine which expressions require a result
11//! pointer. This pass is responsible for analyzing all syntax forms which may
1212//! provide a result location and, if sub-expressions consume this result
1313//! pointer non-trivially (e.g. writing through field pointers), marking the
1414//! node as requiring a result location.
lib/std/zig/WindowsSdk.zig+3-3
......@@ -878,7 +878,7 @@ const MsvcLibDir = struct {
878878 error.OutOfMemory => return error.OutOfMemory,
879879 else => continue,
880880 };
881 if (source_directories_value.len > (std.fs.max_path_bytes * 30)) { // note(bratishkaerik): guessing from the fact that on my computer it has 15 pathes and at least some of them are not of max length
881 if (source_directories_value.len > (std.fs.max_path_bytes * 30)) { // note(bratishkaerik): guessing from the fact that on my computer it has 15 paths and at least some of them are not of max length
882882 allocator.free(source_directories_value);
883883 continue;
884884 }
......@@ -887,10 +887,10 @@ const MsvcLibDir = struct {
887887 } else return error.PathNotFound;
888888 defer allocator.free(source_directories);
889889
890 var source_directories_splitted = std.mem.splitScalar(u8, source_directories, ';');
890 var source_directories_split = std.mem.splitScalar(u8, source_directories, ';');
891891
892892 const msvc_dir: []const u8 = msvc_dir: {
893 const msvc_include_dir_maybe_with_trailing_slash = try allocator.dupe(u8, source_directories_splitted.first());
893 const msvc_include_dir_maybe_with_trailing_slash = try allocator.dupe(u8, source_directories_split.first());
894894
895895 if (msvc_include_dir_maybe_with_trailing_slash.len > std.fs.max_path_bytes or !std.fs.path.isAbsolute(msvc_include_dir_maybe_with_trailing_slash)) {
896896 allocator.free(msvc_include_dir_maybe_with_trailing_slash);
lib/std/zig/parser_test.zig+1-1
......@@ -4540,7 +4540,7 @@ test "zig fmt: decimal float literals with underscore separators" {
45404540 );
45414541}
45424542
4543test "zig fmt: hexadeciaml float literals with underscore separators" {
4543test "zig fmt: hexadecimal float literals with underscore separators" {
45444544 try testTransform(
45454545 \\pub fn main() void {
45464546 \\ const a: f64 = (0x10.0p-0+(0x10.0p+0))+0x10_00.00_00p-8+0x00_00.00_10p+16;
lib/std/zig/system.zig+1-1
......@@ -1044,7 +1044,7 @@ fn detectAbiAndDynamicLinker(
10441044 defer if (is_elf_file == false) file.close();
10451045
10461046 // Shortest working interpreter path is "#!/i" (4)
1047 // (interpreter is "/i", assuming all pathes are absolute, like in above comment).
1047 // (interpreter is "/i", assuming all paths are absolute, like in above comment).
10481048 // ELF magic number length is also 4.
10491049 //
10501050 // If file is shorter than that, it is definitely not ELF file