Tk Source Code

Check-in [ac4aa533]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Don't work around XkbOpenDisplay's non-const-ness with a macro, when there is only a single call. A type-cast suffices.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: ac4aa5331aa6a0d5af3d806629081db8ea6cb661
User & Date: jan.nijtmans 2013-04-08 07:57:13
Original Comment: Don't work arounc XkbOpenDisplay's non-const-ness with a macro, when there is only a single call. A type-case suffices.
Context
2013-04-10
15:21
[Bug 3568760]: Tk documentation fails to build check-in: edf6d2b7 user: jan.nijtmans tags: trunk
2013-04-08
07:57
Don't work around XkbOpenDisplay's non-const-ness with a macro, when there is only a single call. A type-cast suffices. check-in: ac4aa533 user: jan.nijtmans tags: trunk
07:52
Don't work around XkbOpenDisplay's non-const-ness with a macro, when there is only a single call. A type-cate suffices. Merge-mark core-8-5-14, just to document that really all changes are merged back. check-in: 2be35e8b user: jan.nijtmans tags: core-8-5-branch
2013-04-03
13:54
make dist check-in: 9b73661a user: dgp tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to unix/tkUnixEvent.c.

10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
 * this file, and for a DISCLAIMER OF ALL WARRANTIES.
 */

#include "tkUnixInt.h"
#include <signal.h>
#ifdef HAVE_XKBKEYCODETOKEYSYM
#  include <X11/XKBlib.h>
/* Work around stupid un-const-ified Xkb headers.  Grrrrr.... */
#  define XkbOpenDisplay(D,V,E,M,m,R) \
	(XkbOpenDisplay)((char *)(D),(V),(E),(M),(m),(R))
#else
#  define XkbOpenDisplay(D,V,E,M,m,R) (V),(E),(M),(m),(R),(NULL)
#endif

/*
 * The following static indicates whether this module has been initialized in
 * the current thread.







<
<
<







10
11
12
13
14
15
16



17
18
19
20
21
22
23
 * this file, and for a DISCLAIMER OF ALL WARRANTIES.
 */

#include "tkUnixInt.h"
#include <signal.h>
#ifdef HAVE_XKBKEYCODETOKEYSYM
#  include <X11/XKBlib.h>



#else
#  define XkbOpenDisplay(D,V,E,M,m,R) (V),(E),(M),(m),(R),(NULL)
#endif

/*
 * The following static indicates whether this module has been initialized in
 * the current thread.
149
150
151
152
153
154
155


156
157

158
159
160
161
162
163
164
#endif

    /*
    ** Bug [3607830]: Before using Xkb, it must be initialized and confirmed
    **                that the serve supports it.  The XkbOpenDisplay call
    **                will perform this check and return NULL if the extension
    **                is not supported.


    */
    display = XkbOpenDisplay(displayNameStr, &event, &error, &major, &minor, &reason);


    if (display == NULL) {
	/*fprintf(stderr,"event=%d error=%d major=%d minor=%d reason=%d\nDisabling xkb\n",
	event, error, major, minor, reason);*/
	display  = XOpenDisplay(displayNameStr);
    } else {
	use_xkb = TK_DISPLAY_USE_XKB;







>
>

|
>







146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
#endif

    /*
    ** Bug [3607830]: Before using Xkb, it must be initialized and confirmed
    **                that the serve supports it.  The XkbOpenDisplay call
    **                will perform this check and return NULL if the extension
    **                is not supported.
    **
    ** Work around un-const-ified Xkb headers using (char *) cast.
    */
    display = XkbOpenDisplay((char *)displayNameStr, &event, &error, &major,
	    &minor, &reason);

    if (display == NULL) {
	/*fprintf(stderr,"event=%d error=%d major=%d minor=%d reason=%d\nDisabling xkb\n",
	event, error, major, minor, reason);*/
	display  = XOpenDisplay(displayNameStr);
    } else {
	use_xkb = TK_DISPLAY_USE_XKB;