bswap.3: bswap_*() are implemented using functions

See <bits/byteswap.h> in glibc.
These macros call functions of the form __bswap_N(),
which use uintN_t.

Even though it's true that they are macros,
it's transparent to the user.

The user will see their results casted to unsigned types
after the conversion due to the underlying functions,
so it's better to document these as the underlying functions,
specifying the types.

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Alejandro Colomar 2021-05-09 23:39:23 +02:00 committed by Michael Kerrisk
parent 5175f162a3
commit 58d7a46ccb
1 changed files with 7 additions and 7 deletions

View File

@ -29,19 +29,19 @@ bswap_16, bswap_32, bswap_64 \- reverse order of bytes
.nf
.B #include <byteswap.h>
.PP
.BI bswap_16( x );
.BI bswap_32( x );
.BI bswap_64( x );
.BI "uint16_t bswap_16(uint16_t " x );
.BI "uint32_t bswap_32(uint32_t " x );
.BI "uint64_t bswap_64(uint64_t " x );
.fi
.SH DESCRIPTION
These macros return a value in which the order of the bytes
These functions return a value in which the order of the bytes
in their 2-, 4-, or 8-byte arguments is reversed.
.SH RETURN VALUE
These macros return the value of their argument with the bytes reversed.
These functions return the value of their argument with the bytes reversed.
.SH ERRORS
These macros always succeed.
These functions always succeed.
.SH CONFORMING TO
These macros are GNU extensions.
These functions are GNU extensions.
.SH EXAMPLES
The program below swaps the bytes of the 8-byte integer supplied as
its command-line argument.