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

@@ -741,7 +741,7 @@ bool sqlite3_bind_short_channel_id_array(sqlite3_stmt *stmt, int col,
for (i = 0; i < num; ++i)
towire_short_channel_id(&ser, &id[i]);
sqlite3_bind_blob(stmt, col, ser, tal_len(ser), SQLITE_TRANSIENT);
sqlite3_bind_blob(stmt, col, ser, tal_count(ser), SQLITE_TRANSIENT);
tal_free(ser);
return true;
@@ -776,7 +776,7 @@ sqlite3_column_short_channel_id_array(const tal_t *ctx,
bool sqlite3_bind_tx(sqlite3_stmt *stmt, int col, const struct bitcoin_tx *tx)
{
u8 *ser = linearize_tx(NULL, tx);
sqlite3_bind_blob(stmt, col, ser, tal_len(ser), SQLITE_TRANSIENT);
sqlite3_bind_blob(stmt, col, ser, tal_count(ser), SQLITE_TRANSIENT);
tal_free(ser);
return true;
}
@@ -838,7 +838,7 @@ bool sqlite3_bind_pubkey_array(sqlite3_stmt *stmt, int col,
for (i = 0; i < n; ++i)
pubkey_to_der(&ders[i * PUBKEY_DER_LEN], &pks[i]);
sqlite3_bind_blob(stmt, col, ders, tal_len(ders), SQLITE_TRANSIENT);
sqlite3_bind_blob(stmt, col, ders, tal_count(ders), SQLITE_TRANSIENT);
tal_free(ders);
return true;