commit 238b4e5458b4bd2cadefb768b8ea7c6b70a191ac
Author: Jia Tan <jiat0218@gmail.com>
Date:   2023-05-04 20:38:52 +0800

    Translations: Update the Croatian translation.

 po/hr.po | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

commit 0cee63c3c6c4f9084a5e7fa7c15a1863ac8e5ffc
Author: Jia Tan <jiat0218@gmail.com>
Date:   2023-05-04 19:50:42 +0800

    Bump version and soname for 5.4.3.

 src/liblzma/Makefile.am        | 2 +-
 src/liblzma/api/lzma/version.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

commit 01f937ea9a49005c5091c0165fa0c1e572dd1749
Author: Jia Tan <jiat0218@gmail.com>
Date:   2023-05-02 20:39:56 +0800

    Add NEWS for 5.4.3.

 NEWS | 10 ++++++++++
 1 file changed, 10 insertions(+)

commit e9b9ea953179502d5245b4e6ca4f5ffe9d5797b1
Author: Lasse Collin <lasse.collin@tukaani.org>
Date:   2023-05-03 22:46:42 +0300

    tuklib_integer.h: Fix a recent copypaste error in Clang detection.
    
    Wrong line was changed in 7062348bf35c1e4cbfee00ad9fffb4a21aa6eff7.
    Also, this has >= instead of == since ints larger than 32 bits would
    work too even if not relevant in practice.

 src/common/tuklib_integer.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

commit be6e39a8622f0d905072874ec25b1ffd155b12e1
Author: Jia Tan <jiat0218@gmail.com>
Date:   2023-04-20 20:15:00 +0800

    Update THANKS.

 THANKS | 1 +
 1 file changed, 1 insertion(+)

commit 9e343a46cf87a345799222c0b0b3a6f3358dde0c
Author: Jia Tan <jiat0218@gmail.com>
Date:   2023-04-19 22:22:16 +0800

    Windows: Include <intrin.h> when needed.
    
    Legacy Windows did not need to #include <intrin.h> to use the MSVC
    intrinsics. Newer versions likely just issue a warning, but the MSVC
    documentation says to include the header file for the intrinsics we use.
    
    GCC and Clang can "pretend" to be MSVC on Windows, so extra checks are
    needed in tuklib_integer.h to only include <intrin.h> when it will is
    actually needed.

 src/common/tuklib_integer.h    |  6 ++++++
 src/liblzma/common/memcmplen.h | 10 ++++++++++
 2 files changed, 16 insertions(+)

commit 12321a9390acc076b414035a46df9d7545ac379f
Author: Jia Tan <jiat0218@gmail.com>
Date:   2023-04-19 21:59:03 +0800

    tuklib_integer: Use __builtin_clz() with Clang.
    
    Clang has support for __builtin_clz(), but previously Clang would
    fallback to either the MSVC intrinsic or the regular C code. This was
    discovered due to a bug where a new version of Clang required the
    <intrin.h> header file in order to use the MSVC intrinsics.
    
    Thanks to Anton Kochkov for notifying us about the bug.

 src/common/tuklib_integer.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

commit d1f0e01c395960efd6c29ff144eda4f4c8c1c6d3
Author: Lasse Collin <lasse.collin@tukaani.org>
Date:   2023-04-14 18:42:33 +0300

    liblzma: Update project maintainers in lzma.h.
    
    AUTHORS was updated earlier, lzma.h was simply forgotten.

 src/liblzma/api/lzma.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

commit 8204c5d1304e1e3b7487801b4acaf8e3179a6c52
Author: Jia Tan <jiat0218@gmail.com>
Date:   2023-04-13 20:45:19 +0800

    liblzma: Cleans up old commented out code.

 src/liblzma/common/alone_encoder.c | 11 -----------
 1 file changed, 11 deletions(-)

commit 32980d1562bc031013306be1c787761fa63da87d
Author: Jia Tan <jiat0218@gmail.com>
Date:   2023-03-28 22:32:40 +0800

    CMake: Update liblzma-config.cmake generation.
    
    Now that the threading is configurable, the liblzma CMake package only
    needs the threading library when using POSIX threads.

 CMakeLists.txt | 33 ++++++++++++++++++++++-----------
 1 file changed, 22 insertions(+), 11 deletions(-)

commit 023907faa965476fb921a6344253c50e0ba795f9
Author: Jia Tan <jiat0218@gmail.com>
Date:   2023-03-28 22:25:33 +0800

    CMake: Allows setting thread method.
    
    The thread method is now configurable for the CMake build. It matches
    the Autotools build by allowing ON (pick the best threading method),
    OFF (no threading), posix, win95, and vista. If both Windows and
    posix threading are both available, then ON will choose Windows
    threading. Windows threading will also not use:
    
    target_link_libraries(liblzma Threads::Threads)
    
    since on systems like MinGW-w64 it would link the posix threads
    without purpose.

 CMakeLists.txt | 144 +++++++++++++++++++++++++++++++++++++++++----------------
 1 file changed, 104 insertions(+), 40 deletions(-)

