Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 18 May 2000 18:13:17 +1000 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        Don Lewis <Don.Lewis@tsc.tdk.com>
Cc:        Jonathan Lemon <jlemon@FreeBSD.org>, cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/sys/netinet ip_input.c
Message-ID:  <Pine.BSF.4.21.0005181803030.7355-100000@besplex.bde.org>
In-Reply-To: <200005171521.IAA29807@salsa.gv.tsc.tdk.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0005181803030.7355-100000>