From owner-freebsd-current Sat Mar 6 10:35:30 1999 Delivered-To: freebsd-current@freebsd.org Received: from ns.mt.sri.com (sri-gw.MT.net [206.127.105.141]) by hub.freebsd.org (Postfix) with ESMTP id 81C8F1528D for ; Sat, 6 Mar 1999 10:35:28 -0800 (PST) (envelope-from nate@mt.sri.com) Received: from mt.sri.com (rocky.mt.sri.com [206.127.76.100]) by ns.mt.sri.com (8.8.8/8.8.8) with SMTP id LAA15881; Sat, 6 Mar 1999 11:35:08 -0700 (MST) (envelope-from nate@rocky.mt.sri.com) Received: by mt.sri.com (SMI-8.6/SMI-SVR4) id LAA24560; Sat, 6 Mar 1999 11:34:57 -0700 Date: Sat, 6 Mar 1999 11:34:57 -0700 Message-Id: <199903061834.LAA24560@mt.sri.com> From: Nate Williams MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: Brian Feldman Cc: Nate Williams , John Polstra , current@FreeBSD.ORG Subject: Re: callout changes nit In-Reply-To: References: <199903061736.KAA24445@mt.sri.com> X-Mailer: VM 6.34 under 19.16 "Lille" XEmacs Lucid Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > > > > I make a habit of checking out any interesting kernel changes in full, and one > > > > thing I found in the recent diff by Mr. Wollman for kern_timeout.c is: > > > > > > > > +void > > > > +callout_init(c) > > > > + struct callout *c; > > > > +{ > > > > + bzero(c, sizeof c); > > > > } > > > > > > > > That doesn't look correct, does it? > > > > > > Agreed. I think it should be "sizeof *c". > > > > Ahh, I see. I think it should say > > > > bzero(c, sizeof(struct callout)); > > > > To avoid the compiler using the size of the pointers et. al. > > > > I prefer to do this in my own code, usually. However, using *c doesn't > "use the size of the pointer". Understood, but the point being that Garrett is an experienced programmer, and made this mistake. The latter version avoids any possibilities of said mistake. Nate To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message