commit ba176d77cbb164b13006516660fc1ff6c59dedb5
Author: Jia Tan <jiat0218@gmail.com>
Date:   2023-03-24 20:05:59 +0800

    CMake: Only build xzdec if decoders are enabled.

 CMakeLists.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

commit c99d697df800e9bc47e09facf88bcfdb9e0264a5
Author: Jia Tan <jiat0218@gmail.com>
Date:   2023-03-22 15:42:04 +0800

    Build: Removes redundant check for LZMA1 filter support.

 src/liblzma/lzma/Makefile.inc | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

commit 54a2fd8c850e626343b79c4cc8fcac2f638ec890
Author: Lasse Collin <lasse.collin@tukaani.org>
Date:   2023-03-23 15:14:29 +0200

    CMake: Bump maximum policy version to 3.26.
    
    It adds only one new policy related to FOLDERS which we don't use.
    This makes it clear that the code is compatible with the policies
    up to 3.26.

 CMakeLists.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

commit 622d0fdc02d5f565c2872d79bc70c669c95c8284
Author: Jia Tan <jiat0218@gmail.com>
Date:   2023-03-21 23:36:00 +0800

    CMake: Conditionally build xz list.* files if decoders are enabled.

 CMakeLists.txt | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

commit 3e2dc523c596cd770a6a7c58cacc0d0d8761e853
Author: Jia Tan <jiat0218@gmail.com>
Date:   2023-02-25 11:46:50 +0800

    CMake: Allow configuring features as cache variables.
    
    This allows users to change the features they build either in
    CMakeCache.txt or by using a CMake GUI. The sources built for
    liblzma are affected by this too, so only the necessary files
    will be compiled.

 CMakeLists.txt | 528 ++++++++++++++++++++++++++++++++++++++++++---------------
 1 file changed, 391 insertions(+), 137 deletions(-)

commit 0c053f97337fa4ead77acefb577e8e86f8ef388d
Author: Lasse Collin <lasse.collin@tukaani.org>
Date:   2023-03-21 14:07:51 +0200

    Build: Add a comment that AC_PROG_CC_C99 is needed for Autoconf 2.69.
    
    It's obsolete in Autoconf >= 2.70 and just an alias for AC_PROG_CC
    but Autoconf 2.69 requires AC_PROG_CC_C99 to get a C99 compiler.

 configure.ac | 3 +++
 1 file changed, 3 insertions(+)

commit 915d4f6058d52f84d2b58b0a5f3c8272eaa6c1bd
Author: Lasse Collin <lasse.collin@tukaani.org>
Date:   2023-03-21 14:04:37 +0200

    Build: configure.ac: Use AS_IF and AS_CASE where required.
    
    This makes no functional difference in the generated configure
    (at least with the Autotools versions I have installed) but this
    change might prevent future bugs like the one that was just
    fixed in the commit 5a5bd7f871818029d5ccbe189f087f591258c294.

 configure.ac | 30 +++++++++++++++---------------
 1 file changed, 15 insertions(+), 15 deletions(-)

commit b848c039586ed2cddb6fb033680dac107cc5143f
Author: Lasse Collin <lasse.collin@tukaani.org>
Date:   2023-03-21 13:12:03 +0200

    Update THANKS.

 THANKS | 1 +
 1 file changed, 1 insertion(+)

commit c775ba1602a74f29dbc2088bbe4d02c23fc32ba1
Author: Lasse Collin <lasse.collin@tukaani.org>
Date:   2023-03-21 13:11:49 +0200

    Build: Fix --disable-threads breaking the building of shared libs.
    
    This is broken in the releases 5.2.6 to 5.4.2. A workaround
    for these releases is to pass EGREP='grep -E' as an argument
    to configure in addition to --disable-threads.
    
    The problem appeared when m4/ax_pthread.m4 was updated in
    the commit 6629ed929cc7d45a11e385f357ab58ec15e7e4ad which
    introduced the use of AC_EGREP_CPP. AC_EGREP_CPP calls
    AC_REQUIRE([AC_PROG_EGREP]) to set the shell variable EGREP
    but this was only executed if POSIX threads were enabled.
    Libtool code also has AC_REQUIRE([AC_PROG_EGREP]) but Autoconf
    omits it as AC_PROG_EGREP has already been required earlier.
    Thus, if not using POSIX threads, the shell variable EGREP
    would be undefined in the Libtool code in configure.
    
    ax_pthread.m4 is fine. The bug was in configure.ac which called
    AX_PTHREAD conditionally in an incorrect way. Using AS_CASE
    ensures that all AC_REQUIREs get always run.
    
    Thanks to Frank Busse for reporting the bug.
    Fixes: https://github.com/tukaani-project/xz/issues/45

 configure.ac | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

