From 5b7776cf139c8d3a5100e71395cb45e2f24e01af Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Sun, 26 May 2019 13:49:01 +0930 Subject: [PATCH] wire/test: remove unused padding code. Turns out the peer part of the spec no longer uses padding (it's used only in the onion), and GCC-9 with -O3 warns we're padding NULL to memcpy. Signed-off-by: Rusty Russell --- wire/test/run-peer-wire.c | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/wire/test/run-peer-wire.c b/wire/test/run-peer-wire.c index e6a4b6755..6231ceed5 100644 --- a/wire/test/run-peer-wire.c +++ b/wire/test/run-peer-wire.c @@ -1,15 +1,8 @@ #include "../gen_peer_wire.c" -void towire_pad_orig(u8 **pptr, size_t num); -#define towire_pad towire_pad_orig -void fromwire_pad_orig(const u8 **cursor, size_t *max, size_t num); -#define towire_pad towire_pad_orig -#define fromwire_pad fromwire_pad_orig #include "../towire.c" #include "../fromwire.c" #include "../peer_wire.c" -#undef towire_pad -#undef fromwire_pad #include #include @@ -21,19 +14,6 @@ secp256k1_context *secp256k1_ctx; /* AUTOGENERATED MOCKS START */ /* AUTOGENERATED MOCKS END */ -/* We allow non-zero padding for testing. */ -static const void *towire_pad_arr; -void towire_pad(u8 **pptr, size_t num) -{ - towire_u8_array(pptr, towire_pad_arr, num); -} - -static void *fromwire_pad_arr; -void fromwire_pad(const u8 **cursor, size_t *max, size_t num) -{ - fromwire(cursor, max, fromwire_pad_arr, num); -} - /* memsetting pubkeys doesn't work */ static void set_pubkey(struct pubkey *key) {