Skip to content

BufClear

Description

Reset length to zero without releasing the backing storage. The capacity is preserved so subsequent pushes can reuse it.

Success

Returns to the caller. b->length is 0.

Failure

Macro cannot fail.

Usage example (Cross-references)

Usage examples (Cross-references)
        BufWriteU8(&b, 0x43);
        ok = ok && BufLength(&b) == 2 && BufData(&b)[0] == 0x42 && BufData(&b)[1] == 0x43;
        BufClear(&b);
        ok = ok && BufLength(&b) == 0;
        BufDeinit(&b);
        }
    
        BufClear(&b);
        BufWriteSLeb128(&b, 0);
        BufWriteSLeb128(&b, -1);
Last updated on