commit 0673c9ec98b6bae12b33dc295564514aaa26e2fc
Author: Lasse Collin <lasse.collin@tukaani.org>
Date:   2023-03-19 22:45:59 +0200

    liblzma: Silence -Wsign-conversion in SSE2 code in memcmplen.h.
    
    Thanks to Christian Hesse for reporting the issue.
    Fixes: https://github.com/tukaani-project/xz/issues/44

 src/liblzma/common/memcmplen.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

commit 6ca8046ecbc7a1c81ee08f544bfd1414819fb2e8
Author: Jia Tan <jiat0218@gmail.com>
Date:   2023-03-18 23:22:06 +0800

    Bump version and soname for 5.4.2.

 src/liblzma/Makefile.am        | 2 +-
 src/liblzma/api/lzma/version.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

commit ce4f246600db10e77fc93d492ea045b4c9830bc6
Author: Jia Tan <jiat0218@gmail.com>
Date:   2023-03-18 22:10:57 +0800

    Add NEWS for 5.4.2.

 NEWS | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 48 insertions(+)

commit 3634fe330788fc0df217acdb6581031a851600a3
Author: Lasse Collin <lasse.collin@tukaani.org>
Date:   2023-03-18 16:00:54 +0200

    Update the copy of GNU GPLv3 from gnu.org to COPYING.GPLv3.

 COPYING.GPLv3 | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

commit 97679d25ce7cb014328f1455bb338903c003d54f
Author: Lasse Collin <lasse.collin@tukaani.org>
Date:   2023-03-18 15:51:57 +0200

    Change a few HTTP URLs to HTTPS.
    
    The xz man page timestamp was intentionally left unchanged.

 INSTALL                    |  2 +-
 README                     |  8 ++++----
 configure.ac               |  2 +-
 dos/INSTALL.txt            |  4 ++--
 src/liblzma/api/lzma.h     |  8 ++++----
 src/liblzma/check/sha256.c |  2 +-
 src/xz/xz.1                |  2 +-
 windows/INSTALL-MinGW.txt  | 10 +++++-----
 8 files changed, 19 insertions(+), 19 deletions(-)

commit 01a67e89a56c3ebf5f6681bd06f0edc22a1ae594
Author: Jia Tan <jiat0218@gmail.com>
Date:   2023-03-18 00:40:28 +0800

    CMake: Fix typo in a comment.

 CMakeLists.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

commit 5dca3f5cbab31105196c89cd6df0a9bbc3307c05
Author: Lasse Collin <lasse.collin@tukaani.org>
Date:   2023-03-17 18:36:22 +0200

    Windows: build.bash: Copy liblzma API docs to the output package.

 windows/build.bash | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

commit ae252862b30b509ab88b2bbcaa08e8d51b57e928
Author: Lasse Collin <lasse.collin@tukaani.org>
Date:   2023-03-17 08:53:38 +0200

    Windows: Add microlzma_*.c to the VS project files.
    
    These should have been included in 5.3.2alpha already.

 windows/vs2013/liblzma.vcxproj     | 2 ++
 windows/vs2013/liblzma_dll.vcxproj | 2 ++
 windows/vs2017/liblzma.vcxproj     | 2 ++
 windows/vs2017/liblzma_dll.vcxproj | 2 ++
 windows/vs2019/liblzma.vcxproj     | 2 ++
 windows/vs2019/liblzma_dll.vcxproj | 2 ++
 6 files changed, 12 insertions(+)

commit 147d282cc3733e2723df82622b6540ddfb52635e
Author: Lasse Collin <lasse.collin@tukaani.org>
Date:   2023-03-17 08:43:51 +0200

    CMake: Add microlzma_*.c to the build.
    
    These should have been included in 5.3.2alpha already.

 CMakeLists.txt | 2 ++
 1 file changed, 2 insertions(+)

commit 4523a5ee29f45c0256af67a15771bc8bbd25ba53
Author: Lasse Collin <lasse.collin@tukaani.org>
Date:   2023-03-17 08:41:36 +0200

    Build: Update comments about unaligned access to mention 64-bit.

 cmake/tuklib_integer.cmake | 7 +++----
 m4/tuklib_integer.m4       | 4 ++--
 2 files changed, 5 insertions(+), 6 deletions(-)

commit 82aacb40367dc580b09c5a7b270f6c98b63e49b9
Author: Lasse Collin <lasse.collin@tukaani.org>
Date:   2023-03-17 00:02:30 +0200

    Tests: Update .gitignore.

 .gitignore | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

commit 5d022c24921eec938604a8cb10d70aa08dbd8575
Author: Lasse Collin <lasse.collin@tukaani.org>
Date:   2023-03-14 20:04:03 +0200

    po4a/update-po: Display the script name consistently in error messages.

 po4a/update-po | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

