From c45af2af6168c7a3cf1bf9e50f6fc1a95b486ce8 Mon Sep 17 00:00:00 2001 From: JustinWayland Date: Sat, 21 Oct 2023 17:24:55 -0400 Subject: [PATCH] Fix simple doc mistakes. (#17624) * Add missing period in Stack's description This looks fine in the source, but looks bad when seen on the documentation website. * Correct documentation for attachSegfaultHandler() The description for attachSegfaultHandler() looks pretty bad without indicating that the stuff at the end is code * Added missing 'the's in Queue.put's documentation * Fixed several errors in Stack's documentation `push()` and `pop()` were not styled as code There was no period after `pop()`, which looks bad on the documentation. * Fix multiple problems in base64.zig Both "invalid"s in Base64.decoder were not capitalized. Missing period in documentation of Base64DecoderWithIgnore.calcSizeUpperBound. * Fix capitalization typos in bit_set.zig In DynamicBitSetUnmanaged.deinit's and DynamicBitSet.deinit's documentation, "deinitializes" was uncapitalized. * Fix typos in fifo.zig's documentation Added a previously missing period to the end of the first line of LinearFifo.writableSlice's documentation. Added missing periods to both lines of LinearFifo.pump's documentation. * Fix typos in fmt.bufPrint's documentation The starts of both lines were not capitalized. * Fix minor documentation problems in fs/file.zig Missing periods in documentation for Permissions.setReadOnly, PermissionsWindows.setReadOnly, MetadataUnix.created, MetadataLinux.created, and MetadataWindows.created. * Fix a glaring typo in enums.zig * Correct errors in fs.zig * Fixed documentation problems in hash_map.zig The added empty line in verify_context's documentation is needed, otherwise autodoc for some reason assumes that the list hasn't been terminated and continues reading off the rest of the documentation as if it were part of the second list item. * Added lines between consecutive URLs in http.zig Makes the documentation conform closer to what was intended. * Fix wrongfully ended sentence in Uri.zig * Handle wrongly entered comma in valgrind.zig. * Add missing periods in wasm.zig's documentation * Fix odd spacing in event/loop.zig * Add missing period in http/Headers.zig * Added missing period in io/limited_reader.zig This isn't in the documentation due to what I guess is a limitation of autodoc, but it's clearly supposed to be. If it was, it would look pretty bad. * Correct documentation in math/big/int.zig * Correct formatting in math/big/rational.zig * Create an actual link to ZIGNOR's paper. * Fixed grammatical issues in sort/block.zig This will not show up in the documentation currently. * Fix typo in hash_map.zig --- lib/std/Uri.zig | 2 +- lib/std/atomic/queue.zig | 2 +- lib/std/atomic/stack.zig | 4 ++-- lib/std/base64.zig | 6 +++--- lib/std/bit_set.zig | 4 ++-- lib/std/debug.zig | 2 +- lib/std/enums.zig | 2 +- lib/std/event/loop.zig | 16 ++++++++-------- lib/std/fifo.zig | 6 +++--- lib/std/fmt.zig | 4 ++-- lib/std/fs.zig | 2 +- lib/std/fs/file.zig | 10 +++++----- lib/std/hash_map.zig | 13 +++++++------ lib/std/http.zig | 8 ++++++++ lib/std/http/Headers.zig | 2 +- lib/std/io/limited_reader.zig | 2 +- lib/std/math/big/int.zig | 3 ++- lib/std/math/big/rational.zig | 4 ++-- lib/std/rand/ziggurat.zig | 5 ++--- lib/std/sort/block.zig | 2 +- lib/std/valgrind.zig | 2 +- lib/std/wasm.zig | 4 ++-- 22 files changed, 57 insertions(+), 48 deletions(-) diff --git a/lib/std/Uri.zig b/lib/std/Uri.zig index 83e7da76494bbb0f08a530ac4af5c5d978554be3..6952839e71f6bb12177f6fb88f4405e0e0a8bdb0 100644 --- a/lib/std/Uri.zig +++ b/lib/std/Uri.zig @@ -129,7 +129,7 @@ pub fn unescapeString(allocator: std.mem.Allocator, input: []const u8) error{Out pub const ParseError = error{ UnexpectedCharacter, InvalidFormat, InvalidPort }; /// Parses the URI or returns an error. This function is not compliant, but is required to parse -/// some forms of URIs in the wild. Such as HTTP Location headers. +/// some forms of URIs in the wild, such as HTTP Location headers. /// The return value will contain unescaped strings pointing into the /// original `text`. Each component that is provided, will be non-`null`. pub fn parseWithoutScheme(text: []const u8) ParseError!Uri { diff --git a/lib/std/atomic/queue.zig b/lib/std/atomic/queue.zig index 7094cce96427b9d7885f89241f801a88e1e1d5c9..e8d37507d3751c4a6f1f410c13b02d7a07d264a6 100644 --- a/lib/std/atomic/queue.zig +++ b/lib/std/atomic/queue.zig @@ -27,7 +27,7 @@ pub fn Queue(comptime T: type) type { } /// Appends `node` to the queue. - /// The lifetime of `node` must be longer than lifetime of queue. + /// The lifetime of `node` must be longer than the lifetime of the queue. pub fn put(self: *Self, node: *Node) void { node.next = null; diff --git a/lib/std/atomic/stack.zig b/lib/std/atomic/stack.zig index 12892176524f73ee801c2bd1ac4ca748a1119837..1f19869fd610162d10dc683935e3f2bd68efc939 100644 --- a/lib/std/atomic/stack.zig +++ b/lib/std/atomic/stack.zig @@ -3,8 +3,8 @@ const builtin = @import("builtin"); const assert = std.debug.assert; const expect = std.testing.expect; -/// Many reader, many writer, non-allocating, thread-safe -/// Uses a spinlock to protect push() and pop() +/// Many reader, many writer, non-allocating, thread-safe. +/// Uses a spinlock to protect `push()` and `pop()`. /// When building in single threaded mode, this is a simple linked list. pub fn Stack(comptime T: type) type { return struct { diff --git a/lib/std/base64.zig b/lib/std/base64.zig index a2f766dc2606f4a65ce340e69002b77e20e2f1ee..26f1b1be6125f485e27aa42ba4441d2406449f59 100644 --- a/lib/std/base64.zig +++ b/lib/std/base64.zig @@ -203,8 +203,8 @@ pub const Base64Decoder = struct { } /// dest.len must be what you get from ::calcSize. - /// invalid characters result in error.InvalidCharacter. - /// invalid padding results in error.InvalidPadding. + /// Invalid characters result in `error.InvalidCharacter`. + /// Invalid padding results in `error.InvalidPadding`. pub fn decode(decoder: *const Base64Decoder, dest: []u8, source: []const u8) Error!void { if (decoder.pad_char != null and source.len % 4 != 0) return error.InvalidPadding; var dest_idx: usize = 0; @@ -291,7 +291,7 @@ pub const Base64DecoderWithIgnore = struct { return result; } - /// Return the maximum possible decoded size for a given input length - The actual length may be less if the input includes padding + /// Return the maximum possible decoded size for a given input length - The actual length may be less if the input includes padding. /// `InvalidPadding` is returned if the input length is not valid. pub fn calcSizeUpperBound(decoder_with_ignore: *const Base64DecoderWithIgnore, source_len: usize) Error!usize { var result = source_len / 4 * 3; diff --git a/lib/std/bit_set.zig b/lib/std/bit_set.zig index 9e5c707b84d03d8106d33d82a5b4701fa16b97a7..430f521eb69bfd1d2f90dad047eb787a7cc65906 100644 --- a/lib/std/bit_set.zig +++ b/lib/std/bit_set.zig @@ -753,7 +753,7 @@ pub const DynamicBitSetUnmanaged = struct { self.bit_length = new_len; } - /// deinitializes the array and releases its memory. + /// Deinitializes the array and releases its memory. /// The passed allocator must be the same one used for /// init* or resize in the past. pub fn deinit(self: *Self, allocator: Allocator) void { @@ -1058,7 +1058,7 @@ pub const DynamicBitSet = struct { try self.unmanaged.resize(self.allocator, new_len, fill); } - /// deinitializes the array and releases its memory. + /// Deinitializes the array and releases its memory. /// The passed allocator must be the same one used for /// init* or resize in the past. pub fn deinit(self: *Self) void { diff --git a/lib/std/debug.zig b/lib/std/debug.zig index 95bc8d0eaf8c8a21df76dab615a0e9985e733e89..4af395beb4210b6f74ad570fa798e5e2896738f1 100644 --- a/lib/std/debug.zig +++ b/lib/std/debug.zig @@ -2340,7 +2340,7 @@ pub fn updateSegfaultHandler(act: ?*const os.Sigaction) error{OperationNotSuppor try os.sigaction(os.SIG.FPE, act, null); } -/// Attaches a global SIGSEGV handler which calls @panic("segmentation fault"); +/// Attaches a global SIGSEGV handler which calls `@panic("segmentation fault");` pub fn attachSegfaultHandler() void { if (!have_segfault_handling_support) { @compileError("segfault handler not supported for this target"); diff --git a/lib/std/enums.zig b/lib/std/enums.zig index 4caf78f8697a4279dd2dec74ad3d5bd63244c4f9..de112b825746dc9b204963734ae4d9c25e1c21fc 100644 --- a/lib/std/enums.zig +++ b/lib/std/enums.zig @@ -425,7 +425,7 @@ pub fn BoundedEnumMultiset(comptime E: type, comptime CountSize: type) type { } } - /// Deccreases the all key counts by given multiset. If + /// Decreases the all key counts by given multiset. If /// the given multiset has more key counts than this, /// then that key will have a key count of zero. pub fn removeSet(self: *Self, other: Self) void { diff --git a/lib/std/event/loop.zig b/lib/std/event/loop.zig index b5021a5378e4e822c47f3abef5a5ce11adbb481a..883312d176d84a6343fb0f39550003523634849c 100644 --- a/lib/std/event/loop.zig +++ b/lib/std/event/loop.zig @@ -969,21 +969,21 @@ pub const Loop = struct { /// This argument is a socket that has been created with `socket`, bound to a local address /// with `bind`, and is listening for connections after a `listen`. sockfd: os.socket_t, - /// This argument is a pointer to a sockaddr structure. This structure is filled in with the - /// address of the peer socket, as known to the communications layer. The exact format of the - /// address returned addr is determined by the socket's address family (see `socket` and the - /// respective protocol man pages). + /// This argument is a pointer to a sockaddr structure. This structure is filled in with the + /// address of the peer socket, as known to the communications layer. The exact format of the + /// address returned addr is determined by the socket's address family (see `socket` and the + /// respective protocol man pages). addr: *os.sockaddr, - /// This argument is a value-result argument: the caller must initialize it to contain the + /// This argument is a value-result argument: the caller must initialize it to contain the /// size (in bytes) of the structure pointed to by addr; on return it will contain the actual size /// of the peer address. /// - /// The returned address is truncated if the buffer provided is too small; in this case, `addr_size` + /// The returned address is truncated if the buffer provided is too small; in this case, `addr_size` /// will return a value greater than was supplied to the call. addr_size: *os.socklen_t, /// The following values can be bitwise ORed in flags to obtain different behavior: - /// * `SOCK.CLOEXEC` - Set the close-on-exec (`FD_CLOEXEC`) flag on the new file descriptor. See the - /// description of the `O.CLOEXEC` flag in `open` for reasons why this may be useful. + /// * `SOCK.CLOEXEC` - Set the close-on-exec (`FD_CLOEXEC`) flag on the new file descriptor. See the + /// description of the `O.CLOEXEC` flag in `open` for reasons why this may be useful. flags: u32, ) os.AcceptError!os.socket_t { while (true) { diff --git a/lib/std/fifo.zig b/lib/std/fifo.zig index 5d798cb99dd83453cc9b0b279e3b1229b13d519d..5b19125e02529436dab5a492838fbc057b9a8fe5 100644 --- a/lib/std/fifo.zig +++ b/lib/std/fifo.zig @@ -242,7 +242,7 @@ pub fn LinearFifo( return self.buf.len - self.count; } - /// Returns the first section of writable buffer + /// Returns the first section of writable buffer. /// Note that this may be of length 0 pub fn writableSlice(self: SliceSelfArg, offset: usize) []T { if (offset > self.buf.len) return &[_]T{}; @@ -371,8 +371,8 @@ pub fn LinearFifo( return self.buf[index]; } - /// Pump data from a reader into a writer - /// stops when reader returns 0 bytes (EOF) + /// Pump data from a reader into a writer. + /// Stops when reader returns 0 bytes (EOF). /// Buffer size must be set before calling; a buffer length of 0 is invalid. pub fn pump(self: *Self, src_reader: anytype, dest_writer: anytype) !void { assert(self.buf.len > 0); diff --git a/lib/std/fmt.zig b/lib/std/fmt.zig index 8a720476525038e68d9c78e3e974fbd949f9cd27..9538d91fa35f484c1efe0dc680e9d427c8728fca 100644 --- a/lib/std/fmt.zig +++ b/lib/std/fmt.zig @@ -1989,8 +1989,8 @@ pub const BufPrintError = error{ NoSpaceLeft, }; -/// print a Formatter string into `buf`. Actually just a thin wrapper around `format` and `fixedBufferStream`. -/// returns a slice of the bytes printed to. +/// Print a Formatter string into `buf`. Actually just a thin wrapper around `format` and `fixedBufferStream`. +/// Returns a slice of the bytes printed to. pub fn bufPrint(buf: []u8, comptime fmt: []const u8, args: anytype) BufPrintError![]u8 { var fbs = std.io.fixedBufferStream(buf); try format(fbs.writer(), fmt, args); diff --git a/lib/std/fs.zig b/lib/std/fs.zig index d95321cfd303cd87701136c88e19f5b879a3e450..62446a29eab136965fbce328c06940e70e67f15b 100644 --- a/lib/std/fs.zig +++ b/lib/std/fs.zig @@ -204,7 +204,7 @@ pub const AtomicFile = struct { } } - /// always call deinit, even after successful finish() + /// Always call deinit, even after a successful finish(). pub fn deinit(self: *AtomicFile) void { if (self.file_open) { self.file.close(); diff --git a/lib/std/fs/file.zig b/lib/std/fs/file.zig index c19a19a3d3c67525d5e8b1297866d78dbd8ec600..3436aa4b330358e123a35a18aa1cab0c8852ee5c 100644 --- a/lib/std/fs/file.zig +++ b/lib/std/fs/file.zig @@ -453,7 +453,7 @@ pub const File = struct { } /// Sets whether write permissions are provided. - /// On Unix, this affects *all* classes. If this is undesired, use `unixSet` + /// On Unix, this affects *all* classes. If this is undesired, use `unixSet`. /// This method *DOES NOT* set permissions on the filesystem: use `File.setPermissions(permissions)` pub fn setReadOnly(self: *Self, read_only: bool) void { self.inner.setReadOnly(read_only); @@ -493,7 +493,7 @@ pub const File = struct { } /// Sets whether write permissions are provided. - /// This affects *all* classes. If this is undesired, use `unixSet` + /// This affects *all* classes. If this is undesired, use `unixSet`. /// This method *DOES NOT* set permissions on the filesystem: use `File.setPermissions(permissions)` pub fn setReadOnly(self: *Self, read_only: bool) void { if (read_only) { @@ -706,7 +706,7 @@ pub const File = struct { return @as(i128, mtime.tv_sec) * std.time.ns_per_s + mtime.tv_nsec; } - /// Returns the time the file was created in nanoseconds since UTC 1970-01-01 + /// Returns the time the file was created in nanoseconds since UTC 1970-01-01. /// Returns null if this is not supported by the OS or filesystem pub fn created(self: Self) ?i128 { if (!@hasDecl(@TypeOf(self.stat), "birthtime")) return null; @@ -772,7 +772,7 @@ pub const File = struct { return @as(i128, self.statx.mtime.tv_sec) * std.time.ns_per_s + self.statx.mtime.tv_nsec; } - /// Returns the time the file was created in nanoseconds since UTC 1970-01-01 + /// Returns the time the file was created in nanoseconds since UTC 1970-01-01. /// Returns null if this is not supported by the filesystem, or on kernels before than version 4.11 pub fn created(self: Self) ?i128 { if (self.statx.mask & os.linux.STATX_BTIME == 0) return null; @@ -825,7 +825,7 @@ pub const File = struct { return self.modified_time; } - /// Returns the time the file was created in nanoseconds since UTC 1970-01-01 + /// Returns the time the file was created in nanoseconds since UTC 1970-01-01. /// This never returns null, only returning an optional for compatibility with other OSes pub fn created(self: Self) ?i128 { return self.creation_time; diff --git a/lib/std/hash_map.zig b/lib/std/hash_map.zig index 43a631baf5ba8d047aabceb315431ae54809e1bc..40a412bf3c4b6441b954e8c4d4bc8312f6cdf0fe 100644 --- a/lib/std/hash_map.zig +++ b/lib/std/hash_map.zig @@ -126,6 +126,7 @@ pub const default_max_load_percentage = 80; /// member functions: /// - hash(self, PseudoKey) Hash /// - eql(self, PseudoKey, Key) bool +/// /// If you are passing a context to a *Adapted function, PseudoKey is the type /// of the key parameter. Otherwise, when creating a HashMap or HashMapUnmanaged /// type, PseudoKey = Key = K. @@ -469,7 +470,7 @@ pub fn HashMap( } /// If key exists this function cannot fail. - /// If there is an existing item with `key`, then the result + /// If there is an existing item with `key`, then the result's /// `Entry` pointers point to it, and found_existing is true. /// Otherwise, puts a new item with undefined value, and /// the `Entry` pointers point to it. Caller should then initialize @@ -479,7 +480,7 @@ pub fn HashMap( } /// If key exists this function cannot fail. - /// If there is an existing item with `key`, then the result + /// If there is an existing item with `key`, then the result's /// `Entry` pointers point to it, and found_existing is true. /// Otherwise, puts a new item with undefined key and value, and /// the `Entry` pointers point to it. Caller must then initialize @@ -488,7 +489,7 @@ pub fn HashMap( return self.unmanaged.getOrPutContextAdapted(self.allocator, key, ctx, self.ctx); } - /// If there is an existing item with `key`, then the result + /// If there is an existing item with `key`, then the result's /// `Entry` pointers point to it, and found_existing is true. /// Otherwise, puts a new item with undefined value, and /// the `Entry` pointers point to it. Caller should then initialize @@ -499,7 +500,7 @@ pub fn HashMap( return self.unmanaged.getOrPutAssumeCapacityContext(key, self.ctx); } - /// If there is an existing item with `key`, then the result + /// If there is an existing item with `key`, then the result's /// `Entry` pointers point to it, and found_existing is true. /// Otherwise, puts a new item with undefined value, and /// the `Entry` pointers point to it. Caller must then initialize @@ -565,7 +566,7 @@ pub fn HashMap( } /// Inserts a new `Entry` into the hash map, returning the previous one, if any. - /// If insertion happuns, asserts there is enough capacity without allocating. + /// If insertion happens, asserts there is enough capacity without allocating. pub fn fetchPutAssumeCapacity(self: *Self, key: K, value: V) ?KV { return self.unmanaged.fetchPutAssumeCapacityContext(key, value, self.ctx); } @@ -684,7 +685,7 @@ pub fn HashMap( } /// A HashMap based on open addressing and linear probing. -/// A lookup or modification typically occurs only 2 cache misses. +/// A lookup or modification typically incurs only 2 cache misses. /// No order is guaranteed and any modification invalidates live iterators. /// It achieves good performance with quite high load factors (by default, /// grow is triggered at 80% full) and only one byte of overhead per element. diff --git a/lib/std/http.zig b/lib/std/http.zig index 12dc4b89cdf108f7a950f1b40da3e0290a81a962..532e5a6de8b0067dfed9f8dfde86041221611fc0 100644 --- a/lib/std/http.zig +++ b/lib/std/http.zig @@ -14,7 +14,9 @@ pub const Version = enum { }; /// https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods +/// /// https://datatracker.ietf.org/doc/html/rfc7231#section-4 Initial definition +/// /// https://datatracker.ietf.org/doc/html/rfc5789#section-2 PATCH pub const Method = enum(u64) { // TODO: should be u192 or u256, but neither is supported by the C backend, and therefore cannot pass CI GET = parse("GET"), @@ -68,7 +70,9 @@ pub const Method = enum(u64) { // TODO: should be u192 or u256, but neither is s } /// An HTTP method is safe if it doesn't alter the state of the server. + /// /// https://developer.mozilla.org/en-US/docs/Glossary/Safe/HTTP + /// /// https://datatracker.ietf.org/doc/html/rfc7231#section-4.2.1 pub fn safe(self: Method) bool { return switch (self) { @@ -79,7 +83,9 @@ pub const Method = enum(u64) { // TODO: should be u192 or u256, but neither is s } /// An HTTP method is idempotent if an identical request can be made once or several times in a row with the same effect while leaving the server in the same state. + /// /// https://developer.mozilla.org/en-US/docs/Glossary/Idempotent + /// /// https://datatracker.ietf.org/doc/html/rfc7231#section-4.2.2 pub fn idempotent(self: Method) bool { return switch (self) { @@ -90,7 +96,9 @@ pub const Method = enum(u64) { // TODO: should be u192 or u256, but neither is s } /// A cacheable response is an HTTP response that can be cached, that is stored to be retrieved and used later, saving a new request to the server. + /// /// https://developer.mozilla.org/en-US/docs/Glossary/cacheable + /// /// https://datatracker.ietf.org/doc/html/rfc7231#section-4.2.3 pub fn cacheable(self: Method) bool { return switch (self) { diff --git a/lib/std/http/Headers.zig b/lib/std/http/Headers.zig index b4c722119ae7b76b9a595fc6f402fc81f8bd23c0..f69f7fef5f5364281edceac627f0cb06eaad554c 100644 --- a/lib/std/http/Headers.zig +++ b/lib/std/http/Headers.zig @@ -249,7 +249,7 @@ pub const Headers = struct { try out_stream.writeAll("\r\n"); } - /// Frees all `HeaderIndexList`s within `index` + /// Frees all `HeaderIndexList`s within `index`. /// Frees names and values of all fields if they are owned. fn deallocateIndexListsAndFields(headers: *Headers) void { var it = headers.index.iterator(); diff --git a/lib/std/io/limited_reader.zig b/lib/std/io/limited_reader.zig index 09d76007da0de6296d78d48208c03279931abfec..d7e2503881393dba562f0e2871f6f3cd8ebffd47 100644 --- a/lib/std/io/limited_reader.zig +++ b/lib/std/io/limited_reader.zig @@ -26,7 +26,7 @@ pub fn LimitedReader(comptime ReaderType: type) type { }; } -/// Returns an initialised `LimitedReader` +/// Returns an initialised `LimitedReader`. /// `bytes_left` is a `u64` to be able to take 64 bit file offsets pub fn limitedReader(inner_reader: anytype, bytes_left: u64) LimitedReader(@TypeOf(inner_reader)) { return .{ .inner_reader = inner_reader, .bytes_left = bytes_left }; diff --git a/lib/std/math/big/int.zig b/lib/std/math/big/int.zig index 93c21f021699d91690e445622576d784c9419acd..a761151e7b5edebb201548035c95a17c17450dcb 100644 --- a/lib/std/math/big/int.zig +++ b/lib/std/math/big/int.zig @@ -452,6 +452,7 @@ pub const Mutable = struct { } /// r = a + b + /// /// r, a and b may be aliases. /// /// Asserts the result fits in `r`. An upper bound on the number of limbs needed by @@ -1869,7 +1870,7 @@ pub const Mutable = struct { } } - /// Read the value of `x` from `buffer` + /// Read the value of `x` from `buffer`. /// Asserts that `buffer` is large enough to contain a value of bit-size `bit_count`. /// /// The contents of `buffer` are interpreted as if they were the contents of diff --git a/lib/std/math/big/rational.zig b/lib/std/math/big/rational.zig index 2e52fae9d3507dbf863930c703c94d3648c60c32..ee641adf5078980707d2e0905a33be54444b033c 100644 --- a/lib/std/math/big/rational.zig +++ b/lib/std/math/big/rational.zig @@ -333,8 +333,8 @@ pub const Rational = struct { r.q.swap(&other.q); } - /// Returns math.Order.lt, math.Order.eq, math.Order.gt if a < b, a == b or a - /// > b respectively. + /// Returns math.Order.lt, math.Order.eq, math.Order.gt if a < b, a == b or + /// a > b respectively. pub fn order(a: Rational, b: Rational) !math.Order { return cmpInternal(a, b, false); } diff --git a/lib/std/rand/ziggurat.zig b/lib/std/rand/ziggurat.zig index 64417c1f3f798e2c662f9cb77cbff48333ed2fba..87045e4077b29395c00633d91789f054f383f33a 100644 --- a/lib/std/rand/ziggurat.zig +++ b/lib/std/rand/ziggurat.zig @@ -1,7 +1,6 @@ -//! Implements ZIGNOR [1]. +//! Implements [ZIGNOR][1] (Jurgen A. Doornik, 2005, Nuffield College, Oxford). //! -//! [1]: Jurgen A. Doornik (2005). [*An Improved Ziggurat Method to Generate Normal Random Samples*] -//! (https://www.doornik.com/research/ziggurat.pdf). Nuffield College, Oxford. +//! [1]: https://www.doornik.com/research/ziggurat.pdf //! //! rust/rand used as a reference; //! diff --git a/lib/std/sort/block.zig b/lib/std/sort/block.zig index a61ea6e32603892d5c5585dff7a5bfec7fabd03f..fe6e62865327253714b52003f15d45e5dc3c73f8 100644 --- a/lib/std/sort/block.zig +++ b/lib/std/sort/block.zig @@ -95,7 +95,7 @@ const Pull = struct { /// O(1) memory (no allocator required). /// Sorts in ascending order with respect to the given `lessThan` function. /// -/// NOTE: the algorithm only work when the comparison is less-than or greater-than +/// NOTE: The algorithm only works when the comparison is less-than or greater-than. /// (See https://github.com/ziglang/zig/issues/8289) pub fn block( comptime T: type, diff --git a/lib/std/valgrind.zig b/lib/std/valgrind.zig index f42c56c1ccb86ca5228ebe266ca33730045e6ecb..43935fe37d50db64e46971ea0ec2601072387515 100644 --- a/lib/std/valgrind.zig +++ b/lib/std/valgrind.zig @@ -250,7 +250,7 @@ pub fn disableErrorReporting() void { doClientRequestStmt(.ChangeErrDisablement, 1, 0, 0, 0, 0); } -/// Re-enable error reporting, (see disableErrorReporting()) +/// Re-enable error reporting. (see disableErrorReporting()) pub fn enableErrorReporting() void { doClientRequestStmt(.ChangeErrDisablement, math.maxInt(usize), 0, 0, 0, 0); } diff --git a/lib/std/wasm.zig b/lib/std/wasm.zig index b02f72ed4c51fca8c2a4939352da2efdadf1d037..84095ea9a8d7d973b299b87c72df931279e9b73c 100644 --- a/lib/std/wasm.zig +++ b/lib/std/wasm.zig @@ -216,7 +216,7 @@ test "Wasm - opcodes" { try testing.expectEqual(@as(u16, 0xC4), i64_extend32_s); } -/// Opcodes that require a prefix `0xFC` +/// Opcodes that require a prefix `0xFC`. /// Each opcode represents a varuint32, meaning /// they are encoded as leb128 in binary. pub const MiscOpcode = enum(u32) { @@ -793,7 +793,7 @@ pub fn section(val: Section) u8 { return @intFromEnum(val); } -/// The kind of the type when importing or exporting to/from the host environment +/// The kind of the type when importing or exporting to/from the host environment. /// https://webassembly.github.io/spec/core/syntax/modules.html pub const ExternalKind = enum(u8) { function, -- 2.54.0