[PATCH 2/8] int10: warning fix

Mark Kettenis mark.kettenis at xs4all.nl
Sat Feb 12 14:05:49 PST 2011


> From: Adam Jackson <ajax at redhat.com>
> Date: Sun, 23 Jan 2011 23:18:06 -0500
> 
> helper_exec.c: In function 'pciCfg1in':
> helper_exec.c:507:4: warning: passing argument 2 of 'pci_device_cfg_read_u32' from incompatible pointer type
> /usr/include/pciaccess.h:153:5: note: expected 'uint32_t *' but argument is of type 'CARD32 *'

That fix isn't so obvious to me.  Why is your compiler warning about
this?  Is it just because you're on a 32-bit system, where CARD32 is
typedefed as "unsigned long", but uint32_t is typedefed as "unsigned
int"?

> Signed-off-by: Adam Jackson <ajax at redhat.com>
> ---
>  hw/xfree86/int10/helper_exec.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/hw/xfree86/int10/helper_exec.c b/hw/xfree86/int10/helper_exec.c
> index b9af473..ec84200 100644
> --- a/hw/xfree86/int10/helper_exec.c
> +++ b/hw/xfree86/int10/helper_exec.c
> @@ -504,7 +504,7 @@ pciCfg1in(CARD16 addr, CARD32 *val)
>      }
>      if (addr == 0xCFC) {
>  	pci_device_cfg_read_u32(pci_device_for_cfg_address(PciCfg1Addr),
> -			val, PCI_OFFSET(PciCfg1Addr));
> +			(uint32_t *)val, PCI_OFFSET(PciCfg1Addr));
>  	if (PRINT_PORT && DEBUG_IO_TRACE())
>  	    ErrorF(" cfg_inl(%#lx) = %8.8lx\n", PciCfg1Addr, *val);
>  	return 1;
> -- 
> 1.7.3.4
> 
> _______________________________________________
> xorg-devel at lists.x.org: X.Org development
> Archives: http://lists.x.org/archives/xorg-devel
> Info: http://lists.x.org/mailman/listinfo/xorg-devel
> 


More information about the xorg-devel mailing list