(7zip) Cleanup unneeded stuff

This commit is contained in:
twinaphex 2017-06-12 13:07:35 +02:00
parent 11d4827c9f
commit 470995630b

41
deps/7zip/CpuArch.h vendored
View File

@ -52,12 +52,7 @@ If MY_CPU_LE_UNALIGN is not defined, we don't know about these properties of pla
#define GetUi16(p) (*(const uint16_t *)(p))
#define GetUi32(p) (*(const uint32_t *)(p))
#define GetUi64(p) (*(const uint64_t *)(p))
#define SetUi16(p, d) *(uint16_t *)(p) = (d);
#define SetUi32(p, d) *(uint32_t *)(p) = (d);
#define SetUi64(p, d) *(uint64_t *)(p) = (d);
#else
#define GetUi16(p) (((const uint8_t *)(p))[0] | ((uint16_t)((const uint8_t *)(p))[1] << 8))
#define GetUi32(p) ( \
@ -67,44 +62,8 @@ If MY_CPU_LE_UNALIGN is not defined, we don't know about these properties of pla
((uint32_t)((const uint8_t *)(p))[3] << 24))
#define GetUi64(p) (GetUi32(p) | ((uint64_t)GetUi32(((const uint8_t *)(p)) + 4) << 32))
#define SetUi16(p, d) { uint32_t _x_ = (d); \
((uint8_t *)(p))[0] = (uint8_t)_x_; \
((uint8_t *)(p))[1] = (uint8_t)(_x_ >> 8); }
#define SetUi32(p, d) { uint32_t _x_ = (d); \
((uint8_t *)(p))[0] = (uint8_t)_x_; \
((uint8_t *)(p))[1] = (uint8_t)(_x_ >> 8); \
((uint8_t *)(p))[2] = (uint8_t)(_x_ >> 16); \
((uint8_t *)(p))[3] = (uint8_t)(_x_ >> 24); }
#define SetUi64(p, d) { uint64_t _x64_ = (d); \
SetUi32(p, (uint32_t)_x64_); \
SetUi32(((uint8_t *)(p)) + 4, (uint32_t)(_x64_ >> 32)); }
#endif
#if defined(MY_CPU_LE_UNALIGN) && defined(_WIN64) && (_MSC_VER >= 1300)
#pragma intrinsic(_byteswap_ulong)
#pragma intrinsic(_byteswap_uint64)
#define GetBe32(p) _byteswap_ulong(*(const uint32_t *)(const uint8_t *)(p))
#define GetBe64(p) _byteswap_uint64(*(const uint64_t *)(const uint8_t *)(p))
#else
#define GetBe32(p) ( \
((uint32_t)((const uint8_t *)(p))[0] << 24) | \
((uint32_t)((const uint8_t *)(p))[1] << 16) | \
((uint32_t)((const uint8_t *)(p))[2] << 8) | \
((const uint8_t *)(p))[3] )
#define GetBe64(p) (((uint64_t)GetBe32(p) << 32) | GetBe32(((const uint8_t *)(p)) + 4))
#endif
#define GetBe16(p) (((uint16_t)((const uint8_t *)(p))[0] << 8) | ((const uint8_t *)(p))[1])
#ifdef __cplusplus
}
#endif