]> git.ipfire.org Git - thirdparty/coreutils.git/commit
dd: simplify conv=swab code
authorPaul Eggert <eggert@cs.ucla.edu>
Wed, 19 Jan 2022 18:51:25 +0000 (10:51 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 27 Jan 2022 21:04:14 +0000 (13:04 -0800)
commitf19bc026b356fc52186322042b563c01bef0d98f
tree76e7f5ffce4e517e081e692e5d4a2829631f585a
parente94d95075dd919e5e6ec0c8ed09477e58b863788
dd: simplify conv=swab code

Simplify byte-swapping, so that the code no longer needs to
allocate a page before the input buffer.
* src/dd.c (SWAB_ALIGN_OFFSET, char_is_saved, saved_char): Remove.
All uses removed.
(INPUT_BLOCK_SLOP): Simplify to just page_size.
(alloc_ibuf, dd_copy): Adjust to new swab_buffer API.
(swab_buffer): New arg SAVED_BYTE, taking the place of the old
global variables.  Do not access BUF[-1].
src/dd.c