From 2944a44b28c20ddb7ffe86a6ed8cb26c36fb4e02 Mon Sep 17 00:00:00 2001 From: Ahmet Inan Date: Wed, 5 Aug 2020 10:43:49 +0200 Subject: [PATCH] time to embrace #pragma once --- avx2.hh | 4 +--- bitman.hh | 5 +---- bitstream.hh | 4 +--- bose_chaudhuri_hocquenghem_decoder.hh | 4 +--- bose_chaudhuri_hocquenghem_encoder.hh | 4 +--- crc.hh | 5 +---- exclusive_reduce.hh | 5 +---- galois_field.hh | 4 +--- ldpc_decoder.hh | 4 +--- ldpc_encoder.hh | 4 +--- neon.hh | 4 +--- reed_solomon_decoder.hh | 4 +--- reed_solomon_encoder.hh | 4 +--- reed_solomon_error_correction.hh | 4 +--- simd.hh | 4 +--- sse4_1.hh | 4 +--- xorshift.hh | 5 +---- 17 files changed, 17 insertions(+), 55 deletions(-) diff --git a/avx2.hh b/avx2.hh index 172918f..454c7d1 100644 --- a/avx2.hh +++ b/avx2.hh @@ -4,8 +4,7 @@ Intel AVX2 acceleration Copyright 2018 Ahmet Inan */ -#ifndef AVX2_HH -#define AVX2_HH +#pragma once #include @@ -1135,4 +1134,3 @@ inline SIMD vclamp(SIMD x, int64_t a, int64_t b) return tmp; } -#endif diff --git a/bitman.hh b/bitman.hh index ad5335d..6d05ced 100644 --- a/bitman.hh +++ b/bitman.hh @@ -4,8 +4,7 @@ Bit manipulation of byte arrays Copyright 2018 Ahmet Inan */ -#ifndef BITMAN_HH -#define BITMAN_HH +#pragma once namespace CODE { @@ -41,5 +40,3 @@ bool get_le_bit(const uint8_t *buf, int pos) } -#endif - diff --git a/bitstream.hh b/bitstream.hh index bd579aa..6f73543 100644 --- a/bitstream.hh +++ b/bitstream.hh @@ -4,8 +4,7 @@ Bitwise stream container Copyright 2018 Ahmet Inan */ -#ifndef BITSTREAM_HH -#define BITSTREAM_HH +#pragma once namespace CODE { @@ -151,4 +150,3 @@ public: } -#endif diff --git a/bose_chaudhuri_hocquenghem_decoder.hh b/bose_chaudhuri_hocquenghem_decoder.hh index 3e11185..fb45d03 100644 --- a/bose_chaudhuri_hocquenghem_decoder.hh +++ b/bose_chaudhuri_hocquenghem_decoder.hh @@ -4,8 +4,7 @@ Bose Chaudhuri Hocquenghem Decoder Copyright 2018 Ahmet Inan */ -#ifndef BOSE_CHAUDHURI_HOCQUENGHEM_DECODER_HH -#define BOSE_CHAUDHURI_HOCQUENGHEM_DECODER_HH +#pragma once #include "reed_solomon_error_correction.hh" #include "bitman.hh" @@ -183,4 +182,3 @@ public: } -#endif diff --git a/bose_chaudhuri_hocquenghem_encoder.hh b/bose_chaudhuri_hocquenghem_encoder.hh index d561e7b..c102eab 100644 --- a/bose_chaudhuri_hocquenghem_encoder.hh +++ b/bose_chaudhuri_hocquenghem_encoder.hh @@ -4,8 +4,7 @@ Bose Chaudhuri Hocquenghem Encoder Copyright 2018 Ahmet Inan */ -#ifndef BOSE_CHAUDHURI_HOCQUENGHEM_ENCODER_HH -#define BOSE_CHAUDHURI_HOCQUENGHEM_ENCODER_HH +#pragma once #include #include "bitman.hh" @@ -151,4 +150,3 @@ public: } -#endif diff --git a/crc.hh b/crc.hh index 45d4df1..75774ce 100644 --- a/crc.hh +++ b/crc.hh @@ -4,8 +4,7 @@ Cyclic redundancy check Copyright 2018 Ahmet Inan */ -#ifndef CRC_HH -#define CRC_HH +#pragma once namespace CODE { @@ -84,5 +83,3 @@ uint8_t CRC::operator()(uint8_t data) } -#endif - diff --git a/exclusive_reduce.hh b/exclusive_reduce.hh index cfb7151..1f7d662 100644 --- a/exclusive_reduce.hh +++ b/exclusive_reduce.hh @@ -4,8 +4,7 @@ Reduce N times while excluding ith input element Copyright 2018 Ahmet Inan */ -#ifndef EXCLUSIVE_REDUCE_HH -#define EXCLUSIVE_REDUCE_HH +#pragma once namespace CODE { @@ -28,5 +27,3 @@ void exclusive_reduce(const TYPE *in, TYPE *out, int N, OPERATOR op) } -#endif - diff --git a/galois_field.hh b/galois_field.hh index 14f1741..f74c3db 100644 --- a/galois_field.hh +++ b/galois_field.hh @@ -4,8 +4,7 @@ Galois field arithmetic Copyright 2018 Ahmet Inan */ -#ifndef GALOIS_FIELD_HH -#define GALOIS_FIELD_HH +#pragma once #include @@ -301,4 +300,3 @@ private: }; } -#endif diff --git a/ldpc_decoder.hh b/ldpc_decoder.hh index ba84d97..837db0d 100644 --- a/ldpc_decoder.hh +++ b/ldpc_decoder.hh @@ -4,8 +4,7 @@ LDPC SISO layered decoder Copyright 2018 Ahmet Inan */ -#ifndef LDPC_DECODER_HH -#define LDPC_DECODER_HH +#pragma once #include #include "simd.hh" @@ -287,4 +286,3 @@ public: } -#endif diff --git a/ldpc_encoder.hh b/ldpc_encoder.hh index 73e549d..32dea6e 100644 --- a/ldpc_encoder.hh +++ b/ldpc_encoder.hh @@ -4,8 +4,7 @@ LDPC SISO encoder Copyright 2018 Ahmet Inan */ -#ifndef LDPC_ENCODER_HH -#define LDPC_ENCODER_HH +#pragma once namespace CODE { @@ -71,4 +70,3 @@ public: } -#endif diff --git a/neon.hh b/neon.hh index a9cf1a9..e591ed1 100644 --- a/neon.hh +++ b/neon.hh @@ -4,8 +4,7 @@ ARM NEON acceleration Copyright 2018 Ahmet Inan */ -#ifndef NEON_HH -#define NEON_HH +#pragma once #include @@ -939,4 +938,3 @@ inline SIMD vclamp(SIMD x, int32_t a, int32_t b) return tmp; } -#endif diff --git a/reed_solomon_decoder.hh b/reed_solomon_decoder.hh index aa99e43..1732866 100644 --- a/reed_solomon_decoder.hh +++ b/reed_solomon_decoder.hh @@ -4,8 +4,7 @@ Reed Solomon Decoder Copyright 2018 Ahmet Inan */ -#ifndef REED_SOLOMON_DECODER_HH -#define REED_SOLOMON_DECODER_HH +#pragma once #include "reed_solomon_error_correction.hh" @@ -100,4 +99,3 @@ public: } -#endif diff --git a/reed_solomon_encoder.hh b/reed_solomon_encoder.hh index 3c813fa..07b8e46 100644 --- a/reed_solomon_encoder.hh +++ b/reed_solomon_encoder.hh @@ -4,8 +4,7 @@ Reed Solomon Encoder Copyright 2018 Ahmet Inan */ -#ifndef REED_SOLOMON_ENCODER_HH -#define REED_SOLOMON_ENCODER_HH +#pragma once namespace CODE { @@ -79,4 +78,3 @@ public: } -#endif diff --git a/reed_solomon_error_correction.hh b/reed_solomon_error_correction.hh index cee462d..4796adf 100644 --- a/reed_solomon_error_correction.hh +++ b/reed_solomon_error_correction.hh @@ -4,8 +4,7 @@ Reed Solomon Error Correction Copyright 2018 Ahmet Inan */ -#ifndef REED_SOLOMON_ERROR_CORRECTION_HH -#define REED_SOLOMON_ERROR_CORRECTION_HH +#pragma once namespace CODE { namespace RS { @@ -267,4 +266,3 @@ struct ReedSolomonErrorCorrection } -#endif diff --git a/simd.hh b/simd.hh index 8e1d05d..4201089 100644 --- a/simd.hh +++ b/simd.hh @@ -4,8 +4,7 @@ Single instruction, multiple data Copyright 2018 Ahmet Inan */ -#ifndef SIMD_HH -#define SIMD_HH +#pragma once #include #include @@ -1402,4 +1401,3 @@ static inline SIMD vsign(SIMD a, SIMD */ -#ifndef SSE4_1_HH -#define SSE4_1_HH +#pragma once #include @@ -1128,4 +1127,3 @@ inline SIMD vclamp(SIMD x, int32_t a, int32_t b) return tmp; } -#endif diff --git a/xorshift.hh b/xorshift.hh index 615561b..aedb324 100644 --- a/xorshift.hh +++ b/xorshift.hh @@ -4,8 +4,7 @@ Class of pseudorandom number generators, discovered by George Marsaglia Copyright 2018 Ahmet Inan */ -#ifndef XORSHIFT_HH -#define XORSHIFT_HH +#pragma once namespace CODE { @@ -148,5 +147,3 @@ public: } -#endif -