From 233885a437f8b55a5c8442984ebc0aaa579e92de Mon Sep 17 00:00:00 2001 From: Hans Jansen Date: Thu, 12 Oct 2023 19:07:50 +0200 Subject: liblzma: Rename crc_macros.h to crc_common.h. --- src/liblzma/check/Makefile.inc | 2 +- src/liblzma/check/crc32_fast.c | 2 +- src/liblzma/check/crc64_fast.c | 2 +- src/liblzma/check/crc_common.h | 30 ++++++++++++++++++++++++++++++ src/liblzma/check/crc_macros.h | 30 ------------------------------ 5 files changed, 33 insertions(+), 33 deletions(-) create mode 100644 src/liblzma/check/crc_common.h delete mode 100644 src/liblzma/check/crc_macros.h (limited to 'src/liblzma/check') diff --git a/src/liblzma/check/Makefile.inc b/src/liblzma/check/Makefile.inc index dc011a3f..1b016356 100644 --- a/src/liblzma/check/Makefile.inc +++ b/src/liblzma/check/Makefile.inc @@ -12,7 +12,7 @@ EXTRA_DIST += \ liblzma_la_SOURCES += \ check/check.c \ check/check.h \ - check/crc_macros.h + check/crc_common.h if COND_CHECK_CRC32 if COND_SMALL diff --git a/src/liblzma/check/crc32_fast.c b/src/liblzma/check/crc32_fast.c index eed73505..fa53e99b 100644 --- a/src/liblzma/check/crc32_fast.c +++ b/src/liblzma/check/crc32_fast.c @@ -17,7 +17,7 @@ /////////////////////////////////////////////////////////////////////////////// #include "check.h" -#include "crc_macros.h" +#include "crc_common.h" // If you make any changes, do some benchmarking! Seemingly unrelated diff --git a/src/liblzma/check/crc64_fast.c b/src/liblzma/check/crc64_fast.c index 62c2c9bb..adca0584 100644 --- a/src/liblzma/check/crc64_fast.c +++ b/src/liblzma/check/crc64_fast.c @@ -77,7 +77,7 @@ #ifdef CRC_GENERIC -#include "crc_macros.h" +#include "crc_common.h" #ifdef WORDS_BIGENDIAN diff --git a/src/liblzma/check/crc_common.h b/src/liblzma/check/crc_common.h new file mode 100644 index 00000000..f3ee205d --- /dev/null +++ b/src/liblzma/check/crc_common.h @@ -0,0 +1,30 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file crc_common.h +/// \brief Some endian-dependent macros for CRC32 and CRC64 +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#ifdef WORDS_BIGENDIAN +# define A(x) ((x) >> 24) +# define B(x) (((x) >> 16) & 0xFF) +# define C(x) (((x) >> 8) & 0xFF) +# define D(x) ((x) & 0xFF) + +# define S8(x) ((x) << 8) +# define S32(x) ((x) << 32) + +#else +# define A(x) ((x) & 0xFF) +# define B(x) (((x) >> 8) & 0xFF) +# define C(x) (((x) >> 16) & 0xFF) +# define D(x) ((x) >> 24) + +# define S8(x) ((x) >> 8) +# define S32(x) ((x) >> 32) +#endif diff --git a/src/liblzma/check/crc_macros.h b/src/liblzma/check/crc_macros.h deleted file mode 100644 index a7c21b76..00000000 --- a/src/liblzma/check/crc_macros.h +++ /dev/null @@ -1,30 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// -/// \file crc_macros.h -/// \brief Some endian-dependent macros for CRC32 and CRC64 -// -// Author: Lasse Collin -// -// This file has been put into the public domain. -// You can do whatever you want with this file. -// -/////////////////////////////////////////////////////////////////////////////// - -#ifdef WORDS_BIGENDIAN -# define A(x) ((x) >> 24) -# define B(x) (((x) >> 16) & 0xFF) -# define C(x) (((x) >> 8) & 0xFF) -# define D(x) ((x) & 0xFF) - -# define S8(x) ((x) << 8) -# define S32(x) ((x) << 32) - -#else -# define A(x) ((x) & 0xFF) -# define B(x) (((x) >> 8) & 0xFF) -# define C(x) (((x) >> 16) & 0xFF) -# define D(x) ((x) >> 24) - -# define S8(x) ((x) >> 8) -# define S32(x) ((x) >> 32) -#endif -- cgit v1.2.3