[PATCH 7/7] debug output format fix in xf86Helper.c
Peter Hutterer
peter.hutterer at who-t.net
Sun Aug 16 18:20:33 PDT 2015
On Thu, Aug 13, 2015 at 01:11:37PM +0100, Jon TURNEY wrote:
> xserver/hw/xfree86/common/xf86Helper.c:1834:12: error: format ‘%ld’ expects argument of type ‘long int’, but argument 3 has type ‘Atom’ [-Werror=format=]
> xserver/hw/xfree86/common/xf86Helper.c:1834:12: error: format ‘%ld’ expects argument of type ‘long int’, but argument 4 has type ‘Atom’ [-Werror=format=]
>
> Atom is unfortunately unsigned long or unsigned int depending on the
> architecture, so a cast is required.
that's only true for client/Xlib code but in the server it's always 32 bits.
include/X.h has a section for _XSERVER64 which defines typedef CARD32 Atom;
so you can change this to just %d instead.
Cheers,
Peter
>
> Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
> ---
> hw/xfree86/common/xf86Helper.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/hw/xfree86/common/xf86Helper.c b/hw/xfree86/common/xf86Helper.c
> index 359bac7..c42e93e 100644
> --- a/hw/xfree86/common/xf86Helper.c
> +++ b/hw/xfree86/common/xf86Helper.c
> @@ -1831,7 +1831,7 @@ xf86RegisterRootWindowProperty(int ScrnIndex, Atom property, Atom type,
> Bool existing = FALSE;
>
> DebugF("xf86RegisterRootWindowProperty(%d, %ld, %ld, %d, %ld, %p)\n",
> - ScrnIndex, property, type, format, len, value);
> + ScrnIndex, (long)property, (long)type, format, len, value);
>
> if (ScrnIndex < 0 || ScrnIndex >= xf86NumScreens) {
> return BadMatch;
> --
> 2.4.5
>
> _______________________________________________
> 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