emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Type-error in C code


From: Julien Danjou
Subject: Re: Type-error in C code
Date: Fri, 12 Nov 2010 15:21:06 +0100
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/24.0.50 (gnu/linux)

On Fri, Nov 12 2010, Stefan Monnier wrote:

> static void
> set_wm_state (Lisp_Object frame, int add, Atom atom, Atom value)
> {
>   struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (XFRAME (frame));
>
>   x_send_client_event (frame, make_number (0), frame,
>                        dpyinfo->Xatom_net_wm_state,
>                        make_number (32),
>                        /* 1 = add, 0 = remove */
>                        Fcons
>                        (make_number (add ? 1 : 0),
>                         Fcons
>                         (atom,
>                          value != 0 ? value : Qnil)));
> }
>
> The error is to put an "Atom" into a cons cell: those can only hold
> Lisp_Objects.  The usual compilation flags won't catch the error because
> both types are actually some kind of integer, but if you
> compile --enable-use-lisp-union-type, the C compiler will
> dutyfully burp.

Good catch Stefan. I should use this flag to compile my code now.

The fix should be easy I think, you just need to replace atom with
make_number (atom).

I can provide a patch is that handier.

-- 
Julien Danjou
// ᐰ <address@hidden>   http://julien.danjou.info



reply via email to

[Prev in Thread] Current Thread [Next in Thread]