commit 896295117324f323c0b8db6a31ad6ebfaa88793d
Author: Jia Tan <jiat0218@gmail.com>
Date:   2023-03-17 01:30:36 +0800

    Doc: Rename Doxygen HTML doc directory name liblzma => api.
    
    When the docs are installed, calling the directory "liblzma" is
    confusing since multiple other files in the doc directory are for
    liblzma. This should also make it more natural for distros when they
    package the documentation.

 .gitignore             |  2 +-
 Makefile.am            | 18 +++++++++---------
 PACKAGERS              |  4 ++--
 doxygen/Doxyfile       |  2 +-
 doxygen/update-doxygen | 18 +++++++++---------
 5 files changed, 22 insertions(+), 22 deletions(-)

commit 94097157fae308b2c1a5edb4e8597c68b45eeaea
Author: Jia Tan <jiat0218@gmail.com>
Date:   2023-03-16 22:07:15 +0800

    liblzma: Remove note from lzma_options_bcj about the ARM64 exception.
    
    This was left in by mistake since an early version of the ARM64 filter
    used a different struct for its options.

 src/liblzma/api/lzma/bcj.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

commit da16d0b73b79d7785ece6f78a577fadd1fb59d0e
Author: Lasse Collin <lasse.collin@tukaani.org>
Date:   2023-03-15 19:19:13 +0200

    COPYING: Add a note about the included Doxygen-generated HTML.

 COPYING | 11 +++++++++++
 1 file changed, 11 insertions(+)

commit e57c74f9ef19201f72c106f2c347596f40229936
Author: Jia Tan <jiat0218@gmail.com>
Date:   2023-03-16 21:41:09 +0800

    Doc: Update PACKAGERS with details about liblzma API docs install.

 PACKAGERS | 22 ++++++++++++++++------
 1 file changed, 16 insertions(+), 6 deletions(-)

commit 7e2fa48bb73edb25457232e2e62a4f81c6b95281
Author: Jia Tan <jiat0218@gmail.com>
Date:   2023-03-16 21:38:32 +0800

    liblzma: Add set lzma.h as the main page for Doxygen documentation.
    
    The \mainpage command is used in the first block of comments in lzma.h.
    This changes the previously nearly empty index.html to use the first
    comment block in lzma.h for its contents.
    
    lzma.h is no longer documented separately, but this is for the better
    since lzma.h only defined a few macros that users do not need to use.
    The individual API header files all have a disclaimer that they should
    not be #included directly, so there should be no confusion on the fact
    that lzma.h should be the only header used by applications.
    
    Additionally, the note "See ../lzma.h for information about liblzma as
    a whole." was removed since lzma.h is now the main page of the
    generated HTML and does not have its own page anymore. So it would be
    confusing in the HTML version and was only a "nice to have" when
    browsing the source files.

 src/liblzma/api/lzma.h              | 1 +
 src/liblzma/api/lzma/base.h         | 2 --
 src/liblzma/api/lzma/bcj.h          | 2 --
 src/liblzma/api/lzma/block.h        | 2 --
 src/liblzma/api/lzma/check.h        | 2 --
 src/liblzma/api/lzma/container.h    | 2 --
 src/liblzma/api/lzma/delta.h        | 2 --
 src/liblzma/api/lzma/filter.h       | 2 --
 src/liblzma/api/lzma/hardware.h     | 2 --
 src/liblzma/api/lzma/index.h        | 2 --
 src/liblzma/api/lzma/index_hash.h   | 4 +---
 src/liblzma/api/lzma/lzma12.h       | 2 --
 src/liblzma/api/lzma/stream_flags.h | 2 --
 src/liblzma/api/lzma/version.h      | 2 --
 src/liblzma/api/lzma/vli.h          | 2 --
 15 files changed, 2 insertions(+), 29 deletions(-)

commit d42977c7acfdf7fd9acc8803cf411eca7dc10478
Author: Jia Tan <jiat0218@gmail.com>
Date:   2023-03-16 21:37:32 +0800

    Build: Generate doxygen documentation in autogen.sh.
    
    Another command line option (--no-doxygen) was added to disable
    creating the doxygen documenation in cases where it not wanted or
    if the doxygen tool is not installed.

 autogen.sh | 35 +++++++++++++++++++++++++++++------
 1 file changed, 29 insertions(+), 6 deletions(-)

commit 8fc712fcf41d821069c670f22b8bf628e7a4a877
Author: Jia Tan <jiat0218@gmail.com>
Date:   2023-03-16 21:35:55 +0800

    Build: Create doxygen/update-doxygen script.
    
    This is a helper script to generate the Doxygen documentation. It can be
    run in 'liblzma' or 'internal' mode by setting the first argument. It
    will default to 'liblzma' mode and only generate documentation for the
    liblzma API header files.
    
    The helper script will be run during the custom mydist hook when we
    create releases. This hook already alters the source directory, so its
    fine to do it here too. This way, we can include the Doxygen generated
    files in the distrubtion and when installing.
    
    In 'liblzma' mode, the JavaScript is stripped from the .html files and
    the .js files are removed. This avoids license hassle from jQuery and
    other libraries that Doxygen 1.9.6 puts into jquery.js in minified form.

 Makefile.am            |   1 +
 doxygen/update-doxygen | 111 +++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 112 insertions(+)

