(deps/7zip) Cleanups - rebase around MSB_FIRST
This commit is contained in:
parent
035d006d62
commit
5f243b4baa
|
@ -7,10 +7,10 @@
|
||||||
|
|
||||||
#define kCrcPoly 0xEDB88320
|
#define kCrcPoly 0xEDB88320
|
||||||
|
|
||||||
#ifdef MY_CPU_LE
|
#ifdef MSB_FIRST
|
||||||
#define CRC_NUM_TABLES 8
|
|
||||||
#else
|
|
||||||
#define CRC_NUM_TABLES 1
|
#define CRC_NUM_TABLES 1
|
||||||
|
#else
|
||||||
|
#define CRC_NUM_TABLES 8
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef uint32_t (MY_FAST_CALL *CRC_FUNC)(uint32_t v, const void *data, size_t size, const uint32_t *table);
|
typedef uint32_t (MY_FAST_CALL *CRC_FUNC)(uint32_t v, const void *data, size_t size, const uint32_t *table);
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include "CpuArch.h"
|
#include "CpuArch.h"
|
||||||
|
|
||||||
#ifdef MY_CPU_LE
|
#ifndef MSB_FIRST
|
||||||
|
|
||||||
#define CRC_UPDATE_BYTE_2(crc, b) (table[((crc) ^ (b)) & 0xFF] ^ ((crc) >> 8))
|
#define CRC_UPDATE_BYTE_2(crc, b) (table[((crc) ^ (b)) & 0xFF] ^ ((crc) >> 8))
|
||||||
|
|
||||||
|
|
|
@ -11,9 +11,6 @@ extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
MY_CPU_LE means that CPU is LITTLE ENDIAN.
|
|
||||||
If MY_CPU_LE is not defined, we don't know about that property of platform (it can be LITTLE ENDIAN).
|
|
||||||
|
|
||||||
MY_CPU_LE_UNALIGN means that CPU is LITTLE ENDIAN and CPU supports unaligned memory accesses.
|
MY_CPU_LE_UNALIGN means that CPU is LITTLE ENDIAN and CPU supports unaligned memory accesses.
|
||||||
If MY_CPU_LE_UNALIGN is not defined, we don't know about these properties of platform.
|
If MY_CPU_LE_UNALIGN is not defined, we don't know about these properties of platform.
|
||||||
*/
|
*/
|
||||||
|
@ -50,18 +47,6 @@ If MY_CPU_LE_UNALIGN is not defined, we don't know about these properties of pla
|
||||||
#define MY_CPU_LE_UNALIGN
|
#define MY_CPU_LE_UNALIGN
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(MY_CPU_X86_OR_AMD64) || defined(MY_CPU_ARM_LE) || defined(MY_CPU_IA64_LE) || defined(__ARMEL__) || defined(__MIPSEL__) || defined(__LITTLE_ENDIAN__)
|
|
||||||
#define MY_CPU_LE
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(__BIG_ENDIAN__)
|
|
||||||
#define MY_CPU_BE
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(MY_CPU_LE) && defined(MY_CPU_BE)
|
|
||||||
Stop_Compiling_Bad_Endian
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef MY_CPU_LE_UNALIGN
|
#ifdef MY_CPU_LE_UNALIGN
|
||||||
|
|
||||||
#define GetUi16(p) (*(const uint16_t *)(p))
|
#define GetUi16(p) (*(const uint16_t *)(p))
|
||||||
|
|
Loading…
Reference in New Issue