memset(nhte->h_link, 0, sizeof (hte_t));
mkstatic(hte)	hte_t	*hte;{	sym_t	*sym1, **symp, *sym;	fcall_t	**callp, *call;	usym_t	**usymp, *usym;	hte_t	*nhte;	int	ofnd;	/* Look for first static definition */	for (sym1 = hte->h_syms; sym1 != NULL; sym1 = sym1->s_nxt) {		if (sym1->s_static)			break;	}	if (sym1 == NULL)		return;	/* Do nothing if this name is used only in one translation unit. */	ofnd = 0;	for (sym = hte->h_syms; sym != NULL && !ofnd; sym = sym->s_nxt) {		if (sym->s_pos.p_src != sym1->s_pos.p_src)			ofnd = 1;	}	for (call = hte->h_calls; call != NULL && !ofnd; call = call->f_nxt) {		if (call->f_pos.p_src != sym1->s_pos.p_src)			ofnd = 1;	}	for (usym = hte->h_usyms; usym != NULL && !ofnd; usym = usym->u_nxt) {		if (usym->u_pos.p_src != sym1->s_pos.p_src)			ofnd = 1;	}	if (!ofnd) {		hte->h_used = 1;		/* errors about undef. static symbols are printed in lint1 */		hte->h_def = 1;		hte->h_static = 1;		return;	}	/*	 * Create a new hash table entry	 *	 * XXX this entry should be put at the beginning of the list to	 * avoid to process the same symbol twice.	 */	for (nhte = hte; nhte->h_link != NULL; nhte = nhte->h_link) ;	nhte->h_link = xalloc(sizeof (hte_t));	nhte = nhte->h_link;	nhte->h_name = hte->h_name;	nhte->h_static = 1;	nhte->h_used = 1;	nhte->h_def = 1;	/* error in lint1 */	nhte->h_lsym = &nhte->h_syms;	nhte->h_lcall = &nhte->h_calls;	nhte->h_lusym = &nhte->h_usyms;	/*	 * move all symbols used in this translation unit into the new	 * hash table entry.	 */	for (symp = &hte->h_syms; (sym = *symp) != NULL; ) {		if (sym->s_pos.p_src == sym1->s_pos.p_src) {			sym->s_static = 1;			(*symp) = sym->s_nxt;			if (hte->h_lsym == &sym->s_nxt)				hte->h_lsym = symp;			sym->s_nxt = NULL;			*nhte->h_lsym = sym;			nhte->h_lsym = &sym->s_nxt;		} else {			symp = &sym->s_nxt;		}	}	for (callp = &hte->h_calls; (call = *callp) != NULL; ) {		if (call->f_pos.p_src == sym1->s_pos.p_src) {			(*callp) = call->f_nxt;			if (hte->h_lcall == &call->f_nxt)				hte->h_lcall = callp;			call->f_nxt = NULL;			*nhte->h_lcall = call;			nhte->h_lcall = &call->f_nxt;		} else {			callp = &call->f_nxt;		}	}	for (usymp = &hte->h_usyms; (usym = *usymp) != NULL; ) {		if (usym->u_pos.p_src == sym1->s_pos.p_src) {			(*usymp) = usym->u_nxt;			if (hte->h_lusym == &usym->u_nxt)				hte->h_lusym = usymp;			usym->u_nxt = NULL;			*nhte->h_lusym = usym;			nhte->h_lusym = &usym->u_nxt;		} else {			usymp = &usym->u_nxt;		}	}	/* h_def must be recalculated for old hte */	hte->h_def = nhte->h_def = 0;	for (sym = hte->h_syms; sym != NULL; sym = sym->s_nxt) {		if (sym->s_def == DEF || sym->s_def == TDEF) {			hte->h_def = 1;			break;		}	}	mkstatic(hte);}