Re: [AD] Patches for allegro 4.1.9

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On 2003-02-05, Philipp Thomas <pthomas@xxxxxxxxxx> wrote:
> * Eric Botcazou (ebotcazou@xxxxxxxxxx) [20030205 14:58]:
> 
> > --- src/x/xwin.c
> > +++ src/x/xwin.c
> > @@ -2178,7 +2178,7 @@
> >  	 break;
> >        case ClientMessage:
> >           /* Window close request */
> > -         if (event->xclient.data.l[0] == wm_delete_window) {
> > +         if ((Atom)event->xclient.data.l[0] == wm_delete_window) {
> >              if (_xwin.close_button_callback)
> >                 _xwin.close_button_callback();
> > 
> > Why to cast to 'Atom'? 'l' is a 'long' according to my docs.
> 
> l is a long, but wm_delete_window is XInternAtom, i.e. Atom. I'd rather cast
> l to Atom than wm_delete_window to 'long'. But it's your choice to decide.

Eric, event->xclient.data is a C hack, so that data for new event types
can be passed using the X event system, without changing the definition
of the XEvent union.  So the cast to Atom is right.

-- 
王浩禎




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/