[Top][All Lists]
[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
- Type-error in C code, Stefan Monnier, 2010/11/12
- Re: Type-error in C code,
Julien Danjou <=
- Re: Type-error in C code, Jan Djärv, 2010/11/12
- Re: Type-error in C code, Julien Danjou, 2010/11/12
- Re: Type-error in C code, Julien Danjou, 2010/11/12
- Re: Type-error in C code, Julien Danjou, 2010/11/12
- Re: Type-error in C code, Eli Zaretskii, 2010/11/12
- Re: Type-error in C code, Julien Danjou, 2010/11/12
- Re: Type-error in C code, John Yates, 2010/11/12
- Re: Type-error in C code, Eli Zaretskii, 2010/11/12
- Re: Type-error in C code, Andreas Schwab, 2010/11/12
- Re: Type-error in C code, Miles Bader, 2010/11/12