|
|
|
|
|
|
|
|
|
|
xen-devel
Re: [Xen-devel] [PATCH 08 of 15] hvmloader: Add a simple "scratch alloca
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
|
<Prev in Thread] |
Current Thread |
[Next in Thread>
|
- [Xen-devel] [PATCH 09 of 15] hvmloader: refactor BIOS info setup, (continued)
- [Xen-devel] [PATCH 09 of 15] hvmloader: refactor BIOS info setup, Ian Campbell
- [Xen-devel] [PATCH 11 of 15] hvmloader: allow create_mp_tables() to allocate the table, Ian Campbell
- [Xen-devel] [PATCH 02 of 15] hvmloader: enable PCI_COMMAND_IO on primary VGA device, Ian Campbell
- [Xen-devel] [PATCH 13 of 15] hvmloader: further support for SeaBIOS, Ian Campbell
- [Xen-devel] [PATCH 06 of 15] hvmloader: make ACPI initialisation hook more general, Ian Campbell
- [Xen-devel] [PATCH 15 of 15] hvmloader: add code to generate a $PIR table, Ian Campbell
- [Xen-devel] [PATCH 04 of 15] hvmloader: setup APICs in a common function again, Ian Campbell
- [Xen-devel] [PATCH 08 of 15] hvmloader: Add a simple "scratch allocator", Ian Campbell
- [Xen-devel] [PATCH 10 of 15] hvmloader: return MPFPS from create_mp_tables(), Ian Campbell
- [Xen-devel] [PATCH 14 of 15] hvmloader: allow the possibility to allocate the size of smbios table we actually need, Ian Campbell
- [Xen-devel] [PATCH 12 of 15] hvmloader: smbios: allow the entry point data structure to be located separately, Ian Campbell
|
|
|
|
|