From owner-cvs-all Thu May 18 1:13:47 2000 Delivered-To: cvs-all@freebsd.org Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by hub.freebsd.org (Postfix) with ESMTP id 8089B37B51C; Thu, 18 May 2000 01:13:36 -0700 (PDT) (envelope-from bde@zeta.org.au) Received: from bde.zeta.org.au (bde.zeta.org.au [203.2.228.102]) by mailman.zeta.org.au (8.8.7/8.8.7) with ESMTP id SAA00611; Thu, 18 May 2000 18:13:20 +1000 Date: Thu, 18 May 2000 18:13:17 +1000 (EST) From: Bruce Evans X-Sender: bde@besplex.bde.org To: Don Lewis Cc: Jonathan Lemon , cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/netinet ip_input.c In-Reply-To: <200005171521.IAA29807@salsa.gv.tsc.tdk.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Wed, 17 May 2000, Don Lewis wrote: > On May 16, 9:05pm, Jonathan Lemon wrote: > } Subject: cvs commit: src/sys/netinet ip_input.c > } jlemon 2000/05/16 21:05:07 PDT > } > } Modified files: > } sys/netinet ip_input.c > } Log: > } Cast sizeof() calls to be of type (int) when they appear in a signed > } integer expression. Otherwise the sizeof() call will force the expression > } to be evaluated as unsigned, which is not the intended behavior. > > Wouldn't (ssize_t) be more correct? I don't expect it to make any > difference in this case, but on some architectures the size of a large > object may not fit in an int. The casts of of tiny objects (two struct in_addr's and one int32_t). For large objects, the size might not fit in an ssize_t, so you may as well use int if that is natural and works. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message