commit 77d2c025d19fbac7277c63239cfb1338f02c66c0
Author: Jia Tan <jiat0218@gmail.com>
Date:   2023-03-16 21:34:36 +0800

    Build: Install Doxygen docs and include in distribution if generated.
    
    Added a install-data-local target to install the Doxygen documentation
    only when it has been generated. In order to correctly remove the docs,
    a corresponding uninstall-local target was added.
    
    If the doxygen docs exist in the source tree, they will also be included
    in the distribution now too.

 Makefile.am | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

commit 9af8f6f947a43974a4ff025f4c896f2fb4c91b4f
Author: Jia Tan <jiat0218@gmail.com>
Date:   2023-01-03 20:37:30 +0800

    Doxygen: Refactor Doxyfile.in to doxygen/Doxyfile.
    
    Instead of having Doxyfile.in configured by Autoconf, the Doxyfile
    can have the tags that need to be configured piped into the doxygen
    command through stdin with the overrides after Doxyfile's contents.
    
    Going forward, the documentation should be generated in two different
    modes: liblzma or internal.
    
    liblzma is useful for most users. It is the documentation for just
    the liblzma API header files. This is the default.
    
    internal is for people who want to understand how xz and liblzma work.
    It might be useful for people who want to contribute to the project.

 .gitignore       |    3 +-
 Doxyfile.in      | 1234 -------------------------
 Makefile.am      |    1 -
 configure.ac     |    1 -
 doxygen/Doxyfile | 2684 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 5 files changed, 2686 insertions(+), 1237 deletions(-)

commit 1c558a26928b753fcf1c0d4bce9c0643285edd86
Author: Jia Tan <jiat0218@gmail.com>
Date:   2023-02-28 23:22:36 +0800

    Tests: Remove unused macros and functions.

 tests/tests.h | 75 -----------------------------------------------------------
 1 file changed, 75 deletions(-)

commit 7479a69a45a1b8fdb9a209e11f247dce11ac1ba0
Author: Jia Tan <jiat0218@gmail.com>
Date:   2023-01-12 22:29:07 +0800

    Tests: Refactors existing lzma_index tests.
    
    Converts the existing lzma_index tests into tuktests and covers every
    API function from index.h except for lzma_file_info_decoder, which can
    be tested in the future.

 tests/test_index.c | 2036 ++++++++++++++++++++++++++++++++++++++--------------
 1 file changed, 1492 insertions(+), 544 deletions(-)

commit fd56d5353360279c10e8e5e05f5bc6ea03f64584
Author: Lasse Collin <lasse.collin@tukaani.org>
Date:   2023-03-07 19:59:23 +0200

    xz: Make Capsicum sandbox more strict with stdin and stdout.

 src/xz/file_io.c | 8 ++++++++
 1 file changed, 8 insertions(+)

commit d1bdaaebc68cae7f0ba457fa990b520df2186fd1
Author: Lasse Collin <lasse.collin@tukaani.org>
Date:   2023-03-11 19:31:40 +0200

    xz: Don't fail if Capsicum is enabled but kernel doesn't support it.
    
    (This commit combines related commits from the master branch.)
    
    If Capsicum support is missing from the kernel or xz is being run
    in an emulator that lacks Capsicum suport, the syscalls will fail
    and set errno to ENOSYS. Previously xz would display and error and
    exit, making xz unusable. Now it will check for ENOSYS and run
    without sandbox support. Other tools like ssh behave similarly.
    
    Displaying a warning for missing Capsicum support was considered
    but such extra output would quickly become annoying. It would also
    break test_scripts.sh in "make check".
    
    Also move cap_enter() to be the first step instead of the last one.
    This matches the example in the cap_rights_limit(2) man page. With
    the current code it shouldn't make any practical difference though.
    
    Thanks to Xin Li for the bug report, suggesting a fix, and testing:
    https://github.com/tukaani-project/xz/pull/43
    
    Thanks to Jia Tan for most of the original commits.

 src/xz/file_io.c | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

commit 5d351c69c19d212ddd2cf1f3bdb24900820c6776
Author: Jia Tan <jiat0218@gmail.com>
Date:   2023-02-04 21:06:35 +0800

    Build: Adjust CMake version search regex.
    
    Now, the LZMA_VERSION_MAJOR, LZMA_VERSION_MINOR, and LZMA_VERSION_PATCH
    macros do not need to be on consecutive lines in version.h. They can be
    separated by more whitespace, comments, or even other content, as long
    as they appear in the proper order (major, minor, patch).

 CMakeLists.txt | 2 ++
 1 file changed, 2 insertions(+)

commit b82d4831e3f2339c4cdbc47776c99462088c11b7
Author: Jia Tan <jiat0218@gmail.com>
Date:   2023-01-26 09:50:21 +0800

    liblzma: Improve documentation for version.h.
    
    Specified parameter and return values for API functions and documented
    a few more of the macros.

 src/liblzma/api/lzma/version.h | 29 ++++++++++++++++++++++-------
 1 file changed, 22 insertions(+), 7 deletions(-)

