From c951711d750db6fd75641f39de9ae9aebef19e86 Mon Sep 17 00:00:00 2001 From: Sebastian Pipping Date: Sun, 28 Jul 2019 17:14:06 +0200 Subject: [PATCH] siphash.h: Prepare for application of clang-format --- .travis.yml | 1 + expat/apply-clang-format.sh | 2 ++ expat/lib/siphash.h | 7 +++++++ 3 files changed, 10 insertions(+) diff --git a/.travis.yml b/.travis.yml index 71a434a3..0a1e23a2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -55,6 +55,7 @@ addons: - dos2unix - lzip - mingw-w64 + - moreutils - rpm - wine diff --git a/expat/apply-clang-format.sh b/expat/apply-clang-format.sh index 420b62c4..50d8d224 100755 --- a/expat/apply-clang-format.sh +++ b/expat/apply-clang-format.sh @@ -32,6 +32,8 @@ set -e set -u set -o pipefail +expand --tabs=2 --initial lib/siphash.h | sponge lib/siphash.h + find \ -name '*.[ch]' \ -o -name '*.cpp' \ diff --git a/expat/lib/siphash.h b/expat/lib/siphash.h index 4d6786d7..95dfff13 100644 --- a/expat/lib/siphash.h +++ b/expat/lib/siphash.h @@ -11,6 +11,10 @@ * -------------------------------------------------------------------------- * HISTORY: * + * 2019-08-03 (Sebastian Pipping) + * - Mark part of sip24_valid as to be excluded from clang-format + * - Re-format code using clang-format 9 + * * 2018-07-08 (Anton Maklakov) * - Add "fall through" markers for GCC's -Wimplicit-fallthrough * @@ -286,6 +290,7 @@ static uint64_t siphash24(const void *src, size_t len, * in = 00 01 02 ... 3e (63 bytes) */ static int sip24_valid(void) { + /* clang-format off */ static const unsigned char vectors[64][8] = { { 0x31, 0x0e, 0x0e, 0xdd, 0x47, 0xdb, 0x6f, 0x72, }, { 0xfd, 0x67, 0xdc, 0x93, 0xc5, 0x39, 0xf8, 0x74, }, @@ -352,6 +357,8 @@ static int sip24_valid(void) { { 0x57, 0x5f, 0xf2, 0x8e, 0x60, 0x38, 0x1b, 0xe5, }, { 0x72, 0x45, 0x06, 0xeb, 0x4c, 0x32, 0x8a, 0x95, } }; + /* clang-format on */ + unsigned char in[64]; struct sipkey k; size_t i;