New macro 'l_numbits'

This commit is contained in:
Roberto Ierusalimschy
2025-03-27 12:38:29 -03:00
parent b0f3df16a4
commit ef5d171cc8
6 changed files with 9 additions and 15 deletions

View File

@@ -87,7 +87,7 @@ static void dumpByte (DumpState *D, int y) {
** size for 'dumpVarint' buffer: each byte can store up to 7 bits.
** (The "+6" rounds up the division.)
*/
#define DIBS ((sizeof(size_t) * CHAR_BIT + 6) / 7)
#define DIBS ((l_numbits(size_t) + 6) / 7)
/*
** Dumps an unsigned integer using the MSB Varint encoding