commit 2caba3efe3e0c2d7c6dca00e22c56812326a34e6
Author: Jia Tan <jiat0218@gmail.com>
Date:   2023-02-24 23:46:23 +0800

    liblzma: Clarify lzma_lzma_preset() documentation in lzma12.h.
    
    lzma_lzma_preset() does not guarentee that the lzma_options_lzma are
    usable in an encoder even if it returns false (success). If liblzma
    is built with default configurations, then the options will always be
    usable. However if the match finders hc3, hc4, or bt4 are disabled, then
    the options may not be usable depending on the preset level requested.
    
    The documentation was updated to reflect this complexity, since this
    behavior was unclear before.

 src/liblzma/api/lzma/lzma12.h | 5 +++++
 1 file changed, 5 insertions(+)

commit 594f904673ba55a833adfa60bbab6b60d4902d08
Author: Lasse Collin <lasse.collin@tukaani.org>
Date:   2023-02-27 18:38:35 +0200

    CMake: Require that the C compiler supports C99 or a newer standard.
    
    Thanks to autoantwort for reporting the issue and suggesting
    a different patch:
    https://github.com/tukaani-project/xz/pull/42

 CMakeLists.txt | 8 ++++++++
 1 file changed, 8 insertions(+)

commit 88101143cb774bca6b7006c8335b09dc3f334140
Author: Jia Tan <jiat0218@gmail.com>
Date:   2023-02-24 18:10:37 +0800

    Tests: Small tweak to test-vli.c.
    
    The static global variables can be disabled if encoders and decoders
    are not built. If they are not disabled and -Werror is used, it will
    cause an usused warning as an error.

 tests/test_vli.c | 2 ++
 1 file changed, 2 insertions(+)

commit 4042dbf03a06e019ccdd1e9d1b94cf613d62d5a9
Author: Jia Tan <jiat0218@gmail.com>
Date:   2023-02-06 21:46:43 +0800

    liblzma: Replace '\n' -> newline in filter.h documentation.
    
    The '\n' renders as a newline when the comments are converted to html
    by Doxygen.

 src/liblzma/api/lzma/filter.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

commit 3971f5c5024750ce8286891c6f79ae1661047483
Author: Jia Tan <jiat0218@gmail.com>
Date:   2023-02-06 21:45:37 +0800

    liblzma: Shorten return description for two functions in filter.h.
    
    Shorten the description for lzma_raw_encoder_memusage() and
    lzma_raw_decoder_memusage().

 src/liblzma/api/lzma/filter.h | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

commit 5e61b39432752b6cd1a7b518f0f9e4f0c3f0f242
Author: Jia Tan <jiat0218@gmail.com>
Date:   2023-02-06 21:44:45 +0800

    liblzma: Reword a few lines in filter.h

 src/liblzma/api/lzma/filter.h | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

commit 8a53533869defa1191b41f176a0312cb53a139e2
Author: Jia Tan <jiat0218@gmail.com>
Date:   2023-02-06 21:35:06 +0800

    liblzma: Improve documentation in filter.h.
    
    All functions now explicitly specify parameter and return values.
    The notes and code annotations were moved before the parameter and
    return value descriptions for consistency.
    
    Also, the description above lzma_filter_encoder_is_supported() about
    not being able to list available filters was removed since
    lzma_str_list_filters() will do this.

 src/liblzma/api/lzma/filter.h | 226 ++++++++++++++++++++++++++----------------
 1 file changed, 143 insertions(+), 83 deletions(-)

commit 6d05b08b17ac8cb93165ee8f310fdd925b0b258f
Author: Lasse Collin <lasse.collin@tukaani.org>
Date:   2023-02-23 20:46:16 +0200

    Update THANKS.

 THANKS | 1 +
 1 file changed, 1 insertion(+)

