From fc9fe8f17c79f29110bc8b63d47403681ad7764d Mon Sep 17 00:00:00 2001 From: Sebastian Pipping Date: Sun, 3 Dec 2017 17:26:44 +0100 Subject: [PATCH] Address warning about sip_tobin by Visual Studio Message was: Warning: C4551 function call missing argument --- expat/lib/siphash.h | 7 +++++++ expat/lib/xmlparse.c | 1 - expat/tests/runtests.c | 1 - 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/expat/lib/siphash.h b/expat/lib/siphash.h index 581872df..00ead6e0 100644 --- a/expat/lib/siphash.h +++ b/expat/lib/siphash.h @@ -11,6 +11,9 @@ * -------------------------------------------------------------------------- * HISTORY: * + * 2017-11-03 (Sebastian Pipping) + * - Hide sip_tobin and sip_binof unless SIPHASH_TOBIN macro is defined + * * 2017-07-25 (Vadim Zeitlin) * - Fix use of SIPHASH_MAIN macro * @@ -151,6 +154,8 @@ static struct sipkey *sip_tokey(struct sipkey *key, const void *src) { } /* sip_tokey() */ +#ifdef SIPHASH_TOBIN + #define sip_binof(v) sip_tobin((unsigned char[8]){ 0 }, (v)) static void *sip_tobin(void *dst, uint64_t u64) { @@ -158,6 +163,8 @@ static void *sip_tobin(void *dst, uint64_t u64) { return dst; } /* sip_tobin() */ +#endif /* SIPHASH_TOBIN */ + static void sip_round(struct siphash *H, const int rounds) { int i; diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c index 90a237f3..0efd2bdd 100644 --- a/expat/lib/xmlparse.c +++ b/expat/lib/xmlparse.c @@ -6643,7 +6643,6 @@ hash(XML_Parser parser, KEY s) { struct siphash state; struct sipkey key; - (void)sip_tobin; (void)sip24_valid; copy_salt_to_sipkey(parser, &key); sip24_init(&state, &key); diff --git a/expat/tests/runtests.c b/expat/tests/runtests.c index d81d70f3..b39b44b3 100644 --- a/expat/tests/runtests.c +++ b/expat/tests/runtests.c @@ -491,7 +491,6 @@ START_TEST(test_siphash_spec) const uint64_t expected = _SIP_ULL(0xa129ca61U, 0x49be45e5U); struct siphash state; struct sipkey key; - (void)sip_tobin; sip_tokey(&key, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09" -- 2.40.0