From eb0cda88fa0aad4d728460a2bd0db071f741cca0 Mon Sep 17 00:00:00 2001 From: bluhm Date: Thu, 6 Jul 2017 13:06:34 +0000 Subject: [PATCH] Add ULL suffix to 64 bit constants. This avoids compiler warnings on i386 and allows to compile the C++ test. Upstream dropped the ULL in an insufficient attempt to make the siphash code C89 compatible. Their fix will be more complicated. No binary change. --- lib/libexpat/lib/siphash.h | 9 ++++----- lib/libexpat/tests/runtests.c | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/libexpat/lib/siphash.h b/lib/libexpat/lib/siphash.h index 23b56d2ae48..9a9271c67b7 100644 --- a/lib/libexpat/lib/siphash.h +++ b/lib/libexpat/lib/siphash.h @@ -16,7 +16,6 @@ * - Clarify license note in the header * - Address C89 issues: * - Stop using inline keyword (and let compiler decide) - * - Turn integer suffix ULL to UL * - Replace _Bool by int * - Turn macro siphash24 into a function * - Address invalid conversion (void pointer) by explicit cast @@ -159,10 +158,10 @@ static void sip_round(struct siphash *H, const int rounds) { static struct siphash *sip24_init(struct siphash *H, const struct sipkey *key) { - H->v0 = 0x736f6d6570736575UL ^ key->k[0]; - H->v1 = 0x646f72616e646f6dUL ^ key->k[1]; - H->v2 = 0x6c7967656e657261UL ^ key->k[0]; - H->v3 = 0x7465646279746573UL ^ key->k[1]; + H->v0 = 0x736f6d6570736575ULL ^ key->k[0]; + H->v1 = 0x646f72616e646f6dULL ^ key->k[1]; + H->v2 = 0x6c7967656e657261ULL ^ key->k[0]; + H->v3 = 0x7465646279746573ULL ^ key->k[1]; H->p = H->buf; H->c = 0; diff --git a/lib/libexpat/tests/runtests.c b/lib/libexpat/tests/runtests.c index a689ffad8dc..f205b5f9c35 100644 --- a/lib/libexpat/tests/runtests.c +++ b/lib/libexpat/tests/runtests.c @@ -247,7 +247,7 @@ START_TEST(test_siphash_spec) const char message[] = "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09" "\x0a\x0b\x0c\x0d\x0e"; const size_t len = sizeof(message) - 1; - const uint64_t expected = 0xa129ca6149be45e5U; + const uint64_t expected = 0xa129ca6149be45e5ULL; struct siphash state; struct sipkey key; (void)sip_tobin; -- 2.20.1