From owner-freebsd-current Mon Oct 21 04:12:16 1996 Return-Path: owner-current Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id EAA07291 for current-outgoing; Mon, 21 Oct 1996 04:12:16 -0700 (PDT) Received: from parkplace.cet.co.jp (parkplace.cet.co.jp [202.32.64.1]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id EAA07281 for ; Mon, 21 Oct 1996 04:12:13 -0700 (PDT) Received: from localhost (michaelh@localhost) by parkplace.cet.co.jp (8.8.0/CET-v2.1) with SMTP id LAA24702; Mon, 21 Oct 1996 11:11:45 GMT Date: Mon, 21 Oct 1996 20:11:45 +0900 (JST) From: Michael Hancock Reply-To: Michael Hancock To: Poul-Henning Kamp cc: John Polstra , bde@zeta.org.au, current@FreeBSD.org, wollman@lcs.mit.edu Subject: Re: In-Reply-To: <25642.845877311@critter.tfs.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-current@FreeBSD.org X-Loop: FreeBSD.org Precedence: bulk On Mon, 21 Oct 1996, Poul-Henning Kamp wrote: > >It's questionable to define a typedef just to save typing the word struct. > > The reason I do it is not to save 7 chars of typing. > > It's because we are talking about a self-contained type that carries > with it all the operations you can perform on it. I think you should do the changes you mention to queue.h and change the man page example to the following... *** foo1 Mon Oct 21 20:06:06 1996 --- foo2 Mon Oct 21 20:05:33 1996 *************** *** 1,10 **** #include ! SLIST_HEAD(slisthead, entry) head; struct slisthead *headp; /* Singly-linked List head. */ struct entry { int i; ! SLIST_ENTRY(entry) entries; /* Singly-linked List. */ } *n1, *n2, *n3, *np; --- 1,10 ---- #include ! SLIST_HEAD(slisthead, struct entry) head; struct slisthead *headp; /* Singly-linked List head. */ struct entry { int i; ! SLIST_ENTRY(struct entry) entries; /* Singly-linked List. */ } *n1, *n2, *n3, *np; The original mixes up tag names and type names, which is a bogus thing to do. Use typedefs for scalars such as dev_t and for complex objects that combine arrays, pointers, structs, and functions. For simple structs, the typedef doesn't gain you much aside from not having to type "struct". Regards, Mike Hancock