FreeBSD/cddl/contrib/opensolaris/tools/ctf/cvt/ctf.c
/*
 * Pad the buffer to a power-of-2 boundary
 */
Pad the buffer to a power-of-2 boundary
Pad the buffer to a power - of - 2 boundary
static void
pad_buffer(ctf_buf_t *buf, int align)
{
	uint_t cur = ctf_buf_cur(buf);
	ssize_t topad = (align - (cur % align)) % align;
	static const char pad[8] = { 0 };
	while (topad > 0) {
		ctf_buf_write(buf, pad, (topad > 8 ? 8 : topad));
		topad -= 8;
	}
}
static void pad_buffer ( ctf_buf_t * buf , int align ) { uint_t cur = ctf_buf_cur ( buf ) ; ssize_t topad = ( align - ( cur % align ) ) % align ; static const char pad [ 8 ] = { 0 } ; while ( topad > 0 ) { ctf_buf_write ( buf , pad , ( topad > 8 ? 8 : topad ) ) ; topad -= 8 ; } }
Pad the buffer to a power-of-2 boundary
Pad the buffer to a power - of - 2 boundary