commit dfc9a54082e0fc7b3b796ea15336b5075acc79d5
Author: Lasse Collin <lasse.collin@tukaani.org>
Date:   2023-02-21 22:57:10 +0200

    liblzma: Avoid null pointer + 0 (undefined behavior in C).
    
    In the C99 and C17 standards, section 6.5.6 paragraph 8 means that
    adding 0 to a null pointer is undefined behavior. As of writing,
    "clang -fsanitize=undefined" (Clang 15) diagnoses this. However,
    I'm not aware of any compiler that would take advantage of this
    when optimizing (Clang 15 included). It's good to avoid this anyway
    since compilers might some day infer that pointer arithmetic implies
    that the pointer is not NULL. That is, the following foo() would then
    unconditionally return 0, even for foo(NULL, 0):
    
        void bar(char *a, char *b);
    
        int foo(char *a, size_t n)
        {
            bar(a, a + n);
            return a == NULL;
        }
    
    In contrast to C, C++ explicitly allows null pointer + 0. So if
    the above is compiled as C++ then there is no undefined behavior
    in the foo(NULL, 0) call.
    
    To me it seems that changing the C standard would be the sane
    thing to do (just add one sentence) as it would ensure that a huge
    amount of old code won't break in the future. Based on web searches
    it seems that a large number of codebases (where null pointer + 0
    occurs) are being fixed instead to be future-proof in case compilers
    will some day optimize based on it (like making the above foo(NULL, 0)
    return 0) which in the worst case will cause security bugs.
    
    Some projects don't plan to change it. For example, gnulib and thus
    many GNU tools currently require that null pointer + 0 is defined:
    
        https://lists.gnu.org/archive/html/bug-gnulib/2021-11/msg00000.html
    
        https://www.gnu.org/software/gnulib/manual/html_node/Other-portability-assumptions.html
    
    In XZ Utils null pointer + 0 issue should be fixed after this
    commit. This adds a few if-statements and thus branches to avoid
    null pointer + 0. These check for size > 0 instead of ptr != NULL
    because this way bugs where size > 0 && ptr == NULL will likely
    get caught quickly. None of them are in hot spots so it shouldn't
    matter for performance.
    
    A little less readable version would be replacing
    
        ptr + offset
    
    with
    
        offset != 0 ? ptr + offset : ptr
    
    or creating a macro for it:
    
        #define my_ptr_add(ptr, offset) \
                ((offset) != 0 ? ((ptr) + (offset)) : (ptr))
    
    Checking for offset != 0 instead of ptr != NULL allows GCC >= 8.1,
    Clang >= 7, and Clang-based ICX to optimize it to the very same code
    as ptr + offset. That is, it won't create a branch. So for hot code
    this could be a good solution to avoid null pointer + 0. Unfortunately
    other compilers like ICC 2021 or MSVC 19.33 (VS2022) will create a
    branch from my_ptr_add().
    
    Thanks to Marcin Kowalczyk for reporting the problem:
    https://github.com/tukaani-project/xz/issues/36

 src/liblzma/common/block_decoder.c |  5 ++++-
 src/liblzma/common/block_encoder.c |  7 +++++--
 src/liblzma/common/common.c        | 20 ++++++++++++++------
 src/liblzma/common/index_decoder.c | 13 ++++++++++---
 src/liblzma/common/index_encoder.c | 11 +++++++++--
 src/liblzma/common/index_hash.c    | 13 ++++++++++---
 src/liblzma/common/lzip_decoder.c  |  6 +++++-
 src/liblzma/delta/delta_decoder.c  |  7 ++++++-
 src/liblzma/delta/delta_encoder.c  | 12 ++++++++++--
 src/liblzma/simple/simple_coder.c  |  6 ++++--
 10 files changed, 77 insertions(+), 23 deletions(-)

commit f6dce49cb656b358e2fb2a3032e35e20af34dc84
Author: Jia Tan <jiat0218@gmail.com>
Date:   2023-02-07 00:00:44 +0800

    liblzma: Adjust container.h for consistency with filter.h.

 src/liblzma/api/lzma/container.h | 20 +++++++++-----------
 1 file changed, 9 insertions(+), 11 deletions(-)

commit 173d240bb4763aedc8c01df4d9c83e311d954c33
Author: Jia Tan <jiat0218@gmail.com>
Date:   2023-02-07 00:00:09 +0800

    liblzma: Fix small typos and reword a few things in filter.h.

 src/liblzma/api/lzma/container.h | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

commit 17797bacde3f7264048ef0976c137a600148d6cf
Author: Jia Tan <jiat0218@gmail.com>
Date:   2023-02-06 23:42:08 +0800

    liblzma: Convert list of flags in lzma_mt to bulleted list.

 src/liblzma/api/lzma/container.h | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

commit 37da0e727161b401b8bfd8dccf163a4b2fc0460b
Author: Jia Tan <jiat0218@gmail.com>
Date:   2023-01-26 23:17:41 +0800

    liblzma: Fix typo in documentation in container.h
    
    lzma_microlzma_decoder -> lzma_microlzma_encoder

 src/liblzma/api/lzma/container.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

commit b8331077c626e6bf14f4671d09b561146eaf816a
Author: Jia Tan <jiat0218@gmail.com>
Date:   2023-01-26 23:16:34 +0800

    liblzma: Improve documentation for container.h
    
    Standardizing each function to always specify parameters and return
    values. Also moved the parameters and return values to the end of each
    function description.

 src/liblzma/api/lzma/container.h | 146 +++++++++++++++++++++++++--------------
 1 file changed, 93 insertions(+), 53 deletions(-)

commit b9a3511bb61d3b6ce49abd33dce6155a573f5272
Author: Jia Tan <jiat0218@gmail.com>
Date:   2023-02-22 20:59:41 +0800

    CMake: Add LZIP decoder test to list of tests.

 CMakeLists.txt | 1 +
 1 file changed, 1 insertion(+)

