[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH 08 of 15] hvmloader: Add a simple "scratch allocator"
On 02/06/2011 20:43, "Konrad Rzeszutek Wilk" <konrad.wilk@xxxxxxxxxx> wrote: >> + return (void *)(unsigned long)s; > > Why the double cast? gcc complains if you cast between a pointer and an integer of a different size. We assume in many places that a pointer is same size as a long, so we cast through a long when the original integer type may be different size. In this case, in hvmloader, we know that pointers/longs/uint32_t are all 32-bit, but still I quite like the principle of always casting through a long when the integer is not explicitly that type already. -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |