Remove tal_len, use tal_count() or tal_bytelen().

tal_count() is used where there's a type, even if it's char or u8, and
tal_bytelen() is going to replace tal_len() for clarity: it's only needed
where a pointer is void.

We shim tal_bytelen() for now.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2018-07-28 15:30:16 +09:30
committed by Christian Decker
parent eae9b81099
commit 5cf34d6618
57 changed files with 200 additions and 195 deletions

View File

@@ -7,10 +7,10 @@
bool wire_sync_write(int fd, const void *msg TAKES)
{
wire_len_t hdr = cpu_to_wirelen(tal_len(msg));
wire_len_t hdr = cpu_to_wirelen(tal_bytelen(msg));
bool ret;
assert(tal_len(msg) < WIRE_LEN_LIMIT);
assert(tal_bytelen(msg) < WIRE_LEN_LIMIT);
ret = write_all(fd, &hdr, sizeof(hdr))
&& write_all(fd, msg, tal_count(msg));