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

Alexander Strasser eclipse7 at gmx.net
Thu Aug 18 18:50:17 CEST 2011


Hi Ingo!

Ingo Brückl wrote:
> Alexander Strasser wrote on Wed, 17 Aug 2011 19:35:17 +0200:
> 
> >> long prop = pid;
> 
> >   Also if someone sees where this approach could be seriously
> > flawed, please speak up.
> 
> I try to ask again, although my first comment was in reply to Nicolas George.
> 
> Shouldn't it be:
> 
>   CARD32 prop = pid;
> 
> >From what I understand when looking at the X11 header files, CARD32 is the
> data type to be used for XA_CARDINAL, 32. CARD32 is long on 32-bit and int on
> 64-bit machines.

  That type must be long! Please read the XChangeProperty documentation
or the snippets I had in my first reply to this thread.

  And that is already the easy part of the problem, the other reasoning
comes from the fact that long and pid_t might be different integral types.
Based on the assumption that the type of pid_t is wider than 32 bits, I
raised the objection to my patch, that this must not mean it contains a
value that uses more then 32 bits. Nicolas then proposed a way to make
the decision based on the value contained in the pid variable of type
pid_t. That made it possible to test if we could fit the value into a
long, but neglects the fact that the EWMH PID property is only defined
for 32 bits and that we only for sure transport the 32 bits.

> If I'm wrong I might at least learn something here.

  Alexander


More information about the MPlayer-dev-eng mailing list