From 246a39c10e94653d9d0f15971fb9c2e52fe8e1d1 Mon Sep 17 00:00:00 2001 From: John Simon Date: Fri, 23 Sep 2022 05:08:30 -0400 Subject: [PATCH] langref: remove uses of old function pointer syntax --- doc/langref.html.in | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/doc/langref.html.in b/doc/langref.html.in index 02e1dc4273..faca835d28 100644 --- a/doc/langref.html.in +++ b/doc/langref.html.in @@ -7840,9 +7840,8 @@ fn readFile(allocator: Allocator, filename: []const u8) ![]u8 { {#header_open|@alignCast#}
{#syntax#}@alignCast(comptime alignment: u29, ptr: anytype) anytype{#endsyntax#}

- {#syntax#}ptr{#endsyntax#} can be {#syntax#}*T{#endsyntax#}, {#syntax#}fn(){#endsyntax#}, {#syntax#}?*T{#endsyntax#}, - {#syntax#}?fn(){#endsyntax#}, or {#syntax#}[]T{#endsyntax#}. It returns the same type as {#syntax#}ptr{#endsyntax#} - except with the alignment adjusted to the new value. + {#syntax#}ptr{#endsyntax#} can be {#syntax#}*T{#endsyntax#}, {#syntax#}?*T{#endsyntax#}, or {#syntax#}[]T{#endsyntax#}. + It returns the same type as {#syntax#}ptr{#endsyntax#} except with the alignment adjusted to the new value.

A {#link|pointer alignment safety check|Incorrect Pointer Alignment#} is added to the generated code to make sure the pointer is aligned as promised.

@@ -9066,14 +9065,9 @@ pub const PrefetchOptions = struct { {#header_open|@ptrToInt#}
{#syntax#}@ptrToInt(value: anytype) usize{#endsyntax#}

- 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: + Converts {#syntax#}value{#endsyntax#} to a {#syntax#}usize{#endsyntax#} which is the address of the pointer. + {#syntax#}value{#endsyntax#} can be {#syntax#}*T{#endsyntax#} or {#syntax#}?*T{#endsyntax#}.

-

To convert the other way, use {#link|@intToPtr#}

{#header_close#}