]> git.ipfire.org Git - thirdparty/tar.git/commit
Avoid need for base64_init and extra table
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 13 Aug 2024 15:35:24 +0000 (08:35 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 15 Aug 2024 06:25:46 +0000 (23:25 -0700)
commit43231ae554d0dacbcc32e2d0fe574c9d0e183258
treed2a53af4d528b7368f9bc44d9a50a739384c675a
parentb201a3742162adcb2cf1e9618c4c4f4db0d239ae
Avoid need for base64_init and extra table

Simplify the code by assuming C99 initializers.
* src/list.c (base_64_digits): Remove.
(base64_map): Now a constant.  Now has its (old value + 1) % 65,
as that’s the only easy portable way to do it with a static
initializer (even on platforms where CHAR_BIT != 8); all uses changed.
(base64_init): Remove; only use removed.
(from_header): Adjust to new values in base64_map.

* src/list.c (base_64_digits): Remove; no longer needed.
(base64_map): Now const, initialized statically, and with
invalid entries being 0 not 64, and with valid entries
being 1 greater than before.
src/list.c