Date: Tue, 4 May 1999 15:42:26 +0930 From: Greg Lehey <grog@lemis.com> To: Mike Smith <mike@smith.net.au> Cc: Nick Hibma <hibma@skylink.it>, FreeBSD Chat <chat@FreeBSD.ORG> Subject: Hysterical names (was: names of globale variables) Message-ID: <19990504154225.S10134@freebie.lemis.com> In-Reply-To: <199905040143.SAA01330@dingo.cdrom.com>; from Mike Smith on Mon, May 03, 1999 at 06:43:09PM -0700 References: <Pine.BSF.3.96.990503231631.3991A-100000@heidi.plazza.it> <199905040143.SAA01330@dingo.cdrom.com>
next in thread | previous in thread | raw e-mail | index | archive | help
[following up to -chat]
On Monday, 3 May 1999 at 18:43:09 -0700, Mike Smith wrote:
>>
>> Isn't the choice of the variables names below a bit odd? It crashed my
>> machine three times because of a typo (buf instead of buffer) in the
>> USB Communications Class Driver.
>>
>> Wouldn't some more elaborate names be more appropriate to avoid these
>> problems?
>
> "struct buf" is actually a very longstanding BSD tradition. I don't
> think we would easily be able to rename it, no.
It goes back further than BSD. Here's the definition from a pre-BSD
/usr/src/buf.h, probably some of the oldest C code in existence:
-rw-r--r-- 1 root wheel 592 Jan 22 1973 buf.h
struct buf {
int b_flags;
struct buf *b_forw;
struct buf *b_back;
struct buf *av_forw;
struct buf *av_back;
int b_dev;
int b_wcount;
char *b_addr;
char *b_blkno;
} buf[NBUF];
This is the Third Edition of AT&T UNIX (and no, it doesn't have a
copyright notice :-).
Greg
--
See complete headers for address, home page and phone numbers
finger grog@lemis.com for PGP public key
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19990504154225.S10134>
