mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 07:04:22 +01:00
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:
committed by
Christian Decker
parent
eae9b81099
commit
5cf34d6618
@@ -206,7 +206,7 @@ fromwire_impl_templ = """bool fromwire_{name}({ctx}const void *p{args})
|
||||
{{
|
||||
{fields}
|
||||
\tconst u8 *cursor = p;
|
||||
\tsize_t plen = tal_len(p);
|
||||
\tsize_t plen = tal_count(p);
|
||||
|
||||
\tif (fromwire_u16(&cursor, &plen) != {enum.name})
|
||||
\t\treturn false;
|
||||
@@ -235,7 +235,7 @@ printwire_header_templ = """void printwire_{name}(const char *fieldname, const u
|
||||
"""
|
||||
printwire_impl_templ = """void printwire_{name}(const char *fieldname, const u8 *cursor)
|
||||
{{
|
||||
\tsize_t plen = tal_len(cursor);
|
||||
\tsize_t plen = tal_count(cursor);
|
||||
|
||||
\tif (fromwire_u16(&cursor, &plen) != {enum.name}) {{
|
||||
\t\tprintf("WRONG TYPE?!\\n");
|
||||
|
||||
Reference in New Issue
Block a user