From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <775b8d190601170855u10fe7d95gc268a7da50fbf1de@mail.gmail.com> Date: Wed, 18 Jan 2006 03:55:26 +1100 From: Bruce Ellis To: Fans of the OS Plan 9 from Bell Labs <9fans@cse.psu.edu> Subject: Re: [9fans] ulong In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: Topicbox-Message-UUID: dc0ec3c8-ead0-11e9-9d60-3106f5b1d025 i've seen code that uses 53 where i suspect it means 54. rarely does any "fancy casting stuff" work on more than one platform. brucee On 1/17/06, Russ Cox wrote: > > > (vlong)(...|((p)[3]<<24)) sign extends. Casting the (p)[0] > > > to (ulong) has the effect of making the whole 32-bit expression > > > unsigned on 32-bit systems, but if ulong is 64 bits, then > > > you'll still sign-extend ((p)[3]<<24) during the convertsion > > > from int to ulong. > > > > i'd be careful to define ulong to be 32 bits for all plan 9 source > > including p9p (using `ulong =3D=3D unsigned int' if necessary). > > otherwise quite a bit more will break. > > having fcall.h use u32int is fine too, of course, just to make the poin= t clearer > > I started out doing ulong=3D=3Dunsigned int (cf. drawterm), > but that implies long=3D=3Dint, and I just couldn't bear to do > that for p9p. I've been fixing problems as they come up. > Libmemdraw needed changes (which I expected), and > libmp did too (which I didn't). Do you know of other code? > > Russ >