From mboxrd@z Thu Jan 1 00:00:00 1970 Mime-Version: 1.0 (Apple Message framework v746.2) In-Reply-To: <9ab217670601131633x7fa1f177u@mail.gmail.com> References: <20060113164151.ED27C35076@dexter-peak.quanstro.net> <516c07525677816b5a69698dca337a86@vitanuova.com> <9ab217670601131633x7fa1f177u@mail.gmail.com> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: Content-Transfer-Encoding: 7bit From: Paul Lalonde Subject: Re: [9fans] tarfs & 2GB limit Date: Fri, 13 Jan 2006 16:59:10 -0800 To: Fans of the OS Plan 9 from Bell Labs <9fans@cse.psu.edu> Topicbox-Message-UUID: d6a5cb70-ead0-11e9-9d60-3106f5b1d025 And though it doesn't feel very plan9ish, I'm now going to sing the virtues of . having standard sized integer types (int32_t, uint32_t, et al), along with intptr_t (an int that can hold any pointer) just makes too much sense, and adds information for the reader: you can be pretty sure you're mucking with addressing in an intptr_t; and that you need 16 bits with a uint16_t. If only converting old code with sizeof(int) == sizeof(int32_t) and sizeof(void *) == sizeof(int) assumptions weren't so time consuming :-( Paul On 13-Jan-06, at 4:33 PM, Devon H. O'Dell wrote: > 2006/1/13, C H Forsyth : >> 51c52 >> < f.addr = (void*)(blkno+1); >> --- >>> f.addr = (void*)((ulong)blkno+1); >> >> it will be cleaner to have fileinf declare >> union { >> void* addr; >> ulong blockno; >> }; >> (or whatever is required) and use the right member of the union. >> just say `no' to converting between void* and integers, when it's >> not essential. > > Yes, this happens wayyyy too often. Since sizeof(int) and sizeof(void > *) are not the same on AMD64, there's even more reason to try to avoid > it. > > --Devon