FreeBSD/cddl/contrib/opensolaris/tools/ctf/cvt/ctf.c
/*
 * For lack of other inspiration, we're going to take the boring route.  We
 * count the number of types.  This lets us malloc that many tdesc structs
 * before we start filling them in.  This has the advantage of allowing us to
 * avoid a merge-esque remap step.
 */
For lack of other inspiration, we're going to take the boring route.  We
count the number of types.  This lets us malloc that many tdesc structs
before we start filling them in.  This has the advantage of allowing us to
avoid a merge-esque remap step.
For lack of other inspiration we ' re going to take the boring route . We count the number of types . This lets us malloc that many tdesc structs before we start filling them in . This has the advantage of allowing us to avoid a merge - esque remap step .
static tdata_t *
ctf_parse(ctf_header_t *h, caddr_t buf, symit_data_t *si, char *label)
{
	tdata_t *td = tdata_new();
	tdesc_t **tdarr;
	int idx, i;
	ntypes = count_types(h, buf);
	tdarr = xcalloc(sizeof (tdesc_t *) * (ntypes + 1));
	tdarr[0] = NULL;
	for (i = 1; i <= ntypes; i++) {
		tdarr[i] = xcalloc(sizeof (tdesc_t));
		tdarr[i]->t_id = i;
	}
	td->td_parlabel = xstrdup(buf + h->cth_stroff + h->cth_parlabel);
	idx = resurrect_labels(h, td, buf, label);
	resurrect_objects(h, td, tdarr, ntypes + 1, buf, si);
	resurrect_functions(h, td, tdarr, ntypes + 1, buf, si);
	resurrect_types(h, td, tdarr, ntypes + 1, buf, idx);
	free(tdarr);
	td->td_nextid = ntypes + 1;
	return (td);
}
static tdata_t * ctf_parse ( ctf_header_t * h , caddr_t buf , symit_data_t * si , char * label ) { tdata_t * td = tdata_new ( ) ; tdesc_t * * tdarr ; int idx , i ; ntypes = count_types ( h , buf ) ; tdarr = xcalloc ( sizeof ( tdesc_t * ) * ( ntypes + 1 ) ) ; tdarr [ 0 ] = NULL ; for ( i = 1 ; i <= ntypes ; i ++ ) { tdarr [ i ] = xcalloc ( sizeof ( tdesc_t ) ) ; tdarr [ i ] -> t_id = i ; } td -> td_parlabel = xstrdup ( buf + h -> cth_stroff + h -> cth_parlabel ) ; idx = resurrect_labels ( h , td , buf , label ) ; resurrect_objects ( h , td , tdarr , ntypes + 1 , buf , si ) ; resurrect_functions ( h , td , tdarr , ntypes + 1 , buf , si ) ; resurrect_types ( h , td , tdarr , ntypes + 1 , buf , idx ) ; free ( tdarr ) ; td -> td_nextid = ntypes + 1 ; return ( td ) ; }
For lack of other inspiration, we're going to take the boring route.
For lack of other inspiration we ' re going to take the boring route .
/* shudder */ /* we have the technology - we can rebuild them */