[PATCH] Avoid cast to unit64_t on 32bit platform

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Fixes compilation on 32bit platforms:

xen/xen_hypervisor.c: In function 'virXen_setvcpumap':
xen/xen_hypervisor.c:1785:35: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
xen/xen_hypervisor.c:1785:22: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
cc1: all warnings being treated as errors
---
 src/xen/xen_hypervisor.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/xen/xen_hypervisor.c b/src/xen/xen_hypervisor.c
index 9b7dd2e..e3de0b2 100644
--- a/src/xen/xen_hypervisor.c
+++ b/src/xen/xen_hypervisor.c
@@ -1782,7 +1782,7 @@ virXen_setvcpumap(int handle,
         memset(&xen_cpumap, 0, sizeof(cpumap_t));
         for (j = 0; j < maplen; j++) {
             if ((j & 7) == 0)
-                pm = (uint64_t *)((uint64_t)&xen_cpumap + (j & ~0x7UL));
+                pm = (uint64_t *)((intptr_t)&xen_cpumap + (j & ~0x7UL));
             *pm |= (uint64_t)cpumap[j] << (8 * (j & 7));
         }
 
-- 
1.7.10.4

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]