FreeBSD/cddl/contrib/opensolaris/tools/ctf/cvt/ctf.c
/*
 * Depending on the size of the type being described, either a ctf_stype_t (for
 * types with size < CTF_LSTRUCT_THRESH) or a ctf_type_t (all others) will be
 * written.  We isolate the determination here so the rest of the writer code
 * doesn't need to care.
 */
Depending on the size of the type being described, either a ctf_stype_t (for
types with size < CTF_LSTRUCT_THRESH) or a ctf_type_t (all others) will be
written.  We isolate the determination here so the rest of the writer code
doesn't need to care.
Depending on the size of the type being described either a ctf_stype_t ( for types with size < CTF_LSTRUCT_THRESH ) or a ctf_type_t ( all others ) will be written . We isolate the determination here so the rest of the writer code doesn ' t need to care .
static void
write_sized_type_rec(ctf_buf_t *b, ctf_type_t *ctt, size_t size)
{
	if (size > CTF_MAX_SIZE) {
		ctt->ctt_size = CTF_LSIZE_SENT;
		ctt->ctt_lsizehi = CTF_SIZE_TO_LSIZE_HI(size);
		ctt->ctt_lsizelo = CTF_SIZE_TO_LSIZE_LO(size);
		if (target_requires_swap) {
			SWAP_32(ctt->ctt_name);
			SWAP_16(ctt->ctt_info);
			SWAP_16(ctt->ctt_size);
			SWAP_32(ctt->ctt_lsizehi);
			SWAP_32(ctt->ctt_lsizelo);
		}
		ctf_buf_write(b, ctt, sizeof (*ctt));
	} else {
		ctf_stype_t *cts = (ctf_stype_t *)ctt;
		cts->ctt_size = (ushort_t)size;
		if (target_requires_swap) {
			SWAP_32(cts->ctt_name);
			SWAP_16(cts->ctt_info);
			SWAP_16(cts->ctt_size);
		}
		ctf_buf_write(b, cts, sizeof (*cts));
	}
}
static void write_sized_type_rec ( ctf_buf_t * b , ctf_type_t * ctt , size_t size ) { if ( size > CTF_MAX_SIZE ) { ctt -> ctt_size = CTF_LSIZE_SENT ; ctt -> ctt_lsizehi = CTF_SIZE_TO_LSIZE_HI ( size ) ; ctt -> ctt_lsizelo = CTF_SIZE_TO_LSIZE_LO ( size ) ; if ( target_requires_swap ) { SWAP_32 ( ctt -> ctt_name ) ; SWAP_16 ( ctt -> ctt_info ) ; SWAP_16 ( ctt -> ctt_size ) ; SWAP_32 ( ctt -> ctt_lsizehi ) ; SWAP_32 ( ctt -> ctt_lsizelo ) ; } ctf_buf_write ( b , ctt , sizeof ( * ctt ) ) ; } else { ctf_stype_t * cts = ( ctf_stype_t * ) ctt ; cts -> ctt_size = ( ushort_t ) size ; if ( target_requires_swap ) { SWAP_32 ( cts -> ctt_name ) ; SWAP_16 ( cts -> ctt_info ) ; SWAP_16 ( cts -> ctt_size ) ; } ctf_buf_write ( b , cts , sizeof ( * cts ) ) ; } }
Depending on the size of the type being described, either a ctf_stype_t (for
 types with size < CTF_LSTRUCT_THRESH) or a ctf_type_t (all others) will be
 written.
Depending on the size of the type being described either a ctf_stype_t ( for types with size < CTF_LSTRUCT_THRESH ) or a ctf_type_t ( all others ) will be written .