[PATCH:xf86-video-mga] Fix pointer cast warning.

Matt Turner mattst88 at gmail.com
Mon Feb 23 09:12:30 PST 2015


On Mon, Feb 23, 2015 at 2:39 AM, Thomas Klausner <wiz at netbsd.org> wrote:
> cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
>
> Signed-off-by: Thomas Klausner <wiz at NetBSD.org>
> ---
>  src/mga_exa.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/mga_exa.c b/src/mga_exa.c
> index 69ffa16..5024f54 100644
> --- a/src/mga_exa.c
> +++ b/src/mga_exa.c
> @@ -729,7 +729,7 @@ mgaDownloadFromScreen(PixmapPtr pSrc, int x, int y, int w, int h,
>  {
>      PMGA(pSrc);
>
> -    char *src = (char *) exaGetPixmapFirstPixel(pSrc);
> +    char *src = (char *)(unsigned long) exaGetPixmapFirstPixel(pSrc);

Use u/intptr_t. From there, I don't remember if the explicit char*
cast is necessary.


More information about the xorg-devel mailing list