freebsd-src/lib/libc
rilysh bac2eea13a swab.c(libc): use a simplified version of byte swapping
This version of swab function simplifies the logic of swapping adjacent
bytes. Previous version of swab() used an arbitrary unrolling, which was
relevant back in the day but unnecessary for modern compilers, as if the
input size is known at compile time, they can do it automatically.

This version of swab() is inspired by musl.
A similar version can be found at: https://github.com/openbsd/src/blob/master/lib/libc/string/swab.c

Signed-off-by: rilysh <nightquick@proton.me>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1086
2024-04-22 23:01:54 -06:00
..
aarch64 libc/aarch64: Add a non-trivial getcontextx 2024-03-21 10:13:24 +00:00
amd64 lib{c,sys}: return wrapped syscall APIs to libc 2024-03-13 18:36:02 +00:00
arm libc/arm: export __signalcontext not _signalcontext 2024-04-16 22:14:21 +01:00
capability capsicum: introduce cap_rights_is_empty Function 2023-12-11 12:15:46 +01:00
compat-43 libsys: move __libsys_interposer consumers 2024-02-05 20:34:55 +00:00
csu libc: Purge unneeded cdefs.h 2023-11-01 16:44:30 -06:00
db libc: don't try to export mpool_stat 2024-04-16 22:14:20 +01:00
gdtoa libc: Remove empty comments in Symbol.map 2023-11-15 17:51:03 +00:00
gen libc: INTERPOS_SYS macro for interposed syscalls 2024-04-16 17:48:08 +01:00
gmon libc: don't try to export mexitcount 2024-04-16 22:14:20 +01:00
i386 lib{c,sys}: return wrapped syscall APIs to libc 2024-03-13 18:36:02 +00:00
iconv libc/iconv: don't export nonexistant symbols 2024-03-07 20:12:22 +00:00
include libc: INTERPOS_SYS macro for interposed syscalls 2024-04-16 17:48:08 +01:00
inet libc(inet_net_pton.c): fix "Fiery" spelling 2024-04-12 16:34:51 -06:00
isc lib: Remove ancient SCCS tags. 2023-11-26 22:23:28 -07:00
locale libc(localeconv.c): fix "appropriate" spelling 2024-04-12 16:34:51 -06:00
md Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
nameser lib: Remove ancient SCCS tags. 2023-11-26 22:23:28 -07:00
net libc: don't try to export _nsdbtdump 2024-04-16 22:14:20 +01:00
nls libc: Remove empty comments in Symbol.map 2023-11-15 17:51:03 +00:00
posix1e acl_to_text: include sys/param.h for MAXLOGNAME 2024-04-15 21:35:41 +01:00
powerpc libc/softfloat: we don't export _fp[gs]et* symbols 2024-03-13 20:35:41 +00:00
powerpc64 libc/softfloat: we don't export _fp[gs]et* symbols 2024-03-13 20:35:41 +00:00
powerpcspe libc/softfloat: we don't export _fp[gs]et* symbols 2024-03-13 20:35:41 +00:00
quad libc/quad: further narrow list of i386 symbols 2024-04-19 22:56:13 +01:00
regex regex: fix freeing g->charjump in low memory condition 2024-02-02 11:51:54 -07:00
resolv lib: Remove ancient SCCS tags. 2023-11-26 22:23:28 -07:00
riscv riscv: remove more riscv64sf support 2024-03-21 23:48:37 +00:00
rpc rpc: Fix typo in comment 2024-02-13 14:20:45 +08:00
secure libc: Remove empty comments in Symbol.map 2023-11-15 17:51:03 +00:00
softfloat libc/softfloat: we don't export _fp[gs]et* symbols 2024-03-13 20:35:41 +00:00
stdio libc: don't try to export __sF 2024-04-16 22:14:20 +01:00
stdlib libc: Remove support for pre-C99 C standards 2024-04-12 12:05:09 -07:00
stdtime libc: Improve description of mktime() / timegm(). 2024-03-27 11:03:37 +01:00
string swab.c(libc): use a simplified version of byte swapping 2024-04-22 23:01:54 -06:00
sys Revert "lib{c,sys}: normalize export of openat, setcontext, and swapcontext" 2024-04-19 22:25:04 +01:00
tests pkgbase: install all libc test files into the tests package 2024-03-20 17:13:56 +01:00
uuid libc: Remove empty comments in Symbol.map 2023-11-15 17:51:03 +00:00
x86/gen libc: Move per-arch sys/Makefile.inc to libsys 2024-02-05 20:34:55 +00:00
xdr libc(xdr_reference.c): fix "referenced" spelling 2024-04-12 16:34:53 -06:00
yp libc: Specify parameter types for function pointer 2024-02-03 20:08:59 -05:00
libc.ldscript Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:29 -06:00
libc_nossp.ldscript Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:29 -06:00
Makefile lib{c,sys}: return wrapped syscall APIs to libc 2024-03-13 18:36:02 +00:00
Makefile.depend dirdeps: Update/fix Makefile.depend* for toolchain 2023-11-26 20:50:13 -05:00
Makefile.depend.options Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
Versions.def Create namespace for the symbols added during 15-CURRENT cycle 2023-09-22 10:16:29 +02:00