[MPlayer-dev-eng] [PATCH] x11_common: XChangeProperty uses long for 32-bits

Nicolas George nicolas.george at normalesup.org
Fri Aug 19 10:20:40 CEST 2011


Le duodi 2 fructidor, an CCXIX, Ingo Brückl a écrit :
> I did, and this is what confuses me. The documentation says:
> 
> format    Specifies whether the data should be viewed as a list of
>           8-bit, 16-bit, or 32-bit quantities. Possible values are
>           8, 16, and 32.

And it also says: 

       If the specified format is 8, the property data must be a char array.
       If the specified format is 16, the property data must be a short array.
       If the specified format is 32, the property data must be a long array.

And the sources confirm it:

http://cgit.freedesktop.org/xorg/lib/libX11/tree/src/ChProp.c#n78
http://cgit.freedesktop.org/xorg/lib/libX11/tree/src/XlibInt.c#n1738

> CARD32 always is a 32-bit quantity, while "long" on 64-bit machines isn't.
> So why "long"?

That's just the way they did things. I guess they were more worried that int
could be too small than that long could be too big, and they did not think
to make it a typedef.

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20110819/5129c940/attachment.asc>


More information about the MPlayer-dev-eng mailing list