HardenedBSD/lib
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
..
atf
clang
csu
flua
geom
googletest
lib9p
lib80211
libalias
libarchive
libauditd
libbe
libbearssl
libbegemot
libblacklist
libblocksruntime
libbluetooth
libbsddialog
libbsdstat
libbsm
libbsnmp
libbz2
libc
libc_nonshared
libc++
libc++experimental
libcalendar
libcam
libcapsicum
libcasper
libcbor
libclang_rt
libcom_err
libcompat
libcompiler_rt
libcrypt
libcuse
libcxxrt
libdevctl
libdevdctl
libdevinfo
libdevstat
libdiff
libdl
libdpv
libdwarf
libedit
libefivar
libelf
libelftc
libevent1
libexecinfo
libexpat
libfdt
libfetch
libfido2
libfigpar
libgcc_eh
libgcc_s
libgeom
libgpio
libgssapi
libiconv_modules
libifconfig
libipsec
libipt
libiscsiutil
libjail
libkiconv
libkvm
libldns
liblua
liblutok
liblzma
libmagic
libmd
libmemstat
libmilter
libmixer
libmp
libmt
libnetbsd
libnetgraph
libnetmap
libnv
libomp
libopenbsd
libopencsd
libpam
libpathconv
libpcap
libpe
libpfctl
libpjdlog
libpmc
libpmcstat
libproc
libprocstat
libradius
libregex
librpcsec_gss
librpcsvc
librss
librt
librtld_db
libsbuf
libsdp
libsecureboot
libsm
libsmb
libsmdb
libsmutil
libsqlite3
libssp
libssp_nonshared
libstats
libstdbuf
libstdthreads
libsys
libsysdecode
libtacplus
libtelnet
libthr
libthread_db
libucl
libufs
libugidfw
libulog
libunbound
libusb
libusbhid
libutil
libveriexec
libvgl
libvmmapi
libwrap
libxo
liby
libypclnt
libz
libzstd
msun
ncurses
nss_tacplus
ofed
tests
Makefile
Makefile.inc