commit cd82ef2fb48b174c57cd03b84a9a0f978772cb89
Author: Lasse Collin <lasse.collin@tukaani.org>
Date:   2023-02-17 20:56:49 +0200

    Update THANKS.

 THANKS | 1 +
 1 file changed, 1 insertion(+)

commit 076e911ba25cadf2cbdfbd0f65991a002e210c0b
Author: Lasse Collin <lasse.collin@tukaani.org>
Date:   2023-02-17 20:48:28 +0200

    Build: Use only the generic symbol versioning on MicroBlaze.
    
    On MicroBlaze, GCC 12 is broken in sense that
    __has_attribute(__symver__) returns true but it still doesn't
    support the __symver__ attribute even though the platform is ELF
    and symbol versioning is supported if using the traditional
    __asm__(".symver ...") method. Avoiding the traditional method is
    good because it breaks LTO (-flto) builds with GCC.
    
    See also: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101766
    
    For now the only extra symbols in liblzma_linux.map are the
    compatibility symbols with the patch that spread from RHEL/CentOS 7.
    These require the use of __symver__ attribute or __asm__(".symver ...")
    in the C code. Compatibility with the patch from CentOS 7 doesn't
    seem valuable on MicroBlaze so use liblzma_generic.map on MicroBlaze
    instead. It doesn't require anything special in the C code and thus
    no LTO issues either.
    
    An alternative would be to detect support for __symver__
    attribute in configure.ac and CMakeLists.txt and fall back
    to __asm__(".symver ...") but then LTO would be silently broken
    on MicroBlaze. It sounds likely that MicroBlaze is a special
    case so let's treat it as a such because that is simpler. If
    a similar issue exists on some other platform too then hopefully
    someone will report it and this can be reconsidered.
    
    (This doesn't do the same fix in CMakeLists.txt. Perhaps it should
    but perhaps CMake build of liblzma doesn't matter much on MicroBlaze.
    The problem breaks the build so it's easy to notice and can be fixed
    later.)
    
    Thanks to Vincent Fazio for reporting the problem and proposing
    a patch (in the end that solution wasn't used):
    https://github.com/tukaani-project/xz/pull/32

 configure.ac | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

commit bc34e5ac9996667d2c1ec9a7895ec5931ac4caea
Author: Lasse Collin <lasse.collin@tukaani.org>
Date:   2023-02-16 21:09:00 +0200

    liblzma: Very minor API doc tweaks.
    
    Use "member" to refer to struct members as that's the term used
    by the C standard.
    
    Use lzma_options_delta.dist and such in docs so that in Doxygen's
    HTML output they will link to the doc of the struct member.
    
    Clean up a few trailing white spaces too.

 src/liblzma/api/lzma/block.h        |  6 +++---
 src/liblzma/api/lzma/delta.h        |  6 +++---
 src/liblzma/api/lzma/index.h        | 10 +++++-----
 src/liblzma/api/lzma/stream_flags.h |  6 +++---
 4 files changed, 14 insertions(+), 14 deletions(-)

commit d31fbd28be5b79eb682db50004b0fb7aad5299ec
Author: Jia Tan <jiat0218@gmail.com>
Date:   2023-02-17 00:54:33 +0800

    liblzma: Adjust spacing in doc headers in bcj.h.

 src/liblzma/api/lzma/bcj.h | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

commit 701e9be6bede19771895f756082db0c017f86f07
Author: Jia Tan <jiat0218@gmail.com>
Date:   2023-02-17 00:44:44 +0800

    liblzma: Adjust documentation in bcj.h for consistent style.

 src/liblzma/api/lzma/bcj.h | 43 ++++++++++++++++++++++---------------------
 1 file changed, 22 insertions(+), 21 deletions(-)

commit 762c4d0b62d2694cf3a01e030fdfe68e09e7b503
Author: Jia Tan <jiat0218@gmail.com>
Date:   2023-02-17 00:36:05 +0800

    liblzma: Rename field => member in documentation.
    
    Also adjusted preset value => preset level.

 src/liblzma/api/lzma/base.h         | 18 +++++++--------
 src/liblzma/api/lzma/block.h        | 44 ++++++++++++++++++-------------------
 src/liblzma/api/lzma/container.h    | 26 +++++++++++-----------
 src/liblzma/api/lzma/delta.h        | 12 +++++-----
 src/liblzma/api/lzma/index.h        | 30 ++++++++++++-------------
 src/liblzma/api/lzma/lzma12.h       | 28 +++++++++++------------
 src/liblzma/api/lzma/stream_flags.h | 32 +++++++++++++--------------
 7 files changed, 95 insertions(+), 95 deletions(-)

commit 0ce1db0223854d94b4a0d17737ac0486a75d9e6a
Author: Lasse Collin <lasse.collin@tukaani.org>
Date:   2023-02-16 17:59:50 +0200

    liblzma: Silence a warning from MSVC.
    
    It gives C4146 here since unary minus with unsigned integer
