authorgravatar for github@whatisaphone.comJohn Simon <github@whatisaphone.com> 2022-09-23 05:08:30-04:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2022-09-23 12:08:30+03:00
log246a39c10e94653d9d0f15971fb9c2e52fe8e1d1
tree2538cba0ccd023fc39ebdf5674afa662e1811cf7
parentdab5bb9247b5e3454a221d62e3fe6f9580d5ab0b
signaturebadge-question-mark Signed by PGP key 4AEE18F83AFDEB23

langref: remove uses of old function pointer syntax


1 files changed, 4 insertions(+), 10 deletions(-)

doc/langref.html.in+4-10
......@@ -7840,9 +7840,8 @@ fn readFile(allocator: Allocator, filename: []const u8) ![]u8 {
78407840 {#header_open|@alignCast#}
78417841 <pre>{#syntax#}@alignCast(comptime alignment: u29, ptr: anytype) anytype{#endsyntax#}</pre>
78427842 <p>
7843 {#syntax#}ptr{#endsyntax#} can be {#syntax#}*T{#endsyntax#}, {#syntax#}fn(){#endsyntax#}, {#syntax#}?*T{#endsyntax#},
7844 {#syntax#}?fn(){#endsyntax#}, or {#syntax#}[]T{#endsyntax#}. It returns the same type as {#syntax#}ptr{#endsyntax#}
7845 except with the alignment adjusted to the new value.
7843 {#syntax#}ptr{#endsyntax#} can be {#syntax#}*T{#endsyntax#}, {#syntax#}?*T{#endsyntax#}, or {#syntax#}[]T{#endsyntax#}.
7844 It returns the same type as {#syntax#}ptr{#endsyntax#} except with the alignment adjusted to the new value.
78467845 </p>
78477846 <p>A {#link|pointer alignment safety check|Incorrect Pointer Alignment#} is added
78487847 to the generated code to make sure the pointer is aligned as promised.</p>
......@@ -9066,14 +9065,9 @@ pub const PrefetchOptions = struct {
90669065 {#header_open|@ptrToInt#}
90679066 <pre>{#syntax#}@ptrToInt(value: anytype) usize{#endsyntax#}</pre>
90689067 <p>
9069 Converts {#syntax#}value{#endsyntax#} to a {#syntax#}usize{#endsyntax#} which is the address of the pointer. {#syntax#}value{#endsyntax#} can be one of these types:
9068 Converts {#syntax#}value{#endsyntax#} to a {#syntax#}usize{#endsyntax#} which is the address of the pointer.
9069 {#syntax#}value{#endsyntax#} can be {#syntax#}*T{#endsyntax#} or {#syntax#}?*T{#endsyntax#}.
90709070 </p>
9071 <ul>
9072 <li>{#syntax#}*T{#endsyntax#}</li>
9073 <li>{#syntax#}?*T{#endsyntax#}</li>
9074 <li>{#syntax#}fn(){#endsyntax#}</li>
9075 <li>{#syntax#}?fn(){#endsyntax#}</li>
9076 </ul>
90779071 <p>To convert the other way, use {#link|@intToPtr#}</p>
90789072
90799073 {#header_close#}