From ca65d12c7e01e2c2a4628ded597f95b465cc59a0 Mon Sep 17 00:00:00 2001 From: Natalia Portillo Date: Wed, 13 Oct 2021 03:30:02 +0100 Subject: [PATCH] Fix header guards. --- arm_vmull.h | 6 +++--- crc16.h | 7 ++++++- crc16_ccitt.h | 7 ++++++- crc32.h | 7 ++++++- crc32_simd.h | 6 +++--- crc64.h | 7 ++++++- simd.h | 5 +++++ spamsum.h | 5 +++++ 8 files changed, 40 insertions(+), 10 deletions(-) diff --git a/arm_vmull.h b/arm_vmull.h index 48cbf3e..4c37544 100644 --- a/arm_vmull.h +++ b/arm_vmull.h @@ -16,8 +16,8 @@ * License along with this library; if not, see . */ -#ifndef AARU_CHECKSUMS_NATIVE__ARM_VMULL_H_ -#define AARU_CHECKSUMS_NATIVE__ARM_VMULL_H_ +#ifndef AARU_CHECKSUMS_NATIVE_ARM_VMULL_H +#define AARU_CHECKSUMS_NATIVE_ARM_VMULL_H #if defined(__aarch64__) || defined(_M_ARM64) || defined(__arm__) || defined(_M_ARM) @@ -29,4 +29,4 @@ TARGET_WITH_SIMD uint64x2_t mm_slli_si128(uint64x2_t a, int imm); #endif -#endif // AARU_CHECKSUMS_NATIVE__ARM_VMULL_H_ +#endif // AARU_CHECKSUMS_NATIVE_ARM_VMULL_H diff --git a/crc16.h b/crc16.h index 8b5306a..f369e78 100644 --- a/crc16.h +++ b/crc16.h @@ -16,6 +16,9 @@ * License along with this library; if not, see . */ +#ifndef AARU_CHECKSUMS_NATIVE_CRC16_H +#define AARU_CHECKSUMS_NATIVE_CRC16_H + typedef struct { uint16_t crc; @@ -178,4 +181,6 @@ const uint16_t crc16_table[8][256] = { AARU_EXPORT crc16_ctx* AARU_CALL crc16_init(); AARU_EXPORT int AARU_CALL crc16_update(crc16_ctx* ctx, const uint8_t* data, uint32_t len); AARU_EXPORT int AARU_CALL crc16_final(crc16_ctx* ctx, uint16_t* crc); -AARU_EXPORT void AARU_CALL crc16_free(crc16_ctx* ctx); \ No newline at end of file +AARU_EXPORT void AARU_CALL crc16_free(crc16_ctx* ctx); + +#endif // AARU_CHECKSUMS_NATIVE_CRC16_H \ No newline at end of file diff --git a/crc16_ccitt.h b/crc16_ccitt.h index 3861559..ced0f00 100644 --- a/crc16_ccitt.h +++ b/crc16_ccitt.h @@ -16,6 +16,9 @@ * License along with this library; if not, see . */ +#ifndef AARU_CHECKSUMS_NATIVE_CRC16_CCITT_H +#define AARU_CHECKSUMS_NATIVE_CRC16_CCITT_H + typedef struct { uint16_t crc; @@ -177,4 +180,6 @@ const uint16_t crc16_ccitt_table[8][256] = { AARU_EXPORT crc16_ccitt_ctx* AARU_CALL crc16_ccitt_init(); AARU_EXPORT int AARU_CALL crc16_ccitt_update(crc16_ccitt_ctx* ctx, const uint8_t* data, uint32_t len); AARU_EXPORT int AARU_CALL crc16_ccitt_final(crc16_ccitt_ctx* ctx, uint16_t* crc); -AARU_EXPORT void AARU_CALL crc16_ccitt_free(crc16_ccitt_ctx* ctx); \ No newline at end of file +AARU_EXPORT void AARU_CALL crc16_ccitt_free(crc16_ccitt_ctx* ctx); + +#endif // AARU_CHECKSUMS_NATIVE_CRC16_H diff --git a/crc32.h b/crc32.h index dbf37b0..88770d4 100644 --- a/crc32.h +++ b/crc32.h @@ -16,6 +16,9 @@ * License along with this library; if not, see . */ +#ifndef AARU_CHECKSUMS_NATIVE_CRC32_H +#define AARU_CHECKSUMS_NATIVE_CRC32_H + typedef struct { uint32_t crc; @@ -277,4 +280,6 @@ AARU_EXPORT TARGET_ARMV8_WITH_CRC uint32_t AARU_CALL armv8_crc32_little(uint32_t uint32_t len); #endif AARU_EXPORT TARGET_WITH_SIMD uint32_t AARU_CALL crc32_vmull(uint32_t previous_crc, const uint8_t* data, long len); -#endif \ No newline at end of file +#endif + +#endif // AARU_CHECKSUMS_NATIVE_CRC32_H diff --git a/crc32_simd.h b/crc32_simd.h index 5670e05..fe5b97e 100644 --- a/crc32_simd.h +++ b/crc32_simd.h @@ -16,8 +16,8 @@ * License along with this library; if not, see . */ -#ifndef AARU_CHECKSUMS_NATIVE__CRC32_SIMD_H_ -#define AARU_CHECKSUMS_NATIVE__CRC32_SIMD_H_ +#ifndef AARU_CHECKSUMS_NATIVE_CRC32_SIMD_H +#define AARU_CHECKSUMS_NATIVE_CRC32_SIMD_H static const unsigned ALIGNED_(32) pshufb_shf_table[60] = { 0x84838281, 0x88878685, 0x8c8b8a89, 0x008f8e8d, /* shl 15 (16 - 1)/shr1 */ @@ -63,4 +63,4 @@ static const unsigned ALIGNED_(16) crc_mask2[4] = {0x00000000, 0xFFFFFFFF, 0xFFF (op); \ } -#endif // AARU_CHECKSUMS_NATIVE__CRC32_SIMD_H_ +#endif // AARU_CHECKSUMS_NATIVE_CRC32_SIMD_H diff --git a/crc64.h b/crc64.h index 4b4248a..c7e4a8a 100644 --- a/crc64.h +++ b/crc64.h @@ -16,6 +16,9 @@ * License along with this library; if not, see . */ +#ifndef AARU_CHECKSUMS_NATIVE_CRC64_H +#define AARU_CHECKSUMS_NATIVE_CRC64_H + typedef struct { uint64_t crc; @@ -247,4 +250,6 @@ AARU_EXPORT CLMUL uint64_t AARU_CALL crc64_clmul(uint64_t crc, const uint8_t* da #if defined(__aarch64__) || defined(_M_ARM64) || defined(__arm__) || defined(_M_ARM) AARU_EXPORT TARGET_WITH_SIMD uint64_t AARU_CALL crc64_vmull(uint64_t previous_crc, const uint8_t* data, long len); -#endif \ No newline at end of file +#endif + +#endif // AARU_CHECKSUMS_NATIVE_CRC64_H diff --git a/simd.h b/simd.h index ca08762..5bb4cf3 100644 --- a/simd.h +++ b/simd.h @@ -16,6 +16,9 @@ * License along with this library; if not, see . */ +#ifndef AARU_CHECKSUMS_NATIVE_SIMD_H +#define AARU_CHECKSUMS_NATIVE_SIMD_H + #ifdef _MSC_VER #define ALIGNED_(n) __declspec(align(n)) #else @@ -116,3 +119,5 @@ AARU_EXPORT int have_arm_crypto(void); #endif // _MSC_VER #endif // __aarch64__ || _M_ARM64 || __arm__ || _M_ARM + +#endif // AARU_CHECKSUMS_NATIVE_CRC32_SIMD_H diff --git a/spamsum.h b/spamsum.h index 2b61f71..ed23cc4 100644 --- a/spamsum.h +++ b/spamsum.h @@ -16,6 +16,9 @@ * License along with this library; if not, see . */ +#ifndef AARU_CHECKSUMS_NATIVE_SPAMSUM_H +#define AARU_CHECKSUMS_NATIVE_SPAMSUM_H + #define SPAMSUM_LENGTH 64 #define NUM_BLOCKHASHES 31 #define ROLLING_WINDOW 7 @@ -60,3 +63,5 @@ AARU_LOCAL void fuzzy_engine_step(spamsum_ctx* ctx, uint8_t c); AARU_LOCAL void roll_hash(spamsum_ctx* ctx, uint8_t c); AARU_LOCAL void fuzzy_try_reduce_blockhash(spamsum_ctx* ctx); AARU_LOCAL void fuzzy_try_fork_blockhash(spamsum_ctx* ctx); + +#endif // AARU_CHECKSUMS_NATIVE_SPAMSUM_H