Skip to content

Commit

Permalink
tools/generate-wire: don't use void * pointers for tlv fromwire.
Browse files Browse the repository at this point in the history
And fix up the one place which got it wrong.

Signed-off-by: Rusty Russell <[email protected]>
  • Loading branch information
rustyrussell authored and niftynei committed Dec 5, 2020
1 parent c5a2e64 commit dc83e64
Show file tree
Hide file tree
Showing 39 changed files with 59 additions and 68 deletions.
2 changes: 1 addition & 1 deletion channeld/channeld_wiregen.c

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion channeld/channeld_wiregen.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion closingd/closingd_wiregen.c

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion closingd/closingd_wiregen.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion common/peer_status_wiregen.c

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion common/peer_status_wiregen.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion common/status_wiregen.c

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion common/status_wiregen.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion connectd/connectd_gossipd_wiregen.c

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion connectd/connectd_gossipd_wiregen.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion connectd/connectd_wiregen.c

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion connectd/connectd_wiregen.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions devtools/blindedpath.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,12 @@ int main(int argc, char **argv)
u8 *p;
u8 buf[BIGSIZE_MAX_LEN];
const unsigned char npub[crypto_aead_chacha20poly1305_ietf_NPUBBYTES] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
struct tlv_onionmsg_payload *inner, *outer;
struct tlv_onionmsg_payload *outer;
struct tlv_encmsg_tlvs *inner;
int ret;

/* Inner is encrypted */
inner = tlv_onionmsg_payload_new(tmpctx);
inner = tlv_encmsg_tlvs_new(tmpctx);
/* Use scid if they provided one */
if (scids[i]) {
inner->next_short_channel_id
Expand Down
2 changes: 1 addition & 1 deletion gossipd/gossip_store_wiregen.c

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion gossipd/gossip_store_wiregen.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion gossipd/gossipd_peerd_wiregen.c

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion gossipd/gossipd_peerd_wiregen.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion gossipd/gossipd_wiregen.c

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion gossipd/gossipd_wiregen.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion hsmd/hsmd_wiregen.c

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion hsmd/hsmd_wiregen.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion onchaind/onchaind_wiregen.c

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion onchaind/onchaind_wiregen.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion openingd/dualopend_wiregen.c

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion openingd/dualopend_wiregen.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion openingd/openingd_wiregen.c

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion openingd/openingd_wiregen.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tools/gen/header_template
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ bool fromwire_${tlv.name}(const u8 **cursor, size_t *max,
* ensures that the resulting stream is valid according to
* `${tlv.name}_is_valid`.
*/
void towire_${tlv.name}(u8 **pptr, const void *record);
void towire_${tlv.name}(u8 **pptr, const struct ${tlv.struct_name()} *record);

/**
* Check that the TLV stream is valid.
Expand Down
3 changes: 1 addition & 2 deletions tools/gen/impl_template
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,7 @@ ${static}const struct tlv_record_type tlvs_${tlv.name}[] = {
% endfor
};

void towire_${tlv.name}(u8 **pptr,
const void *record)
void towire_${tlv.name}(u8 **pptr, const struct ${tlv.struct_name()} *record)
{
size_t num_types = ${len(tlv.messages)};
const struct tlv_record_type *types = tlvs_${tlv.name};
Expand Down
2 changes: 1 addition & 1 deletion wire/common_wiregen.c

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion wire/common_wiregen.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion wire/onion_printgen.c

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion wire/onion_printgen.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions wire/onion_wiregen.c

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions wire/onion_wiregen.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion wire/peer_printgen.c

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion wire/peer_printgen.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 9 additions & 17 deletions wire/peer_wiregen.c

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit dc83e64

Please sign in to comment.